Guest User

Untitled

a guest
Apr 21st, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 495.85 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.lang.reflect.Method;
  12. import sign.signlink;
  13. import javax.swing.*;
  14.  
  15. import java.lang.String;
  16. import java.awt.event.*;
  17. import java.io.BufferedReader;
  18. import java.io.File;
  19. import java.io.FileOutputStream;
  20. import java.io.InputStreamReader;
  21. import java.net.InetAddress;
  22. import java.net.URL;
  23. import java.util.ArrayList;
  24. import java.util.Date;
  25. import java.util.Hashtable;
  26. import java.util.List;
  27. import javax.swing.*;
  28. import javax.swing.plaf.metal.MetalLookAndFeel;
  29. import sign.signlink;
  30. import java.awt.*;
  31. import java.awt.event.*;
  32.  
  33.  
  34.  
  35.  
  36. public class client extends RSApplet {
  37. public boolean
  38. is459 = false,
  39. is474 = true,
  40. is480 = false,
  41. is508 = false,
  42. is525 = false,
  43. idToggle = false,
  44. hitbarToggle = true,
  45. menuToggle = false,
  46. namesToggle = false,
  47. hitmarks = true;
  48. public boolean cursePray = true;
  49. public int tColour = 0;
  50. public int tEffect = 0;
  51. public static boolean
  52. newDamage = false,
  53. normalLogin = true;//KEEP TRUE!
  54.  
  55. public TextDrawingArea newSmallFont;
  56. public TextDrawingArea newRegularFont;
  57. public TextDrawingArea newBoldFont;
  58. public TextDrawingArea newFancyFont;
  59. public Sprite[] chatImages = new Sprite[7];
  60. private Sprite LFull;
  61. private Sprite LEmpty;
  62. public boolean selectAction;
  63. public int isClicked;
  64. public Sprite[] LOGIN = new Sprite[27];
  65. public Sprite qc;
  66. public int followPlayer = 0;
  67. public int followNPC = 0;
  68. public int followDistance = 1;
  69.  
  70. public void welcome() {
  71. }
  72. public void drawbutton(String sprite, int X, int Y){
  73. Graphics g = getGameComponent().getGraphics();
  74. Image button = Toolkit.getDefaultToolkit().getImage(""+sprite+".PNG");
  75. g.drawImage(button,X,Y,this);
  76. }
  77. public void addLoginScreenHover(Sprite[] spriteName,int spriteId, int Xpos, int Ypos, int hoverId){
  78. spriteName[spriteId].drawSprite(Xpos, Ypos);
  79. if(super.mouseX >= Xpos && super.mouseX <= Xpos + spriteName[spriteId].myWidth && super.mouseY >= Ypos+3 && super.mouseY <= Ypos+spriteName[spriteId].myHeight+2){
  80. spriteName[hoverId].drawSprite(Xpos, Ypos);
  81. }
  82. }
  83.  
  84. public void setSidebarInterface(int sidebarID, int interfaceID) {
  85. tabInterfaceIDs[sidebarID] = interfaceID;
  86. tabID = sidebarID;
  87. needDrawTabArea = true;
  88. tabAreaAltered = true;
  89. }
  90.  
  91. public int positions[] = new int[2000];
  92. public int landScapes[] = new int[2000];
  93. public int objects[] = new int[2000];
  94.  
  95. public void setNewMaps() {
  96. try {
  97. BufferedReader in = new BufferedReader(new FileReader(signlink.findcachedir()+"Maps/mapConfig.txt"));
  98. String s;
  99. int D = 0;
  100. while ((s = in.readLine()) != null) {
  101. positions[D] = Integer.parseInt(s.substring(s.indexOf("=")+1,s.indexOf("(")));
  102. landScapes[D] = Integer.parseInt(s.substring(s.indexOf("(")+1,s.indexOf(")")));
  103. objects[D] = Integer.parseInt(s.substring(s.indexOf("[")+1,s.indexOf("]")));
  104. D++;
  105. }
  106. } catch (IOException e) {
  107. e.printStackTrace();
  108. }
  109. }
  110.  
  111. public static String capitalize(String s) {
  112. for (int i = 0; i < s.length(); i++) {
  113. if (i == 0) {
  114. s = String.format( "%s%s",
  115. Character.toUpperCase(s.charAt(0)),
  116. s.substring(1) );
  117. }
  118. if (!Character.isLetterOrDigit(s.charAt(i))) {
  119. if (i + 1 < s.length()) {
  120. s = String.format( "%s%s%s",
  121. s.subSequence(0, i+1),
  122. Character.toUpperCase(s.charAt(i + 1)),
  123. s.substring(i+2) );
  124. }
  125. }
  126. }
  127. return s;
  128. }
  129.  
  130. public int MapX, MapY;
  131. public static int spellID = 0;
  132. private static String intToKOrMilLongName(int i) {
  133. String s = String.valueOf(i);
  134. for(int k = s.length() - 3; k > 0; k -= 3)
  135. s = s.substring(0, k) + "," + s.substring(k);
  136. //if(j != 0)
  137. // aBoolean1224 = !aBoolean1224;
  138. if(s.length() > 8)
  139. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  140. else
  141. if(s.length() > 4)
  142. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  143. return " " + s;
  144. }
  145. public final String methodR(/*int i,*/ int j) {
  146. //if(i <= 0)
  147. // pktType = inStream.readUnsignedByte();
  148. if(j >= 0 && j < 10000)
  149. return String.valueOf(j);
  150. if(j >= 10000 && j < 10000000)
  151. return j / 1000 + "K";
  152. if(j >= 10000000 && j < 999999999)
  153. return j / 1000000 + "M";
  154. if(j >= 999999999)
  155. return "*";
  156. else
  157. return "?";
  158. }
  159.  
  160. public void models() {
  161. for(int ModelIndex = 0; ModelIndex < 29191; ModelIndex++) {
  162. byte[] abyte0 = getModel(ModelIndex);
  163. if(abyte0 != null && abyte0.length > 0) {
  164.  
  165. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  166. pushMessage("Model added successfully!", 0, "");
  167. }
  168. }
  169. }
  170. public byte[] getModel(int Index) {
  171. try {
  172. File Model = new File("./model/"+Index+".gz");
  173. byte[] aByte = new byte[(int)Model.length()];
  174. FileInputStream fis = new FileInputStream(Model);
  175. fis.read(aByte);
  176. pushMessage("aByte = ["+aByte+"]!", 0, "");
  177. fis.close();
  178.  
  179. return aByte;
  180. }
  181. catch(Exception e)
  182. {return null;}
  183. }
  184.  
  185. private void stopMidi() {
  186. signlink.midifade = 0;
  187. signlink.midi = "stop";
  188. }
  189.  
  190. private boolean menuHasAddFriend(int j) {
  191. if(j < 0)
  192. return false;
  193. int k = menuActionID[j];
  194. if(k >= 2000)
  195. k -= 2000;
  196. return k == 337;
  197. }
  198.  
  199. public void drawChannelButtons() {
  200. if(is459) {
  201. aTextDrawingArea_1271.method389(true, 25, 0xffffff, "Public chat", 142);
  202. aTextDrawingArea_1271.method389(true, 150, 0xffffff, "Private chat", 142);
  203. aTextDrawingArea_1271.method389(true, 285, 0xffffff, "Trade/compete", 142);
  204. aTextDrawingArea_1271.method389(true, 422, 0xffffff, "Report Abuse", 147);
  205. if(publicChatMode == 0)
  206. aTextDrawingArea_1271.method382(65280, 55, "On", 153, true);
  207. if(publicChatMode == 1)
  208. aTextDrawingArea_1271.method382(0xffff00, 55, "Friends", 153, true);
  209. if(publicChatMode == 2)
  210. aTextDrawingArea_1271.method382(0xff0000, 55, "Off", 153, true);
  211. if(publicChatMode == 3)
  212. aTextDrawingArea_1271.method382(65535, 55, "Hide", 153, true);
  213. if(privateChatMode == 0)
  214. aTextDrawingArea_1271.method382(65280, 180, "On", 153, true);
  215. if(privateChatMode == 1)
  216. aTextDrawingArea_1271.method382(0xffff00, 180, "Friends", 153, true);
  217. if(privateChatMode == 2)
  218. aTextDrawingArea_1271.method382(0xff0000, 180, "Off", 153, true);
  219. if(tradeMode == 0)
  220. aTextDrawingArea_1271.method382(65280, 324, "On", 153, true);
  221. if(tradeMode == 1)
  222. aTextDrawingArea_1271.method382(0xffff00, 324, "Friends", 153, true);
  223. if(tradeMode == 2)
  224. aTextDrawingArea_1271.method382(0xff0000, 324, "Off", 153, true);
  225. } else if(is480 || is508 || is525 || is562) {
  226. String text[] = { "On", "Friends", "Off", "Hide" };
  227. int disabledColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  228. switch(cButtonCPos) {
  229. case 0: chatButtons[1].drawSprite(5, 142); break;
  230. case 1: chatButtons[1].drawSprite(62, 142); break;
  231. case 2: chatButtons[1].drawSprite(119, 142); break;
  232. case 3: chatButtons[1].drawSprite(176, 142); break;
  233. case 4: chatButtons[1].drawSprite(233, 142); break;
  234. case 5: chatButtons[1].drawSprite(290, 142); break;
  235. case 6: chatButtons[1].drawSprite(347, 142); break;
  236. } if(cButtonHPos == cButtonCPos) {
  237. switch(cButtonHPos) {
  238. case 0: chatButtons[2].drawSprite(5, 142); break;
  239. case 1: chatButtons[2].drawSprite(62, 142); break;
  240. case 2: chatButtons[2].drawSprite(119, 142); break;
  241. case 3: chatButtons[2].drawSprite(176, 142); break;
  242. case 4: chatButtons[2].drawSprite(233, 142); break;
  243. case 5: chatButtons[2].drawSprite(290, 142); break;
  244. case 7: chatButtons[2].drawSprite(347, 142); break;
  245. case 6: chatButtons[3].drawSprite(404, 142); break;
  246. }
  247. } else {
  248. switch(cButtonHPos) {
  249. case 0: chatButtons[2].drawSprite(5, 142); break;
  250. case 1: chatButtons[2].drawSprite(62, 142); break;
  251. case 2: chatButtons[2].drawSprite(119, 142); break;
  252. case 3: chatButtons[2].drawSprite(176, 142); break;
  253. case 4: chatButtons[2].drawSprite(233, 142); break;
  254. case 5: chatButtons[2].drawSprite(290, 142); break;
  255. case 7: chatButtons[2].drawSprite(347, 142); break;
  256. case 6: chatButtons[3].drawSprite(404, 142); break;
  257. }
  258. }
  259. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  260. smallText.method389(true, 26, 0xffffff, "All", 157);
  261. smallText.method389(true, 76, 0xffffff, "Game", 157);
  262. smallText.method389(true, 131, 0xffffff, "Public", 153);
  263. smallText.method389(true, 184, 0xffffff, "Private", 153);
  264. smallText.method389(true, 249, 0xffffff, "Clan", 153);
  265. smallText.method389(true, 304, 0xffffff, "Trade", 153);
  266. smallText.method389(true, 359, 0xffffff, "Assist", 153);
  267.  
  268. smallText.method382(disabledColor[publicChatMode], 147, text[publicChatMode], 164, true);
  269. smallText.method382(disabledColor[privateChatMode], 203, text[privateChatMode], 164, true);
  270. smallText.method382(disabledColor[clanChatMode], 261, text[clanChatMode], 164, true);
  271. smallText.method382(disabledColor[tradeMode], 318, text[tradeMode], 164, true);
  272. smallText.method382(0xff0000, 374, "Off", 164, true);
  273. } else if(is474) {
  274. String text[] = { "On", "Friends", "Off", "Hide" };
  275. int disabledColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  276. switch(cButtonCPos) {
  277. case 0: chatButtons[1].drawSprite(5, 142); break;
  278. case 1: chatButtons[1].drawSprite(71, 142); break;
  279. case 2: chatButtons[1].drawSprite(137, 142); break;
  280. case 3: chatButtons[1].drawSprite(203, 142); break;
  281. case 4: chatButtons[1].drawSprite(269, 142); break;
  282. case 5: chatButtons[1].drawSprite(335, 142); break;
  283. } if(cButtonHPos == cButtonCPos) {
  284. switch(cButtonHPos) {
  285. case 0: chatButtons[2].drawSprite(5, 142); break;
  286. case 1: chatButtons[2].drawSprite(71, 142); break;
  287. case 2: chatButtons[2].drawSprite(137, 142); break;
  288. case 3: chatButtons[2].drawSprite(203, 142); break;
  289. case 4: chatButtons[2].drawSprite(269, 142); break;
  290. case 5: chatButtons[2].drawSprite(335, 142); break;
  291. case 6: chatButtons[3].drawSprite(404, 142); break;
  292. }
  293. } else {
  294. switch(cButtonHPos) {
  295. case 0: chatButtons[0].drawSprite(5, 142); break;
  296. case 1: chatButtons[0].drawSprite(71, 142); break;
  297. case 2: chatButtons[0].drawSprite(137, 142); break;
  298. case 3: chatButtons[0].drawSprite(203, 142); break;
  299. case 4: chatButtons[0].drawSprite(269, 142); break;
  300. case 5: chatButtons[0].drawSprite(335, 142); break;
  301. case 6: chatButtons[3].drawSprite(404, 142); break;
  302. }
  303. }
  304. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  305. smallText.method389(true, 26, 0xffffff, "All", 157);
  306. smallText.method389(true, 86, 0xffffff, "Game", 157);
  307. smallText.method389(true, 150, 0xffffff, "Public", 152);
  308. smallText.method389(true, 212, 0xffffff, "Private", 152);
  309. smallText.method389(true, 286, 0xffffff, "Clan", 152);
  310. smallText.method389(true, 349, 0xffffff, "Trade", 152);
  311. smallText.method382(disabledColor[publicChatMode], 164, text[publicChatMode], 163, true);
  312. smallText.method382(disabledColor[privateChatMode], 230, text[privateChatMode], 163, true);
  313. smallText.method382(disabledColor[clanChatMode], 296, text[clanChatMode], 163, true);
  314. smallText.method382(disabledColor[tradeMode], 362, text[tradeMode], 163, true);
  315. }
  316. if(menuOpen){
  317. drawMenu(0, 338);
  318. }
  319. }
  320.  
  321. private void drawChatArea() {
  322. chatBackImage.initDrawingArea();
  323. Texture.anIntArray1472 = anIntArray1180;
  324. chatArea[getSpriteID()].drawSprite(0, 0);
  325. if(spriteChanged){
  326. aBoolean1233 = true;
  327. inputTaken = true;
  328. }
  329. if(is459) {
  330. RSFont textDrawingArea = aTextDrawingArea_1271;
  331. if(messagePromptRaised) {
  332. newBoldFont.drawCenteredString(aString1121, 239, 60, 0, -1);
  333. newBoldFont.drawCenteredString( promptInput + "*", 239, 80, 128, -1);
  334. } else if(inputDialogState == 1) {
  335. newBoldFont.drawCenteredString("Enter amount:", 239, 60, 0, -1);
  336. newBoldFont.drawCenteredString(amountOrNameInput + "*", 239, 80, 128, -1);
  337. } else if(inputDialogState == 2) {
  338. newBoldFont.drawCenteredString("Enter name:", 239, 60, 0, -1);
  339. newBoldFont.drawCenteredString(amountOrNameInput + "*", 239, 80, 128, -1);
  340. } else if(aString844 != null) {
  341. newBoldFont.drawCenteredString(aString844, 239, 60, 0, -1);
  342. newBoldFont.drawCenteredString("Click to continue", 239, 80, 128, -1);
  343. } else if(backDialogID != -1) {
  344. drawInterface(0, 16, RSInterface.interfaceCache[backDialogID], 20);
  345. } else if(dialogID != -1) {
  346. drawInterface(0, 16, RSInterface.interfaceCache[dialogID], 20);
  347. } else {
  348. int j77 = 0;
  349. int j = 0;
  350. DrawingArea.setDrawingArea(93+5, 0, 463, 22);
  351. for(int k = 0; k < 100; k++)
  352. if(chatMessages[k] != null) {
  353. int chatType = chatTypes[k];
  354. int yPos = (88 - j77 * 14) + anInt1089 + 5;
  355. String s1 = chatNames[k];
  356. byte byte0 = 0;
  357. if (s1 != null && s1.startsWith("@cr0@")) {
  358. s1 = s1.substring(5);
  359. byte0 = 1;
  360. } else if(s1 != null && s1.startsWith("@cr1@")) {
  361. s1 = s1.substring(5);
  362. byte0 = 2;
  363. } else if(s1 != null && s1.startsWith("@cr2@")) {
  364. s1 = s1.substring(5);
  365. byte0 = 3;
  366. } else if(s1 != null && s1.startsWith("@cr3@")) {
  367. s1 = s1.substring(5);
  368. byte0 = 4;
  369. } else if(s1 != null && s1.startsWith("@cr4@")) {
  370. s1 = s1.substring(5);
  371. byte0 = 5;
  372. }
  373. /* Draws Chat Colored Messages */
  374. if(chatType == 0) {
  375. if (chatTypeView == 5 || chatTypeView == 0) {
  376. if(yPos > 0 && yPos < 110)
  377. newRegularFont.drawBasicString(chatMessages[k], 19, yPos, 0, -1);
  378. j++;
  379. j77++;
  380. }
  381. }
  382. /* Draws clickable URL text into chatarea */
  383. if(chatType == 9) {
  384. if (chatTypeView == 5 || chatTypeView == 0) {
  385. if(yPos > 0 && yPos < 110)
  386. newRegularFont.drawBasicString(chatMessages[k] + " <col=255>" + s1, 19, yPos, 0x7e3200, -1);
  387. j++;
  388. j77++;
  389. }
  390. }
  391. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  392. if (chatTypeView == 1 || chatTypeView == 0) {
  393. if(yPos > 0 && yPos < 110) {
  394. int xPos = 19;
  395. switch(byte0) {
  396. case 1:
  397. modIcons[0].drawSprite(xPos, yPos - 12);
  398. xPos += 14;
  399. break;
  400. case 2:
  401. modIcons[1].drawSprite(xPos, yPos - 12);
  402. xPos += 14;
  403. break;
  404. case 3:
  405. modIcons[2].drawSprite(xPos, yPos - 12);
  406. xPos += 14;
  407. break;
  408. case 4:
  409. modIcons[3].drawSprite(xPos, yPos - 12);
  410. xPos += 14;
  411. break;
  412. case 5:
  413. modIcons[4] = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/MODICONS 5.PNG", 1);
  414. modIcons[4].drawSprite(xPos, yPos - 12);
  415. xPos += 14;
  416. break;
  417. }
  418. newRegularFont.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
  419. xPos += newRegularFont.getTextWidth(s1) + 8;
  420. newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
  421. }
  422. j++;
  423. j77++;
  424. }
  425. }
  426. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  427. if (chatTypeView == 2 || chatTypeView == 0) {
  428. if(yPos > 0 && yPos < 110) {
  429. int k1 = 4;
  430. newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
  431. k1 += newRegularFont.getTextWidth("From ");
  432. switch(byte0) {
  433. case 1:
  434. modIcons[0].drawSprite(k1, yPos - 12);
  435. k1 += 14;
  436. break;
  437. case 2:
  438. modIcons[1].drawSprite(k1, yPos - 12);
  439. k1 += 14;
  440. break;
  441. case 3:
  442. modIcons[2].drawSprite(k1, yPos - 12);
  443. k1 += 14;
  444. break;
  445. case 4:
  446. modIcons[3].drawSprite(k1, yPos - 12);
  447. k1 += 14;
  448. break;
  449. case 5:
  450. modIcons[4] = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/MODICONS 5.PNG", 1);
  451. modIcons[4].drawSprite(k1, yPos - 12);
  452. k1 += 14;
  453. break;
  454. }
  455. newRegularFont.drawBasicString(s1 + ":", k1, yPos, 0, -1);
  456. k1 += newRegularFont.getTextWidth(s1) + 8;
  457. newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
  458. }
  459. j++;
  460. j77++;
  461. }
  462. }
  463. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  464. if (chatTypeView == 3 || chatTypeView == 0) {
  465. if(yPos > 0 && yPos < 110)
  466. newRegularFont.drawBasicString( s1 + " " + chatMessages[k], 19, yPos, 0x800080, -1);
  467. j++;
  468. j77++;
  469. }
  470. }
  471. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  472. if (chatTypeView == 2 || chatTypeView == 0) {
  473. if(yPos > 0 && yPos < 110)
  474. newRegularFont.drawBasicString(chatMessages[k], 19, yPos, 0x800000, -1);
  475. j++;
  476. j77++;
  477. }
  478. }
  479. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  480. if (chatTypeView == 2 || chatTypeView == 0) {
  481. if(yPos > 0 && yPos < 110) {
  482. newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
  483. newRegularFont.drawBasicString(chatMessages[k], 12 + newRegularFont.getTextWidth("To :" + s1), yPos, 0x800000, -1);
  484. }
  485. j++;
  486. j77++;
  487. }
  488. }
  489. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  490. if (chatTypeView == 3 || chatTypeView == 0) {
  491. if(yPos > 0 && yPos < 110)
  492. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 19, yPos, 0x7e3200, -1);
  493. j++;
  494. j77++;
  495. }
  496. if(chatType == 11 && (clanChatMode == 0)) {
  497. if (chatTypeView == 11) {
  498. if(yPos > 0 && yPos < 110)
  499. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 19, yPos, 0x7e3200, -1);
  500. j++;
  501. j77++;
  502. }
  503. }
  504. }
  505. if(chatType == 16) {
  506. int j2 = 40+11;
  507. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  508. if(chatTypeView == 11 || chatTypeView == 0) {
  509. if(yPos > 0 && yPos < 110)
  510. switch(chatRights[k]) {
  511. case 1:
  512. j2 += clanNameWidth;
  513. modIcons[0].drawSprite(j2 - 18, yPos - 12);
  514. j2 += 15;
  515. break;
  516. case 2:
  517. j2 += clanNameWidth;
  518. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  519. j2 += 15;
  520. break;
  521. case 3:
  522. j2 += clanNameWidth;
  523. modIcons[2].drawSprite(j2 - 18, yPos - 12);
  524. j2 += 15;
  525. break;
  526. case 4:
  527. j2 += clanNameWidth;
  528. modIcons[3].drawSprite(j2 - 18, yPos - 12);
  529. j2 += 15;
  530. break;
  531. default:
  532. j2 += clanNameWidth;
  533. break;
  534. }
  535. newRegularFont.drawBasicString("[", 19, yPos, 0, -1);
  536. newRegularFont.drawBasicString("]", clanNameWidth + 16+11, yPos, 0, -1);
  537. newRegularFont.drawBasicString(""+capitalize(clanname)+"", 25, yPos, 255, -1);
  538. newRegularFont.drawBasicString(capitalize(chatNames[k]) + ":", j2-17, yPos);
  539. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  540. newRegularFont.drawBasicString(capitalize(chatMessages[k]), j2-16, yPos, 0x800000, -1);
  541.  
  542. j++;
  543. j77++;
  544. }
  545. }
  546. }
  547. DrawingArea.defaultDrawingAreaSize();
  548. anInt1211 = j * 14 + 7;
  549. if(anInt1211 < 78)
  550. anInt1211 = 78;
  551. drawScrollbar(77, anInt1211 - anInt1089 - 77, 20, 480, anInt1211);
  552. String s;
  553. if(myPlayer != null && myPlayer.name != null)
  554. s = myPlayer.name;
  555. else
  556. s = TextClass.fixName(capitalize(myUsername));
  557. newRegularFont.drawBasicString(s + ":", 19, 110, 0, -1);
  558. newRegularFont.drawBasicString(inputString + "*", 20 + textDrawingArea.getTextWidth(s + ": "), 110, 255, -1);
  559. DrawingArea.method339(97, 0x000000, 479, 17);
  560. }
  561. } else if(is474 || is480 || is508 || is525 || is562) {
  562. RSFont textDrawingArea = aTextDrawingArea_1271;
  563. if(messagePromptRaised) {
  564. newBoldFont.drawCenteredString(aString1121, 259, 60, 0, -1);
  565. newBoldFont.drawCenteredString( promptInput + "*", 259, 80, 128, -1);
  566. } else if(inputDialogState == 1) {
  567. newBoldFont.drawCenteredString("Enter amount:", 259, 60, 0, -1);
  568. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  569. } else if(inputDialogState == 2) {
  570. newBoldFont.drawCenteredString("Enter name:", 259, 60, 0, -1);
  571. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  572. } else if(aString844 != null) {
  573. newBoldFont.drawCenteredString(aString844, 259, 60, 0, -1);
  574. newBoldFont.drawCenteredString("Click to continue", 259, 80, 128, -1);
  575. } else if(backDialogID != -1) {
  576. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  577. } else if(dialogID != -1) {
  578. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  579. } else {
  580. int j77 = -3;
  581. int j = 0;
  582. DrawingArea.setDrawingArea(122, 8, 497, 7);
  583. for(int k = 0; k < 500; k++)
  584. if(chatMessages[k] != null) {
  585. int chatType = chatTypes[k];
  586. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  587. String s1 = chatNames[k];
  588. byte byte0 = 0;
  589. if (s1 != null && s1.startsWith("@cr0@")) {
  590. s1 = s1.substring(5);
  591. byte0 = 1;
  592. } else if(s1 != null && s1.startsWith("@cr1@")) {
  593. s1 = s1.substring(5);
  594. byte0 = 2;
  595. } else if(s1 != null && s1.startsWith("@cr2@")) {
  596. s1 = s1.substring(5);
  597. byte0 = 3;
  598. } else if(s1 != null && s1.startsWith("@cr3@")) {
  599. s1 = s1.substring(5);
  600. byte0 = 4;
  601. } else if(s1 != null && s1.startsWith("@cr4@")) {
  602. s1 = s1.substring(5);
  603. byte0 = 5;
  604. }
  605. /* Draws Chat Colored Messages */
  606. if(chatType == 0) {
  607. if (chatTypeView == 5 || chatTypeView == 0) {
  608. if(yPos > 0 && yPos < 210)
  609. newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0, -1);
  610. j++;
  611. j77++;
  612. }
  613. }
  614. /* Draws clickable URL text into chatarea */
  615. if(chatType == 9) {
  616. if (chatTypeView == 5 || chatTypeView == 0) {
  617. if(yPos > 0 && yPos < 210)
  618. newRegularFont.drawBasicString(chatMessages[k] + " <col=255>" + s1, 11, yPos, 0x7e3200, -1);
  619. j++;
  620. j77++;
  621. }
  622. }
  623. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  624. if (chatTypeView == 1 || chatTypeView == 0) {
  625. if(yPos > 0 && yPos < 210) {
  626. int xPos = 11;
  627. switch(byte0) {
  628. case 1:
  629. modIcons[0].drawSprite(xPos, yPos - 12);
  630. xPos += 14;
  631. break;
  632. case 2:
  633. modIcons[1].drawSprite(xPos, yPos - 12);
  634. xPos += 14;
  635. break;
  636. case 3:
  637. modIcons[2].drawSprite(xPos, yPos - 12);
  638. xPos += 14;
  639. break;
  640. case 4:
  641. modIcons[3].drawSprite(xPos, yPos - 12);
  642. xPos += 14;
  643. break;
  644. case 5:
  645. modIcons[4] = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/MODICONS 5.PNG", 1);
  646. modIcons[4].drawSprite(xPos, yPos - 12);
  647. xPos += 14;
  648. break;
  649. }
  650. newRegularFont.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
  651. xPos += newRegularFont.getTextWidth(s1) + 8;
  652. newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
  653. }
  654. j++;
  655. j77++;
  656. }
  657. }
  658. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  659. if (chatTypeView == 2 || chatTypeView == 0) {
  660. if(yPos > 0 && yPos < 210) {
  661. int k1 = 11;
  662. newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
  663. k1 += newRegularFont.getTextWidth("From ");
  664. switch(byte0) {
  665. case 1:
  666. modIcons[0].drawSprite(k1, yPos - 12);
  667. k1 += 14;
  668. break;
  669. case 2:
  670. modIcons[1].drawSprite(k1, yPos - 12);
  671. k1 += 14;
  672. break;
  673. case 3:
  674. modIcons[2].drawSprite(k1, yPos - 12);
  675. k1 += 14;
  676. break;
  677. case 4:
  678. modIcons[3].drawSprite(k1, yPos - 12);
  679. k1 += 14;
  680. break;
  681. case 5:
  682. modIcons[4] = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/MODICONS 5.PNG", 1);
  683. modIcons[4].drawSprite(k1, yPos - 12);
  684. k1 += 14;
  685. break;
  686. }
  687. newRegularFont.drawBasicString(s1 + ":", k1, yPos, 0, -1);
  688. k1 += newRegularFont.getTextWidth(s1) + 8;
  689. newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
  690. }
  691. j++;
  692. j77++;
  693. }
  694. }
  695. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  696. if (chatTypeView == 3 || chatTypeView == 0) {
  697. if(yPos > 0 && yPos < 210)
  698. newRegularFont.drawBasicString( s1 + " " + chatMessages[k], 11, yPos, 0x800080, -1);
  699. j++;
  700. j77++;
  701. }
  702. }
  703. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  704. if (chatTypeView == 2 || chatTypeView == 0) {
  705. if(yPos > 0 && yPos < 210)
  706. newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0x800000, -1);
  707. j++;
  708. j77++;
  709. }
  710. }
  711. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  712. if (chatTypeView == 2 || chatTypeView == 0) {
  713. if(yPos > 0 && yPos < 210) {
  714. newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
  715. newRegularFont.drawBasicString(chatMessages[k], 15 + newRegularFont.getTextWidth("To :" + s1), yPos, 0x800000, -1);
  716. }
  717. j++;
  718. j77++;
  719. }
  720. }
  721. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  722. if (chatTypeView == 3 || chatTypeView == 0) {
  723. if(yPos > 0 && yPos < 210)
  724. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  725. j++;
  726. j77++;
  727. }
  728. if(chatType == 11 && (clanChatMode == 0)) {
  729. if (chatTypeView == 11) {
  730. if(yPos > 0 && yPos < 210)
  731. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  732. j++;
  733. j77++;
  734. }
  735. }
  736. }
  737. if(chatType == 16) {
  738. int j2 = 40;
  739. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  740. if(chatTypeView == 11 || chatTypeView == 0) {
  741. if(yPos > 3 && yPos < 130)
  742. switch(chatRights[k]) {
  743. case 1:
  744. j2 += clanNameWidth;
  745. modIcons[0].drawSprite(j2 - 18, yPos - 12);
  746. j2 += 14;
  747. break;
  748. case 2:
  749. j2 += clanNameWidth;
  750. modIcons[1].drawSprite(j2 - 18, yPos - 12);
  751. j2 += 14;
  752. break;
  753. case 3:
  754. j2 += clanNameWidth;
  755. modIcons[2].drawSprite(j2 - 18, yPos - 12);
  756. j2 += 14;
  757. break;
  758. case 4:
  759. j2 += clanNameWidth;
  760. modIcons[3].drawSprite(j2 - 18, yPos - 12);
  761. j2 += 14;
  762. break;
  763. default:
  764. j2 += clanNameWidth;
  765. break;
  766. }
  767. newRegularFont.drawBasicString("[", 8, yPos, 0, -1);
  768. newRegularFont.drawBasicString("]", clanNameWidth + 16, yPos, 0, -1);
  769. newRegularFont.drawBasicString(""+capitalize(clanname)+"", 14, yPos, 255, -1);
  770. newRegularFont.drawBasicString(capitalize(chatNames[k]) + ":", j2-17, yPos);
  771. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  772. newRegularFont.drawBasicString(capitalize(chatMessages[k]), j2-16, yPos, 0x800000, -1);
  773.  
  774. j++;
  775. j77++;
  776. }
  777. }
  778. }
  779. DrawingArea.defaultDrawingAreaSize();
  780. anInt1211 = j * 14 + 7 + 5;
  781. if(anInt1211 < 111)
  782. anInt1211 = 111;
  783. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  784. String s;
  785. if(myPlayer != null && myPlayer.name != null)
  786. s = myPlayer.name;
  787. else
  788. s = TextClass.fixName(capitalize(myUsername));
  789. if(is508 || is525 || is562) {
  790. qc.drawSprite(textDrawingArea.getTextWidth(s) + 11, 123);
  791. newRegularFont.drawBasicString(s, 11, 133, 0, -1);
  792. newRegularFont.drawBasicString(":", (25 + textDrawingArea.getTextWidth(s)), 133, 0, -1);
  793. newRegularFont.drawBasicString(inputString + ((loopCycle % 40 < 20) ? "<col=0>|" : ""), 23 + textDrawingArea.getTextWidth(s + ": "), 133 ,255 , -1);
  794. DrawingArea.method339(121, 0x807660, 506, 7);
  795. } else {
  796. newRegularFont.drawBasicString(s + ":", 11, 133, 0, -1);
  797. newRegularFont.drawBasicString(inputString + "*", 12 + textDrawingArea.getTextWidth(s + ": "), 133, 255, -1);
  798. DrawingArea.method339(121, 0x807660, 506, 7);
  799. }
  800. }
  801. }
  802. drawChannelButtons();
  803. chatBackImage.drawGraphics(338, super.graphics, 0);
  804. inGameScreen.initDrawingArea();
  805. Texture.anIntArray1472 = anIntArray1182;
  806. }
  807.  
  808. public void init() {
  809. try {
  810. System.out.println("Tragedy pking client.");
  811. nodeID = 10;//friends list order
  812. portOff = 0;
  813. setLowMem();
  814. isMembers = true;
  815. signlink.startpriv(InetAddress.getLocalHost());
  816. instance = this;
  817. initClientFrame(503, 765);//this it? 510 770
  818. } catch (Exception e) {
  819. e.printStackTrace();
  820. }
  821. }
  822. public void drawTabHover() {
  823. if(tabHPos == 0 && tabInterfaceIDs[0] != -1)
  824. tabHover.drawSprite(3, 0);
  825. else if(tabHPos == 1 && tabInterfaceIDs[1] != -1)
  826. tabHover.drawSprite(33, 0);
  827. else if(tabHPos == 2 && tabInterfaceIDs[2] != -1)
  828. tabHover.drawSprite(63, 0);
  829. else if(tabHPos == 3 && tabInterfaceIDs[14] != -1)
  830. tabHover.drawSprite(93, 0);
  831. else if(tabHPos == 4 && tabInterfaceIDs[3] != -1)
  832. tabHover.drawSprite(123, 0);
  833. else if(tabHPos == 5 && tabInterfaceIDs[4] != -1)
  834. tabHover.drawSprite(153, 0);
  835. else if(tabHPos == 6 && tabInterfaceIDs[5] != -1)
  836. tabHover.drawSprite(183, 0);
  837. else if(tabHPos == 7 && tabInterfaceIDs[6] != -1)
  838. tabHover.drawSprite(213, 0);
  839. else if(tabHPos == 15 && tabInterfaceIDs[16] != -1)
  840. tabHover.drawSprite(3, 298);
  841. else if(tabHPos == 8 && tabInterfaceIDs[9] != -1)
  842. tabHover.drawSprite(33, 298);
  843. else if(tabHPos == 9 && tabInterfaceIDs[8] != -1)
  844. tabHover.drawSprite(63, 298);
  845. else if(tabHPos == 10 && tabInterfaceIDs[7] != -1)
  846. tabHover.drawSprite(93, 298);
  847. else if(tabHPos == 11 && tabInterfaceIDs[11] != -1)
  848. tabHover.drawSprite(123, 298);
  849. else if(tabHPos == 12 && tabInterfaceIDs[12] != -1)
  850. tabHover.drawSprite(153, 298);
  851. else if(tabHPos == 13 && tabInterfaceIDs[13] != -1)
  852. tabHover.drawSprite(183,298);
  853. else if(tabHPos == 14 && tabInterfaceIDs[15] != -1)
  854. tabHover.drawSprite(213, 298);
  855. }
  856.  
  857. public void startRunnable(Runnable runnable, int i) {
  858. if(i > 10)
  859. i = 10;
  860. if(signlink.mainapp != null) {
  861. signlink.startthread(runnable, i);
  862. } else {
  863. super.startRunnable(runnable, i);
  864.  
  865. }
  866. }
  867.  
  868. public Socket openSocket(int port) throws IOException {
  869. return new Socket(InetAddress.getByName(server), port);
  870. }
  871.  
  872. private void processMenuClick() {
  873. if(activeInterfaceType != 0)
  874. return;
  875. int j = super.clickMode3;
  876. if(spellSelected == 1 && super.saveClickX >= 503 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  877. j = 0;
  878. if(menuOpen) {
  879. if(j != 1) {
  880. int k = super.mouseX;
  881. int j1 = super.mouseY;
  882. if(menuScreenArea == 0) {
  883. k -= 4;
  884. j1 -= 4;
  885. }
  886. if(menuScreenArea == 1) {
  887. k -= 516;//519
  888. j1 -= 168;
  889. }
  890. if(menuScreenArea == 2) {
  891. k -= 5;
  892. j1 -= 338;
  893. }
  894. if(menuScreenArea == 3) {
  895. k -= 516;//519
  896. j1 -= 0;
  897. }
  898. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  899. menuOpen = false;
  900. if(menuScreenArea == 1)
  901. needDrawTabArea = true;
  902. if(menuScreenArea == 2)
  903. inputTaken = true;
  904. }
  905. }
  906. if(j == 1) {
  907. int l = menuOffsetX;
  908. int k1 = menuOffsetY;
  909. int i2 = menuWidth;
  910. int k2 = super.saveClickX;
  911. int l2 = super.saveClickY;
  912. if(menuScreenArea == 0) {
  913. k2 -= 4;
  914. l2 -= 4;
  915. }
  916. if(menuScreenArea == 1) {
  917. k2 -= 516;//519
  918. l2 -= 168;
  919. }
  920. if(menuScreenArea == 2) {
  921. k2 -= 5;//17
  922. l2 -= 338;
  923. }
  924. if(menuScreenArea == 3) {
  925. k2 -= 516;//519
  926. l2 -= 0;
  927. }
  928. int i3 = -1;
  929. for(int j3 = 0; j3 < menuActionRow; j3++) {
  930. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  931. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  932. i3 = j3;
  933. }
  934. System.out.println(i3);
  935. if(i3 != -1)
  936. doAction(i3);
  937. menuOpen = false;
  938. if(menuScreenArea == 1)
  939. needDrawTabArea = true;
  940. if(menuScreenArea == 2) {
  941. inputTaken = true;
  942. }
  943. }
  944. } else {
  945. if(j == 1 && menuActionRow > 0) {
  946. int i1 = menuActionID[menuActionRow - 1];
  947. 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) {
  948. int l1 = menuActionCmd2[menuActionRow - 1];
  949. int j2 = menuActionCmd3[menuActionRow - 1];
  950. RSInterface class9 = RSInterface.interfaceCache[j2];
  951. if(class9.allowSwapItems || class9.deletesTargetSlot) {
  952. aBoolean1242 = false;
  953. anInt989 = 0;
  954. anInt1084 = j2;
  955. anInt1085 = l1;
  956. activeInterfaceType = 2;
  957. anInt1087 = super.saveClickX;
  958. anInt1088 = super.saveClickY;
  959. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  960. activeInterfaceType = 1;
  961. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  962. activeInterfaceType = 3;
  963. return;
  964. }
  965. }
  966. }
  967. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  968. j = 2;
  969. if(j == 1 && menuActionRow > 0)
  970. doAction(menuActionRow - 1);
  971. if(j == 2 && menuActionRow > 0)
  972. determineMenuSize();
  973.  
  974. }
  975. }
  976.  
  977.  
  978. public static int totalRead = 0;
  979.  
  980. public static String getFileNameWithoutExtension(String fileName) {
  981. File tmpFile = new File(fileName);
  982. tmpFile.getName();
  983. int whereDot = tmpFile.getName().lastIndexOf('.');
  984. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
  985. return tmpFile.getName().substring(0, whereDot);
  986. }
  987. return "";
  988. }
  989.  
  990. public void preloadModels() {
  991. File file = new File(signlink.findcachedir()+"Raw/");
  992. File[] fileArray = file.listFiles();
  993. for(int y = 0; y < fileArray.length; y++) {
  994. String s = fileArray[y].getName();
  995. byte[] buffer = ReadFile(signlink.findcachedir()+"Raw/"+s);
  996. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  997. }
  998. }
  999.  
  1000. public static final byte[] ReadFile(String s) {
  1001. try {
  1002. byte abyte0[];
  1003. File file = new File(s);
  1004. int i = (int)file.length();
  1005. abyte0 = new byte[i];
  1006. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  1007. datainputstream.readFully(abyte0, 0, i);
  1008. datainputstream.close();
  1009. return abyte0;
  1010. } catch(Exception e) {
  1011. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  1012. return null;
  1013. }
  1014. }
  1015.  
  1016. private void saveMidi(boolean flag, byte abyte0[]) {
  1017. signlink.midifade = flag ? 1 : 0;
  1018. signlink.midisave(abyte0, abyte0.length);
  1019. }
  1020.  
  1021. public static void writeFile(byte[] data, String fileName) throws IOException{
  1022. OutputStream out = new FileOutputStream(fileName);
  1023. out.write(data);
  1024. out.close();
  1025. }
  1026.  
  1027. public final void method22() {
  1028. try {
  1029. anInt985 = -1;
  1030. aClass19_1056.removeAll();
  1031. aClass19_1013.removeAll();
  1032. Texture.method366();
  1033. unlinkMRUNodes();
  1034. worldController.initToNull();
  1035. System.gc();
  1036. for(int i = 0; i < 4; i++)
  1037. aClass11Array1230[i].method210();
  1038. for(int l = 0; l < 4; l++) {
  1039. for(int k1 = 0; k1 < 104; k1++) {
  1040. for(int j2 = 0; j2 < 104; j2++)
  1041. byteGroundArray[l][k1][j2] = 0;
  1042. }
  1043. }
  1044. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  1045. int k2 = aByteArrayArray1183.length;
  1046. int k18 = 62;
  1047. for(int A = 0; A < k2; A++)
  1048. for(int B = 0; B < 2000; B++)
  1049. if(anIntArray1234[A] == positions[B]){
  1050. anIntArray1235[A] = landScapes[B];
  1051. anIntArray1236[A] = objects[B];
  1052. }
  1053. stream.createFrame(0);
  1054. if(!aBoolean1159) {
  1055. for(int i3 = 0; i3 < k2; i3++) {
  1056. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  1057. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  1058. byte abyte0[] = aByteArrayArray1183[i3];
  1059. if (FileOperations.FileExists(signlink.findcachedir()+"Maps/Maps/"+anIntArray1235[i3]+".dat"))
  1060. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"Maps/Maps/"+anIntArray1235[i3]+".dat");
  1061. if(abyte0 != null)
  1062. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  1063. }
  1064. for(int j4 = 0; j4 < k2; j4++) {
  1065. int l5 = (anIntArray1234[j4] >> 8) * k18 - baseX;
  1066. int k7 = (anIntArray1234[j4] & 0xff) * k18 - baseY;
  1067. byte abyte2[] = aByteArrayArray1183[j4];
  1068. if(abyte2 == null && anInt1070 < 800)
  1069. objectManager.method174(k7, 64, 64, l5);
  1070. }
  1071. anInt1097++;
  1072. if(anInt1097 > 160) {
  1073. anInt1097 = 0;
  1074. stream.createFrame(238);
  1075. stream.writeWordBigEndian(96);
  1076. }
  1077. stream.createFrame(0);
  1078. for(int i6 = 0; i6 < k2; i6++) {
  1079. byte abyte1[] = aByteArrayArray1247[i6];
  1080. if (FileOperations.FileExists(signlink.findcachedir()+"Maps/Maps/"+anIntArray1236[i6]+".dat"))
  1081. abyte1 = FileOperations.ReadFile(signlink.findcachedir()+"Maps/Maps/"+anIntArray1236[i6]+".dat");
  1082. if(abyte1 != null) {
  1083. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1084. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1085. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  1086. }
  1087. }
  1088. }
  1089. if(aBoolean1159) {
  1090. for(int j3 = 0; j3 < 4; j3++) {
  1091. for(int k4 = 0; k4 < 13; k4++) {
  1092. for(int j6 = 0; j6 < 13; j6++) {
  1093. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1094. if(l7 != -1) {
  1095. int i9 = l7 >> 24 & 3;
  1096. int l9 = l7 >> 1 & 3;
  1097. int j10 = l7 >> 14 & 0x3ff;
  1098. int l10 = l7 >> 3 & 0x7ff;
  1099. int j11 = (j10 / 8 << 8) + l10 / 8;
  1100. for(int l11 = 0; l11 < anIntArray1234.length; l11++)
  1101. {
  1102. if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  1103. continue;
  1104. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  1105. break;
  1106. }
  1107.  
  1108. }
  1109. }
  1110.  
  1111. }
  1112.  
  1113. }
  1114. for(int l4 = 0; l4 < 13; l4++) {
  1115. for(int k6 = 0; k6 < 13; k6++){
  1116. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1117. if(i8 == -1)
  1118. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1119. }
  1120. }
  1121. stream.createFrame(0);
  1122. for(int l6 = 0; l6 < 4; l6++) {
  1123. for(int j8 = 0; j8 < 13; j8++) {
  1124. for(int j9 = 0; j9 < 13; j9++) {
  1125. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1126. if(i10 != -1) {
  1127. int k10 = i10 >> 24 & 3;
  1128. int i11 = i10 >> 1 & 3;
  1129. int k11 = i10 >> 14 & 0x3ff;
  1130. int i12 = i10 >> 3 & 0x7ff;
  1131. int j12 = (k11 / 8 << 8) + i12 / 8;
  1132. for(int k12 = 0; k12 < anIntArray1234.length; k12++) {
  1133. if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  1134. continue;
  1135. byte abyte0[] = aByteArrayArray1247[k12];
  1136. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  1137. break;
  1138. }
  1139. }
  1140. }
  1141. }
  1142. }
  1143. }
  1144. stream.createFrame(0);
  1145. objectManager.method171(aClass11Array1230, worldController);
  1146. inGameScreen.initDrawingArea();
  1147. stream.createFrame(0);
  1148. int k3 = ObjectManager.anInt145;
  1149. if(k3 > plane)
  1150. k3 = plane;
  1151. if(k3 < plane - 1)
  1152. k3 = plane - 1;
  1153. if(lowMem)
  1154. worldController.method275(ObjectManager.anInt145);
  1155. else
  1156. worldController.method275(0);
  1157. for(int i5 = 0; i5 < 104; i5++) {
  1158. for(int i7 = 0; i7 < 104; i7++)
  1159. spawnGroundItem(i5, i7);
  1160. }
  1161. anInt1051++;
  1162. if(anInt1051 > 98) {
  1163. anInt1051 = 0;
  1164. stream.createFrame(150);
  1165. }
  1166. method63();
  1167. } catch(Exception exception) { }
  1168. ObjectDef.mruNodes1.unlinkAll();
  1169. if(super.gameFrame != null) {
  1170. stream.createFrame(210);
  1171. stream.writeDWord(0x3f008edd);
  1172. }
  1173. System.gc();
  1174. Texture.method367();
  1175. onDemandFetcher.method566();
  1176. int k = (anInt1069 - 6) / 8 - 1;
  1177. int j1 = (anInt1069 + 6) / 8 + 1;
  1178. int i2 = (anInt1070 - 6) / 8 - 1;
  1179. int l2 = (anInt1070 + 6) / 8 + 1;
  1180. if(aBoolean1141) {
  1181. k = 49;
  1182. j1 = 50;
  1183. i2 = 49;
  1184. l2 = 50;
  1185. }
  1186. for(int l3 = k; l3 <= j1; l3++) {
  1187. for(int j5 = i2; j5 <= l2; j5++)
  1188. if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1189. int j7 = onDemandFetcher.method562(0, j5, l3);
  1190. if(j7 != -1)
  1191. onDemandFetcher.method560(j7, 3);
  1192. int k8 = onDemandFetcher.method562(1, j5, l3);
  1193. if(k8 != -1)
  1194. onDemandFetcher.method560(k8, 3);
  1195. }
  1196. }
  1197. }
  1198.  
  1199. private void unlinkMRUNodes()
  1200. {
  1201. ObjectDef.mruNodes1.unlinkAll();
  1202. ObjectDef.mruNodes2.unlinkAll();
  1203. EntityDef.mruNodes.unlinkAll();
  1204. ItemDef.mruNodes2.unlinkAll();
  1205. ItemDef.mruNodes1.unlinkAll();
  1206. Player.mruNodes.unlinkAll();
  1207. SpotAnim.aMRUNodes_415.unlinkAll();
  1208. }
  1209.  
  1210. private void method24(int i)
  1211. {
  1212. int ai[] = aSprite_1263.myPixels;
  1213. int j = ai.length;
  1214. for(int k = 0; k < j; k++)
  1215. ai[k] = 0;
  1216.  
  1217. for(int l = 1; l < 103; l++)
  1218. {
  1219. int i1 = 24628 + (103 - l) * 512 * 4;
  1220. for(int k1 = 1; k1 < 103; k1++)
  1221. {
  1222.  
  1223. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  1224. worldController.method309(ai, i1, i, k1, l);
  1225. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1226. worldController.method309(ai, i1, i + 1, k1, l);
  1227. i1 += 4;
  1228. }
  1229.  
  1230. }
  1231.  
  1232. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  1233. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  1234. aSprite_1263.method343();
  1235. for(int i2 = 1; i2 < 103; i2++)
  1236. {
  1237. for(int j2 = 1; j2 < 103; j2++)
  1238. {
  1239. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1240. method50(i2, j1, j2, l1, i);
  1241. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1242. method50(i2, j1, j2, l1, i + 1);
  1243. }
  1244.  
  1245. }
  1246.  
  1247. inGameScreen.initDrawingArea();
  1248. anInt1071 = 0;
  1249. for(int k2 = 0; k2 < 104; k2++)
  1250. {
  1251. for(int l2 = 0; l2 < 104; l2++)
  1252. {
  1253. int i3 = worldController.method303(plane, k2, l2);
  1254. if(i3 != 0)
  1255. {
  1256. i3 = i3 >> 14 & 0x7fff;
  1257. int j3 = ObjectDef.forID(i3).anInt746;
  1258. if(j3 >= 0)
  1259. {
  1260. int k3 = k2;
  1261. int l3 = l2;
  1262. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  1263. {
  1264. byte byte0 = 104;
  1265. byte byte1 = 104;
  1266. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1267. for(int i4 = 0; i4 < 10; i4++)
  1268. {
  1269. int j4 = (int)(Math.random() * 4D);
  1270. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1271. k3--;
  1272. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1273. k3++;
  1274. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1275. l3--;
  1276. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1277. l3++;
  1278. }
  1279.  
  1280. }
  1281. aSpriteArray1140[anInt1071] = mapFunctions[j3];
  1282. anIntArray1072[anInt1071] = k3;
  1283. anIntArray1073[anInt1071] = l3;
  1284. anInt1071++;
  1285. }
  1286. }
  1287. }
  1288.  
  1289. }
  1290.  
  1291. }
  1292.  
  1293. private void spawnGroundItem(int i, int j)
  1294. {
  1295. NodeList class19 = groundArray[plane][i][j];
  1296. if(class19 == null)
  1297. {
  1298. worldController.method295(plane, i, j);
  1299. return;
  1300. }
  1301. int k = 0xfa0a1f01;
  1302. Object obj = null;
  1303. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  1304. {
  1305. ItemDef itemDef = ItemDef.forID(item.ID);
  1306. int l = itemDef.value;
  1307. if(itemDef.stackable)
  1308. l *= item.anInt1559 + 1;
  1309. // notifyItemSpawn(item, i + baseX, j + baseY);
  1310. if(l > k)
  1311. {
  1312. k = l;
  1313. obj = item;
  1314. }
  1315. }
  1316. class19.insertTail(((Node) (obj)));
  1317. Object obj1 = null;
  1318. Object obj2 = null;
  1319. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  1320. {
  1321. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  1322. obj1 = class30_sub2_sub4_sub2_1;
  1323. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  1324. obj2 = class30_sub2_sub4_sub2_1;
  1325. }
  1326. int i1 = i + (j << 7) + 0x60000000;
  1327. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1328. }
  1329.  
  1330. private void method26(boolean flag)
  1331. {
  1332. for(int j = 0; j < npcCount; j++)
  1333. {
  1334. NPC npc = npcArray[npcIndices[j]];
  1335. int k = 0x20000000 + (npcIndices[j] << 14);
  1336. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1337. continue;
  1338. int l = npc.x >> 7;
  1339. int i1 = npc.y >> 7;
  1340. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1341. continue;
  1342. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  1343. {
  1344. if(anIntArrayArray929[l][i1] == anInt1265)
  1345. continue;
  1346. anIntArrayArray929[l][i1] = anInt1265;
  1347. }
  1348. if(!npc.desc.aBoolean84)
  1349. k += 0x80000000;
  1350. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  1351. }
  1352. }
  1353.  
  1354. private boolean replayWave()
  1355. {
  1356. return signlink.wavereplay();
  1357. }
  1358.  
  1359. private void loadError()
  1360. {
  1361. String s = "ondemand";//was a constant parameter
  1362. System.out.println(s);
  1363. try
  1364. {
  1365. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1366. }
  1367. catch(Exception exception)
  1368. {
  1369. exception.printStackTrace();
  1370. }
  1371. do
  1372. try
  1373. {
  1374. Thread.sleep(1000L);
  1375. }
  1376. catch(Exception _ex) { }
  1377. while(true);
  1378. }
  1379.  
  1380. public void drawHoverBox(int xPos, int yPos, String text) {
  1381. String[] results = text.split("\n");
  1382. int height = (results.length * 16) + 3;
  1383. int width;
  1384. width = aTextDrawingArea_1271.getTextWidth(results[0]) + 6;
  1385. for(int i = 1; i < results.length; i++)
  1386. if(width <= aTextDrawingArea_1271.getTextWidth(results[i]) + 6)
  1387. width = aTextDrawingArea_1271.getTextWidth(results[i]) + 6;
  1388. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  1389. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  1390. yPos += 14;
  1391. for(int i = 0; i < results.length; i++) {
  1392. aTextDrawingArea_1271.method389(false, xPos + 3, 0, results[i], yPos);
  1393. yPos += 16;
  1394. }
  1395. }
  1396.  
  1397. public void drawBlackBox(int xPos, int yPos) {
  1398. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  1399. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  1400. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  1401. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  1402. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  1403. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  1404. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  1405. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  1406. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  1407. }
  1408.  
  1409. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  1410. {
  1411. if(class9.interfaceType != 0 || class9.children == null || class9.interfaceShown)
  1412. return;
  1413. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1414. return;
  1415. int k1 = class9.children.length;
  1416. for(int l1 = 0; l1 < k1; l1++)
  1417. {
  1418. int i2 = class9.childX[l1] + i;
  1419. int j2 = (class9.childY[l1] + l) - j1;
  1420. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1421. i2 += class9_1.xOffset;
  1422. j2 += class9_1.yOffset;
  1423. if((class9_1.hoverType >= 0 || class9_1.disabledHoverColor != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1424. if(class9_1.hoverType >= 0)
  1425. anInt886 = class9_1.hoverType;
  1426. else
  1427. anInt886 = class9_1.id;
  1428. if (class9_1.interfaceType == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1429. anInt1315 = class9_1.id;
  1430. }
  1431. if(class9_1.interfaceType == 0)
  1432. {
  1433. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1434. if(class9_1.scrollMax > class9_1.height)
  1435. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1436. } else
  1437. {
  1438. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1439. {
  1440. boolean flag = false;
  1441. if(class9_1.contentType != 0)
  1442. flag = buildFriendsListMenu(class9_1);
  1443. if(!flag)
  1444. {
  1445. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1446. if(idToggle == true) {
  1447. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1448. menuActionID[menuActionRow] = 315;
  1449. menuActionCmd3[menuActionRow] = class9_1.id;
  1450. menuActionRow++;
  1451. } else {
  1452. menuActionName[menuActionRow] = class9_1.tooltip;
  1453. menuActionID[menuActionRow] = 315;
  1454. menuActionCmd3[menuActionRow] = class9_1.id;
  1455. menuActionRow++;
  1456. }
  1457. }
  1458. }
  1459. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1460. {
  1461. String s = class9_1.selectedActionName;
  1462. if(s.indexOf(" ") != -1)
  1463. s = s.substring(0, s.indexOf(" "));
  1464. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1465. menuActionID[menuActionRow] = 626;
  1466. menuActionCmd3[menuActionRow] = class9_1.id;
  1467. menuActionRow++;
  1468. }
  1469. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1470. {
  1471. menuActionName[menuActionRow] = "Close";
  1472. menuActionID[menuActionRow] = 200;
  1473. menuActionCmd3[menuActionRow] = class9_1.id;
  1474. menuActionRow++;
  1475. }
  1476. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1477. {
  1478. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1479. if(idToggle == true) {
  1480. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1481. menuActionID[menuActionRow] = 169;
  1482. menuActionCmd3[menuActionRow] = class9_1.id;
  1483. menuActionRow++;
  1484. } else {
  1485. menuActionName[menuActionRow] = class9_1.tooltip;
  1486. menuActionID[menuActionRow] = 169;
  1487. menuActionCmd3[menuActionRow] = class9_1.id;
  1488. menuActionRow++;
  1489. }
  1490. if (class9_1.hoverText != null) {
  1491. //drawHoverBox(k, l, class9_1.hoverText);
  1492. //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
  1493. }
  1494. }
  1495. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1496. {
  1497. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1498. if(idToggle == true) {
  1499. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1500. menuActionID[menuActionRow] = 646;
  1501. menuActionCmd3[menuActionRow] = class9_1.id;
  1502. menuActionRow++;
  1503. } else {
  1504. menuActionName[menuActionRow] = class9_1.tooltip;
  1505. menuActionID[menuActionRow] = 646;
  1506. menuActionCmd3[menuActionRow] = class9_1.id;
  1507. menuActionRow++;
  1508. }
  1509. }
  1510. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1511. {
  1512. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1513. if(idToggle == true) {
  1514. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1515. menuActionID[menuActionRow] = 679;
  1516. menuActionCmd3[menuActionRow] = class9_1.id;
  1517. menuActionRow++;
  1518. } else {
  1519. menuActionName[menuActionRow] = class9_1.tooltip;
  1520. menuActionID[menuActionRow] = 679;
  1521. menuActionCmd3[menuActionRow] = class9_1.id;
  1522. menuActionRow++;
  1523. }
  1524. }
  1525. if(class9_1.interfaceType == 2)
  1526. {
  1527. int k2 = 0;
  1528. for(int l2 = 0; l2 < class9_1.height; l2++)
  1529. {
  1530. for(int i3 = 0; i3 < class9_1.width; i3++)
  1531. {
  1532. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1533. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1534. if(k2 < 20)
  1535. {
  1536. j3 += class9_1.spritesX[k2];
  1537. k3 += class9_1.spritesY[k2];
  1538. }
  1539. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1540. {
  1541. mouseInvInterfaceIndex = k2;
  1542. lastActiveInvInterface = class9_1.id;
  1543. if(class9_1.inventory[k2] > 0)
  1544. {
  1545. ItemDef itemDef = ItemDef.forID(class9_1.inventory[k2] - 1);
  1546. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1547. {
  1548. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1549. {
  1550. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @lre@" + itemDef.name;
  1551. menuActionID[menuActionRow] = 870;
  1552. menuActionCmd1[menuActionRow] = itemDef.id;
  1553. menuActionCmd2[menuActionRow] = k2;
  1554. menuActionCmd3[menuActionRow] = class9_1.id;
  1555. menuActionRow++;
  1556. }
  1557. } else
  1558. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1559. {
  1560. if((spellUsableOn & 0x10) == 16)
  1561. {
  1562. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1563. menuActionID[menuActionRow] = 543;
  1564. menuActionCmd1[menuActionRow] = itemDef.id;
  1565. menuActionCmd2[menuActionRow] = k2;
  1566. menuActionCmd3[menuActionRow] = class9_1.id;
  1567. menuActionRow++;
  1568. }
  1569. } else
  1570. {
  1571. if(class9_1.isInventoryInterface)
  1572. {
  1573. for(int l3 = 4; l3 >= 3; l3--)
  1574. if(itemDef.itemActions != null && itemDef.itemActions[l3] != null)
  1575. {
  1576. menuActionName[menuActionRow] = itemDef.itemActions[l3] + " @lre@" + itemDef.name;
  1577. if(l3 == 3)
  1578. menuActionID[menuActionRow] = 493;
  1579. if(l3 == 4)
  1580. menuActionID[menuActionRow] = 847;
  1581. menuActionCmd1[menuActionRow] = itemDef.id;
  1582. menuActionCmd2[menuActionRow] = k2;
  1583. menuActionCmd3[menuActionRow] = class9_1.id;
  1584. menuActionRow++;
  1585. } else
  1586. if(l3 == 4)
  1587. {
  1588. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1589. menuActionID[menuActionRow] = 847;
  1590. menuActionCmd1[menuActionRow] = itemDef.id;
  1591. menuActionCmd2[menuActionRow] = k2;
  1592. menuActionCmd3[menuActionRow] = class9_1.id;
  1593. menuActionRow++;
  1594. }
  1595.  
  1596. }
  1597. if(class9_1.usableItemInterface)
  1598. {
  1599. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1600. menuActionID[menuActionRow] = 447;
  1601. menuActionCmd1[menuActionRow] = itemDef.id;
  1602. //k2 = inventory spot
  1603. //System.out.println(k2);
  1604. menuActionCmd2[menuActionRow] = k2;
  1605. menuActionCmd3[menuActionRow] = class9_1.id;
  1606. menuActionRow++;
  1607. }
  1608. if(class9_1.isInventoryInterface && itemDef.itemActions != null)
  1609. {
  1610. for(int i4 = 2; i4 >= 0; i4--)
  1611. if(itemDef.itemActions[i4] != null)
  1612. {
  1613. menuActionName[menuActionRow] = itemDef.itemActions[i4] + " @lre@" + itemDef.name;
  1614. if(i4 == 0)
  1615. menuActionID[menuActionRow] = 74;
  1616. if(i4 == 1)
  1617. menuActionID[menuActionRow] = 454;
  1618. if(i4 == 2)
  1619. menuActionID[menuActionRow] = 539;
  1620. menuActionCmd1[menuActionRow] = itemDef.id;
  1621. menuActionCmd2[menuActionRow] = k2;
  1622. menuActionCmd3[menuActionRow] = class9_1.id;
  1623. menuActionRow++;
  1624. }
  1625.  
  1626. }
  1627. if(class9_1.itemActions != null)
  1628. {
  1629. for(int j4 = 4; j4 >= 0; j4--)
  1630. if(class9_1.itemActions[j4] != null)
  1631. {
  1632. menuActionName[menuActionRow] = class9_1.itemActions[j4] + " @lre@" + itemDef.name;
  1633. if(j4 == 0)
  1634. menuActionID[menuActionRow] = 632;
  1635. if(j4 == 1)
  1636. menuActionID[menuActionRow] = 78;
  1637. if(j4 == 2)
  1638. menuActionID[menuActionRow] = 867;
  1639. if(j4 == 3)
  1640. menuActionID[menuActionRow] = 431;
  1641. if(j4 == 4)
  1642. menuActionID[menuActionRow] = 53;
  1643. menuActionCmd1[menuActionRow] = itemDef.id;
  1644. menuActionCmd2[menuActionRow] = k2;
  1645. menuActionCmd3[menuActionRow] = class9_1.id;
  1646. menuActionRow++;
  1647. }
  1648.  
  1649. }
  1650. if(idToggle == true) {
  1651. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inventory[k2] - 1) + "@gre@)";
  1652. } else {
  1653. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1654. }
  1655. menuActionID[menuActionRow] = 1125;
  1656. menuActionCmd1[menuActionRow] = itemDef.id;
  1657. menuActionCmd2[menuActionRow] = k2;
  1658. menuActionCmd3[menuActionRow] = class9_1.id;
  1659. menuActionRow++;
  1660. }
  1661. }
  1662. }
  1663. k2++;
  1664. }
  1665.  
  1666. }
  1667.  
  1668. }
  1669. }
  1670. }
  1671.  
  1672. }
  1673.  
  1674. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1675. if(is474 || is480 || is508 || is525 || is562) {
  1676. scrollBar1.drawSprite(i1, l);
  1677. scrollBar2.drawSprite(i1, (l + j) - 16);
  1678. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1679. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1680. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1681. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1682. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1683. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1684. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1685. int k1 = ((j - 32) * j) / j1;
  1686. if(k1 < 8)
  1687. k1 = 8;
  1688. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1689. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1690. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1691. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1692. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1693. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1694. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1695. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1696. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1697. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1698. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1699. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1700. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1701. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1702. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1703. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1704. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1705. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1706. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1707. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1708. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1709. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1710. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1711. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1712. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1713. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1714. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1715. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1716. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1717. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1718. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1719. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1720. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1721. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1722. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1723. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1724. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1725. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1726. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1727. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1728. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1729. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1730. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1731. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1732. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1733. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1734. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1735. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1736. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1737. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1738. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1739. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1740. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1741. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1742. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1743. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1744. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1745. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1746. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1747. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1748. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1749. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1750. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1751. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1752. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1753. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1754. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1755. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1756. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1757. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1758. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1759. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1760. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1761. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1762. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1763. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1764. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1765. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1766. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1767. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1768. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1769. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1770. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1771. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1772. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1773. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1774. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1775. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1776. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1777. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1778. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1779. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1780. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1781. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1782. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1783. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1784. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1785. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1786. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1787. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1788. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1789. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1790. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1791. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1792. } else {
  1793. scrollBar3.drawSprite(i1, l);
  1794. scrollBar4.drawSprite(i1, (l + j) - 16);
  1795. DrawingArea.method336(j - 32, l + 16, i1, anInt1002, 16);
  1796. int k1 = ((j - 32) * j) / j1;
  1797. if(k1 < 8)
  1798. k1 = 8;
  1799. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1800. DrawingArea.method336(k1, l + 16 + l1, i1, barFillColor, 16);
  1801. DrawingArea.method341(l + 16 + l1, anInt902, k1, i1);
  1802. DrawingArea.method341(l + 16 + l1, anInt902, k1, i1 + 1);
  1803. DrawingArea.method339(l + 16 + l1, anInt902, 16, i1);
  1804. DrawingArea.method339(l + 17 + l1, anInt902, 16, i1);
  1805. DrawingArea.method341(l + 16 + l1, anInt927, k1, i1 + 15);
  1806. DrawingArea.method341(l + 17 + l1, anInt927, k1 - 1, i1 + 14);
  1807. DrawingArea.method339(l + 15 + l1 + k1, anInt927, 16, i1);
  1808. DrawingArea.method339(l + 14 + l1 + k1, anInt927, 15, i1 + 1);
  1809. }
  1810. }
  1811.  
  1812. private void updateNPCs(Stream stream, int i)
  1813. {
  1814. anInt839 = 0;
  1815. anInt893 = 0;
  1816. method139(stream);
  1817. method46(i, stream);
  1818. method86(stream);
  1819. for(int k = 0; k < anInt839; k++)
  1820. {
  1821. int l = anIntArray840[k];
  1822. if(npcArray[l].anInt1537 != loopCycle)
  1823. {
  1824. npcArray[l].desc = null;
  1825. npcArray[l] = null;
  1826. }
  1827. }
  1828. if(stream.currentOffset != i)
  1829. {
  1830. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1831. throw new RuntimeException("eek");
  1832. }
  1833. for(int i1 = 0; i1 < npcCount; i1++)
  1834. if(npcArray[npcIndices[i1]] == null)
  1835. {
  1836. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1837. throw new RuntimeException("eek");
  1838. }
  1839. }
  1840.  
  1841. private int cButtonHPos;
  1842. private int cButtonHCPos;
  1843. private int cButtonCPos;
  1844.  
  1845. private void processChatModeClick() {
  1846. if(is480 == true || is508 == true || is525 == true) {
  1847. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1848. cButtonHPos = 0;
  1849. aBoolean1233 = true;
  1850. inputTaken = true;
  1851. } else if(super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  1852. cButtonHPos = 1;
  1853. aBoolean1233 = true;
  1854. inputTaken = true;
  1855. } else if(super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  1856. cButtonHPos = 2;
  1857. aBoolean1233 = true;
  1858. inputTaken = true;
  1859. } else if(super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  1860. cButtonHPos = 3;
  1861. aBoolean1233 = true;
  1862. inputTaken = true;
  1863. } else if(super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  1864. cButtonHPos = 4;
  1865. aBoolean1233 = true;
  1866. inputTaken = true;
  1867. } else if(super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  1868. cButtonHPos = 5;
  1869. aBoolean1233 = true;
  1870. inputTaken = true;
  1871. } else if(super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  1872. cButtonHPos = 7;
  1873. aBoolean1233 = true;
  1874. inputTaken = true;
  1875. } else if(super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  1876. cButtonHPos = 6;
  1877. aBoolean1233 = true;
  1878. inputTaken = true;
  1879. } else {
  1880. cButtonHPos = -1;
  1881. aBoolean1233 = true;
  1882. inputTaken = true;
  1883. }
  1884. if(super.clickMode3 == 1) {
  1885. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1886. cButtonCPos = 0;
  1887. chatTypeView = 0;
  1888. aBoolean1233 = true;
  1889. inputTaken = true;
  1890. } else if(super.saveClickX >= 62 && super.saveClickX <= 117 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1891. cButtonCPos = 1;
  1892. chatTypeView = 5;
  1893. aBoolean1233 = true;
  1894. inputTaken = true;
  1895. } else if(super.saveClickX >= 119 && super.saveClickX <= 174 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1896. cButtonCPos = 2;
  1897. chatTypeView = 1;
  1898. aBoolean1233 = true;
  1899. inputTaken = true;
  1900. } else if(super.saveClickX >= 176 && super.saveClickX <= 231 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1901. cButtonCPos = 3;
  1902. chatTypeView = 2;
  1903. aBoolean1233 = true;
  1904. inputTaken = true;
  1905. } else if(super.saveClickX >= 233 && super.saveClickX <= 288 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1906. cButtonCPos = 4;
  1907. chatTypeView = 11;
  1908. aBoolean1233 = true;
  1909. inputTaken = true;
  1910. } else if(super.saveClickX >= 290 && super.saveClickX <= 345 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1911. cButtonCPos = 5;
  1912. chatTypeView = 3;
  1913. aBoolean1233 = true;
  1914. inputTaken = true;
  1915. } else if(super.saveClickX >= 347 && super.saveClickX <= 402 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1916. cButtonCPos = 6;
  1917. //chatTypeView = 3;
  1918. aBoolean1233 = true;
  1919. inputTaken = true;
  1920. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1921. if(openInterfaceID == -1) {
  1922. clearTopInterfaces();
  1923. reportAbuseInput = "";
  1924. canMute = false;
  1925. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1926. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1927. continue;
  1928. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1929. break;
  1930. }
  1931. } else {
  1932. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1933. }
  1934. }
  1935. }
  1936. } else if(is474) {
  1937. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1938. cButtonHPos = 0;
  1939. aBoolean1233 = true;
  1940. inputTaken = true;
  1941. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  1942. cButtonHPos = 1;
  1943. aBoolean1233 = true;
  1944. inputTaken = true;
  1945. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  1946. cButtonHPos = 2;
  1947. aBoolean1233 = true;
  1948. inputTaken = true;
  1949. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  1950. cButtonHPos = 3;
  1951. aBoolean1233 = true;
  1952. inputTaken = true;
  1953. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  1954. cButtonHPos = 4;
  1955. aBoolean1233 = true;
  1956. inputTaken = true;
  1957. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  1958. cButtonHPos = 5;
  1959. aBoolean1233 = true;
  1960. inputTaken = true;
  1961. } else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= 482 && super.mouseY <= 503) {
  1962. cButtonHPos = 6;
  1963. aBoolean1233 = true;
  1964. inputTaken = true;
  1965. } else {
  1966. cButtonHPos = -1;
  1967. aBoolean1233 = true;
  1968. inputTaken = true;
  1969. }
  1970. if(super.clickMode3 == 1) {
  1971. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1972. cButtonCPos = 0;
  1973. chatTypeView = 0;
  1974. aBoolean1233 = true;
  1975. inputTaken = true;
  1976. } else if(super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1977. cButtonCPos = 1;
  1978. chatTypeView = 5;
  1979. aBoolean1233 = true;
  1980. inputTaken = true;
  1981. } else if(super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1982. cButtonCPos = 2;
  1983. chatTypeView = 1;
  1984. aBoolean1233 = true;
  1985. inputTaken = true;
  1986. } else if(super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1987. cButtonCPos = 3;
  1988. chatTypeView = 2;
  1989. aBoolean1233 = true;
  1990. inputTaken = true;
  1991. } else if(super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1992. cButtonCPos = 4;
  1993. chatTypeView = 11;
  1994. aBoolean1233 = true;
  1995. inputTaken = true;
  1996. } else if(super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1997. cButtonCPos = 5;
  1998. chatTypeView = 3;
  1999. aBoolean1233 = true;
  2000. inputTaken = true;
  2001. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2002. if(openInterfaceID == -1) {
  2003. clearTopInterfaces();
  2004. reportAbuseInput = "";
  2005. canMute = false;
  2006. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  2007. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  2008. continue;
  2009. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  2010. break;
  2011. }
  2012. } else {
  2013. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  2014. }
  2015. }
  2016. }
  2017. } else {
  2018. if(super.clickMode3 == 1) {
  2019. if(super.saveClickX >= 6 && super.saveClickX <= 106 && super.saveClickY >= 467 && super.saveClickY <= 499)
  2020. {
  2021. publicChatMode = (publicChatMode + 1) % 4;
  2022. aBoolean1233 = true;
  2023. inputTaken = true;
  2024. stream.createFrame(95);
  2025. stream.writeWordBigEndian(publicChatMode);
  2026. stream.writeWordBigEndian(privateChatMode);
  2027. stream.writeWordBigEndian(tradeMode);
  2028. }
  2029. if(super.saveClickX >= 135 && super.saveClickX <= 235 && super.saveClickY >= 467 && super.saveClickY <= 499)
  2030. {
  2031. privateChatMode = (privateChatMode + 1) % 3;
  2032. aBoolean1233 = true;
  2033. inputTaken = true;
  2034. stream.createFrame(95);
  2035. stream.writeWordBigEndian(publicChatMode);
  2036. stream.writeWordBigEndian(privateChatMode);
  2037. stream.writeWordBigEndian(tradeMode);
  2038. }
  2039. if(super.saveClickX >= 273 && super.saveClickX <= 373 && super.saveClickY >= 467 && super.saveClickY <= 499)
  2040. {
  2041. tradeMode = (tradeMode + 1) % 3;
  2042. aBoolean1233 = true;
  2043. inputTaken = true;
  2044. stream.createFrame(95);
  2045. stream.writeWordBigEndian(publicChatMode);
  2046. stream.writeWordBigEndian(privateChatMode);
  2047. stream.writeWordBigEndian(tradeMode);
  2048. }
  2049. if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2050. if(openInterfaceID == -1) {
  2051. clearTopInterfaces();
  2052. reportAbuseInput = "";
  2053. canMute = false;
  2054. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  2055. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  2056. continue;
  2057. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  2058. break;
  2059. }
  2060. } else {
  2061. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  2062. }
  2063. }
  2064. }
  2065. }
  2066. }
  2067.  
  2068. private void method33(int i)
  2069. {
  2070. int j = Varp.cache[i].anInt709;
  2071. if(j == 0)
  2072. return;
  2073. int k = variousSettings[i];
  2074. if(j == 1)
  2075. {
  2076. if(k == 1)
  2077. Texture.method372(0.90000000000000002D);
  2078. if(k == 2)
  2079. Texture.method372(0.80000000000000004D);
  2080. if(k == 3)
  2081. Texture.method372(0.69999999999999996D);
  2082. if(k == 4)
  2083. Texture.method372(0.59999999999999998D);
  2084. ItemDef.mruNodes1.unlinkAll();
  2085. welcomeScreenRaised = true;
  2086. }
  2087. if(j == 3)
  2088. {
  2089. boolean flag1 = musicEnabled;
  2090. if(k == 0)
  2091. {
  2092. adjustVolume(musicEnabled, 0);
  2093. musicEnabled = true;
  2094. }
  2095. if(k == 1)
  2096. {
  2097. adjustVolume(musicEnabled, -400);
  2098. musicEnabled = true;
  2099. }
  2100. if(k == 2)
  2101. {
  2102. adjustVolume(musicEnabled, -800);
  2103. musicEnabled = true;
  2104. }
  2105. if(k == 3)
  2106. {
  2107. adjustVolume(musicEnabled, -1200);
  2108. musicEnabled = true;
  2109. }
  2110. if(k == 4)
  2111. musicEnabled = false;
  2112. if(musicEnabled != flag1 && !lowMem)
  2113. {
  2114. if(musicEnabled)
  2115. {
  2116. nextSong = currentSong;
  2117. songChanging = true;
  2118. onDemandFetcher.method558(2, nextSong);
  2119. } else
  2120. {
  2121. stopMidi();
  2122. }
  2123. prevSong = 0;
  2124. }
  2125. }
  2126. if(j == 4)
  2127. {
  2128. if(k == 0)
  2129. {
  2130. aBoolean848 = true;
  2131. setWaveVolume(0);
  2132. }
  2133. if(k == 1)
  2134. {
  2135. aBoolean848 = true;
  2136. setWaveVolume(-400);
  2137. }
  2138. if(k == 2)
  2139. {
  2140. aBoolean848 = true;
  2141. setWaveVolume(-800);
  2142. }
  2143. if(k == 3)
  2144. {
  2145. aBoolean848 = true;
  2146. setWaveVolume(-1200);
  2147. }
  2148. if(k == 4)
  2149. aBoolean848 = false;
  2150. }
  2151. if(j == 5)
  2152. anInt1253 = k;
  2153. if(j == 6)
  2154. anInt1249 = k;
  2155. if(j == 8)
  2156. {
  2157. splitPrivateChat = k;
  2158. inputTaken = true;
  2159. }
  2160. if(j == 9)
  2161. anInt913 = k;
  2162. }
  2163.  
  2164. private Sprite HPBarFull;
  2165. private Sprite HPBarEmpty;
  2166.  
  2167. private void updateEntities() {
  2168.  
  2169. try{
  2170. int anInt974 = 0;
  2171. for(int j = -1; j < playerCount + npcCount; j++) {
  2172. Object obj;
  2173. if(j == -1)
  2174. obj = myPlayer;
  2175. else
  2176. if(j < playerCount)
  2177. obj = playerArray[playerIndices[j]];
  2178. else
  2179. obj = npcArray[npcIndices[j - playerCount]];
  2180. if(obj == null || !((Entity) (obj)).isVisible())
  2181. continue;
  2182. if(obj instanceof NPC) {
  2183. EntityDef entityDef = ((NPC)obj).desc;
  2184. if(entityDef.childrenIDs != null)
  2185. entityDef = entityDef.method161();
  2186. if(entityDef == null)
  2187. continue;
  2188. }
  2189. if(j < playerCount) {
  2190. int l = 30;
  2191. Player player = (Player)obj;
  2192. if(player.headIcon >= 0) {
  2193. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2194. if(spriteDrawX > -1) {
  2195. if (player.skullIcon < 2) {
  2196. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2197. l += 25;
  2198. }
  2199. if (player.headIcon < 12) { //edit with 7?
  2200. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2201. l += 18;
  2202. }
  2203. }
  2204. }
  2205. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  2206. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2207. if(spriteDrawX > -1)
  2208. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2209. }
  2210. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2211.  
  2212. } else {
  2213. /*EntityDef entityDef_1 = ((NPC)obj).desc;
  2214. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  2215. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2216. if(spriteDrawX > -1)
  2217. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2218. }
  2219. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  2220. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2221. if(spriteDrawX > -1)
  2222. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2223. }*/
  2224. EntityDef entityDef_1 = ((NPC)obj).desc;
  2225. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length)
  2226. {
  2227. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2228. if(spriteDrawX > -1)
  2229. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2230. }
  2231. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10)
  2232. {
  2233. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2234. if(spriteDrawX > -1)
  2235. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2236. else
  2237. System.out.println("Failed to buid height");
  2238. }
  2239. }
  2240.  
  2241. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  2242. {
  2243. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2244. if(spriteDrawX > -1 && anInt974 < anInt975)
  2245. {
  2246. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  2247. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  2248. anIntArray976[anInt974] = spriteDrawX;
  2249. anIntArray977[anInt974] = spriteDrawY;
  2250. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2251. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2252. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2253. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2254. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  2255. {
  2256. anIntArray978[anInt974] += 10;
  2257. anIntArray977[anInt974] += 5;
  2258. }
  2259. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2260. anIntArray979[anInt974] = 60;
  2261. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2262. anIntArray978[anInt974] += 5;
  2263. }
  2264. }
  2265. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  2266. {
  2267. try{
  2268. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2269. if(spriteDrawX > -1)
  2270. {
  2271. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  2272. if(i1 > 30) {
  2273. i1 = 30;
  2274. }
  2275. int HpPercent = (((Entity) (obj)).currentHealth * 56) / ((Entity) (obj)).maxHealth;
  2276. if (HpPercent > 56) {
  2277. HpPercent = 56;
  2278. }
  2279. //if(namesToggle) {
  2280. // newSmallFont.drawCenteredString((new StringBuilder()).append(((Entity) (Entity) obj).currentHealth).append("/").append(((Entity) (Entity) obj).maxHealth).toString(), spriteDrawX, spriteDrawY - 19, 0x3399ff, 100);
  2281. //}//draws HP above head
  2282. //HPBar crap
  2283. if(!hitbarToggle){
  2284. DrawingArea.method336(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  2285. DrawingArea.method336(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  2286. } else {
  2287. HPBarEmpty.drawSprite(spriteDrawX - 28, spriteDrawY - 5);//3
  2288. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HP 0.PNG", HpPercent, 7);
  2289. HPBarFull.drawSprite(spriteDrawX - 28, spriteDrawY - 5);
  2290. }
  2291. }
  2292. }catch(Exception e){ }
  2293. }
  2294. for(int j1 = 0; j1 < 4; j1++)
  2295. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  2296. {
  2297. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  2298. if(spriteDrawX > -1)
  2299. {
  2300. if(j1 == 1)
  2301. spriteDrawY -= 20;
  2302. if(j1 == 2)
  2303. {
  2304. spriteDrawX -= 15;
  2305. spriteDrawY -= 10;
  2306. }
  2307. if(j1 == 3)
  2308. {
  2309. spriteDrawX += 15;
  2310. spriteDrawY -= 10;
  2311. }
  2312. if(hitmarks) {
  2313. hitMark[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  2314. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  2315. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  2316. } else {
  2317. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  2318. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  2319. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  2320. }
  2321. }
  2322. }
  2323. }
  2324. for(int k = 0; k < anInt974; k++) {
  2325. int k1 = anIntArray976[k];
  2326. int l1 = anIntArray977[k];
  2327. int j2 = anIntArray979[k];
  2328. int k2 = anIntArray978[k];
  2329. boolean flag = true;
  2330. while(flag)
  2331. {
  2332. flag = false;
  2333. for(int l2 = 0; l2 < k; l2++)
  2334. 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)
  2335. {
  2336. l1 = anIntArray977[l2] - anIntArray978[l2];
  2337. flag = true;
  2338. }
  2339.  
  2340. }
  2341. spriteDrawX = anIntArray976[k];
  2342. spriteDrawY = anIntArray977[k] = l1;
  2343. String s = aStringArray983[k];
  2344. if(anInt1249 == 0)
  2345. {
  2346. int i3 = 0xffff00;
  2347. if(anIntArray980[k] < 6)
  2348. i3 = anIntArray965[anIntArray980[k]];
  2349. if(anIntArray980[k] == 6)
  2350. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2351. if(anIntArray980[k] == 7)
  2352. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2353. if(anIntArray980[k] == 8)
  2354. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2355. if(anIntArray980[k] == 9) {
  2356. int j3 = 150 - anIntArray982[k];
  2357. if(j3 < 50)
  2358. i3 = 0xff0000 + 1280 * j3;
  2359. else
  2360. if(j3 < 100)
  2361. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2362. else
  2363. if(j3 < 150)
  2364. i3 = 65280 + 5 * (j3 - 100);
  2365. }
  2366. if(anIntArray980[k] == 10) {
  2367. int k3 = 150 - anIntArray982[k];
  2368. if(k3 < 50)
  2369. i3 = 0xff0000 + 5 * k3;
  2370. else
  2371. if(k3 < 100)
  2372. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2373. else
  2374. if(k3 < 150)
  2375. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2376. }
  2377. if(anIntArray980[k] == 11) {
  2378. int l3 = 150 - anIntArray982[k];
  2379. if(l3 < 50)
  2380. i3 = 0xffffff - 0x50005 * l3;
  2381. else
  2382. if(l3 < 100)
  2383. i3 = 65280 + 0x50005 * (l3 - 50);
  2384. else
  2385. if(l3 < 150)
  2386. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2387. }
  2388. if(anIntArray981[k] == 0) {
  2389. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2390. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  2391. }
  2392. if(anIntArray981[k] == 1) {
  2393. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  2394. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  2395. }
  2396. if(anIntArray981[k] == 2) {
  2397. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  2398. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  2399. }
  2400. if(anIntArray981[k] == 3) {
  2401. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2402. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2403. }
  2404. if(anIntArray981[k] == 4) {
  2405. int i4 = chatTextDrawingArea.method384(s);
  2406. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2407. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  2408. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  2409. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  2410. DrawingArea.defaultDrawingAreaSize();
  2411. }
  2412. if(anIntArray981[k] == 5) {
  2413. int j4 = 150 - anIntArray982[k];
  2414. int l4 = 0;
  2415. if(j4 < 25)
  2416. l4 = j4 - 25;
  2417. else
  2418. if(j4 > 125)
  2419. l4 = j4 - 125;
  2420. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  2421. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  2422. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  2423. DrawingArea.defaultDrawingAreaSize();
  2424. }
  2425. } else {
  2426. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2427. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  2428. }
  2429. }
  2430. } catch(Exception e){ }
  2431. }
  2432. private void delFriend(long l)
  2433. {
  2434. try
  2435. {
  2436. if(l == 0L)
  2437. return;
  2438. for(int i = 0; i < friendsCount; i++)
  2439. {
  2440. if(friendsListAsLongs[i] != l)
  2441. continue;
  2442. friendsCount--;
  2443. needDrawTabArea = true;
  2444. for(int j = i; j < friendsCount; j++)
  2445. {
  2446. friendsList[j] = friendsList[j + 1];
  2447. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2448. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2449. }
  2450.  
  2451. stream.createFrame(215);
  2452. stream.writeQWord(l);
  2453. break;
  2454. }
  2455. }
  2456. catch(RuntimeException runtimeexception)
  2457. {
  2458. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  2459. throw new RuntimeException();
  2460. }
  2461. }
  2462.  
  2463. public void drawSideIcons(){
  2464. if(is480 || is508 || is525) {
  2465. /* Top sideIcons */
  2466. if(tabInterfaceIDs[0] != -1)//attack
  2467. sideIcons[0].drawSprite(10+3, 4);
  2468. if(tabInterfaceIDs[1] != -1)//stat
  2469. sideIcons[1].drawSprite(43+3, 4);
  2470. if(tabInterfaceIDs[2] != -1)//quest
  2471. sideIcons[2].drawSprite(76+3, 3);
  2472. if(tabInterfaceIDs[3] != -1)//inventory
  2473. sideIcons[3].drawSprite(111+3, 5);
  2474. if(tabInterfaceIDs[4] != -1)//equipment
  2475. sideIcons[4].drawSprite(140+3, 1);
  2476. if(tabInterfaceIDs[5] != -1)//prayer
  2477. sideIcons[5].drawSprite(174+3, 1);
  2478. if(tabInterfaceIDs[6] != -1)//magic
  2479. sideIcons[6].drawSprite(208+3, 4);
  2480. /* Bottom sideIcons */
  2481. if(tabInterfaceIDs[7] != -1)//summoning
  2482. sIcons483[7].drawSprite(11+3, 303);
  2483. if(tabInterfaceIDs[8] != -1)//friends
  2484. sideIcons[8].drawSprite(46+3, 306);
  2485. if(tabInterfaceIDs[9] != -1)//ignore
  2486. sideIcons[9].drawSprite(79+3, 306);
  2487. if(tabInterfaceIDs[10] != -1)//logout
  2488. sideIcons[7].drawSprite(113+3, 302);
  2489. if(tabInterfaceIDs[11] != -1)//options
  2490. sideIcons[11].drawSprite(145+3, 304);
  2491. if(tabInterfaceIDs[12] != -1)//emotes
  2492. sideIcons[12].drawSprite(181+3, 302);
  2493. if(tabInterfaceIDs[13] != -1)//music
  2494. sideIcons[13].drawSprite(213+3, 303);
  2495. } else if(is562){
  2496. /* Top sideIcons */
  2497. if(tabInterfaceIDs[0] != -1)
  2498. newSideIcons[0].drawSprite(8, 8);
  2499. if(tabInterfaceIDs[1] != -1)
  2500. newSideIcons[1].drawSprite(37, 8);
  2501. if(tabInterfaceIDs[2] != -1)
  2502. newSideIcons[2].drawSprite(67, 8);
  2503. if(tabInterfaceIDs[14] != -1)
  2504. newSideIcons[3].drawSprite(97, 8);
  2505. if(tabInterfaceIDs[3] != -1)
  2506. newSideIcons[4].drawSprite(127, 8);
  2507. if(tabInterfaceIDs[4] != -1)
  2508. newSideIcons[5].drawSprite(159, 8);
  2509. if(tabInterfaceIDs[5] != -1)
  2510. newSideIcons[6].drawSprite(187, 8);
  2511. if(tabInterfaceIDs[6] != -1)
  2512. newSideIcons[7].drawSprite(217, 8);
  2513. /* Bottom sideIcons */
  2514. if(tabInterfaceIDs[9] != -1)
  2515. newSideIcons[8].drawSprite(38, 306);
  2516. if(tabInterfaceIDs[8] != -1)
  2517. newSideIcons[9].drawSprite(70, 306);
  2518. if(tabInterfaceIDs[7] != -1)
  2519. newSideIcons[13].drawSprite(97, 306);
  2520. if(tabInterfaceIDs[11] != -1)
  2521. newSideIcons[10].drawSprite(127, 306);
  2522. if(tabInterfaceIDs[12] != -1)
  2523. newSideIcons[11].drawSprite(157, 306);
  2524. if(tabInterfaceIDs[13] != -1)
  2525. newSideIcons[12].drawSprite(187, 306);
  2526. if(tabInterfaceIDs[15] != -1)
  2527. newSideIcons[14].drawSprite(216, 307);
  2528. } else if(is474){
  2529. /** Top sideIcons */
  2530. if(tabInterfaceIDs[0] != -1)///attack
  2531. sideIcons[0].drawSprite(10+3, 4);
  2532. if(tabInterfaceIDs[1] != -1)///stat
  2533. sideIcons[1].drawSprite(43+3, 4);
  2534. if(tabInterfaceIDs[2] != -1)///quest
  2535. sideIcons[2].drawSprite(76+3, 3);
  2536. if(tabInterfaceIDs[3] != -1)///inventory
  2537. sideIcons[3].drawSprite(111+3, 5);
  2538. if(tabInterfaceIDs[4] != -1)///equipment
  2539. sideIcons[4].drawSprite(140+3, 1);
  2540. if(tabInterfaceIDs[5] != -1)///prayer
  2541. sideIcons[5].drawSprite(174+3, 1);
  2542. if(tabInterfaceIDs[6] != -1)///magic
  2543. sideIcons[6].drawSprite(208+3, 4);
  2544. /** Bottom sideIcons */
  2545. if(tabInterfaceIDs[7] != -1)///clan
  2546. sideIcons[7].drawSprite(11+3, 303);
  2547. if(tabInterfaceIDs[8] != -1)///friends
  2548. sideIcons[8].drawSprite(46+3, 306);
  2549. if(tabInterfaceIDs[9] != -1)///ignore
  2550. sideIcons[9].drawSprite(79+3, 306);
  2551. if(tabInterfaceIDs[10] != -1)///logout
  2552. sideIcons[10].drawSprite(113+3, 302);
  2553. if(tabInterfaceIDs[11] != -1)///options
  2554. sideIcons[11].drawSprite(145+3, 304);
  2555. if(tabInterfaceIDs[12] != -1)///emotes
  2556. sideIcons[12].drawSprite(181+3, 302);
  2557. if(tabInterfaceIDs[13] != -1)///music
  2558. sideIcons[13].drawSprite(213+3, 303);
  2559. } else {
  2560. /** Top sideIcons */
  2561. if(tabInterfaceIDs[0] != -1)///attack
  2562. sIcons459[0].drawSprite(32, 11);
  2563. if(tabInterfaceIDs[1] != -1)///stat
  2564. sIcons459[1].drawSprite(57, 9);
  2565. if(tabInterfaceIDs[2] != -1)///quest
  2566. sIcons459[2].drawSprite(86, 9);
  2567. if(tabInterfaceIDs[3] != -1)///inventory
  2568. sIcons459[3].drawSprite(116, 4);
  2569. if(tabInterfaceIDs[4] != -1)///equipment
  2570. sIcons459[4].drawSprite(155, 5);
  2571. if(tabInterfaceIDs[5] != -1)///prayer
  2572. sIcons459[5].drawSprite(183, 5);
  2573. if(tabInterfaceIDs[6] != -1)///magic
  2574. sIcons459[6].drawSprite(212, 10);
  2575. /** Bottom sideIcons */
  2576. if(tabInterfaceIDs[7] != -1)///clan
  2577. sideIcons[7].drawSprite(31, 300);
  2578. if(tabInterfaceIDs[8] != -1)///friends
  2579. sIcons459[7].drawSprite(57, 306);
  2580. if(tabInterfaceIDs[9] != -1)///ignore
  2581. sIcons459[8].drawSprite(85, 308);
  2582. if(tabInterfaceIDs[10] != -1)///logout
  2583. sIcons459[9].drawSprite(121, 302);
  2584. if(tabInterfaceIDs[11] != -1)///options
  2585. sIcons459[10].drawSprite(157, 305);
  2586. if(tabInterfaceIDs[12] != -1)///emotes
  2587. sIcons459[11].drawSprite(187, 302);
  2588. if(tabInterfaceIDs[13] != -1)///music
  2589. sIcons459[12].drawSprite(211, 302);
  2590. }
  2591. }
  2592. public void drawRedStones() {
  2593. if(is474 || is480 || is508 || is525) {
  2594. if(tabInterfaceIDs[tabID] != -1) {
  2595. switch(tabID) {
  2596. case 0:
  2597. redStones[0].drawSprite(3+3, 0);
  2598. break;
  2599. case 1:
  2600. redStones[4].drawSprite(41+3, 0);
  2601. break;
  2602. case 2:
  2603. redStones[4].drawSprite(74+3, 0);
  2604. break;
  2605. case 3:
  2606. redStones[4].drawSprite(107+3, 0);
  2607. break;
  2608. case 4:
  2609. redStones[4].drawSprite(140+3, 0);
  2610. break;
  2611. case 5:
  2612. redStones[4].drawSprite(173+3, 0);
  2613. break;
  2614. case 6:
  2615. redStones[1].drawSprite(206+3, 0);
  2616. break;
  2617. case 7:
  2618. redStones[2].drawSprite(3+3, 298);
  2619. break;
  2620. case 8:
  2621. redStones[4].drawSprite(41+3, 298);
  2622. break;
  2623. case 9:
  2624. redStones[4].drawSprite(74+3, 298);
  2625. break;
  2626. case 10:
  2627. redStones[4].drawSprite(107+3, 298);
  2628. break;
  2629. case 11:
  2630. redStones[4].drawSprite(140+3, 298);
  2631. break;
  2632. case 12:
  2633. redStones[4].drawSprite(173+3, 298);
  2634. break;
  2635. case 13:
  2636. redStones[3].drawSprite(206+3, 298);
  2637. break;
  2638. }
  2639. }
  2640.  
  2641. } else if(is562){
  2642. drawTabHover();
  2643. if(tabInterfaceIDs[tabID] != -1)
  2644. {
  2645. if(tabID == 0)
  2646. tabClicked.drawSprite(2, 0);
  2647. if(tabID == 1)
  2648. tabClicked.drawSprite(32, 0);
  2649. if(tabID == 2)
  2650. tabClicked.drawSprite(62, 0);
  2651. if(tabID == 14)
  2652. tabClicked.drawSprite(92, 0);
  2653. if(tabID == 3)
  2654. tabClicked.drawSprite(122, 0);
  2655. if(tabID == 4)
  2656. tabClicked.drawSprite(152, 0);
  2657. if(tabID == 5)
  2658. tabClicked.drawSprite(182, 0);
  2659. if(tabID == 6)
  2660. tabClicked.drawSprite(212, 0);
  2661. if(tabID == 16)
  2662. tabClicked.drawSprite(2, 298);
  2663. if(tabID == 8)
  2664. tabClicked.drawSprite(32, 298);
  2665. if(tabID == 9)
  2666. tabClicked.drawSprite(62, 298);
  2667. if(tabID == 7)
  2668. tabClicked.drawSprite(92, 298);
  2669. if(tabID == 11)
  2670. tabClicked.drawSprite(122, 298);
  2671. if(tabID == 12)
  2672. tabClicked.drawSprite(152, 298);
  2673. if(tabID == 13)
  2674. tabClicked.drawSprite(182, 298);
  2675. if(tabID == 15)
  2676. tabClicked.drawSprite(212, 298);
  2677. }
  2678. } else {
  2679. if(tabInterfaceIDs[tabID] != -1) {
  2680. switch(tabID) {
  2681. case 0:
  2682. redStones[5].drawSprite(16+7, 1);
  2683. break;
  2684. case 1:
  2685. redStones[13].drawSprite(48+7, 1);
  2686. break;
  2687. case 2:
  2688. redStones[13].drawSprite(75+7, 1);
  2689. break;
  2690. case 3:
  2691. redStones[7].drawSprite(103+7, 0);
  2692. break;
  2693. case 4:
  2694. redStones[14].drawSprite(146+7, 1);
  2695. break;
  2696. case 5:
  2697. redStones[14].drawSprite(174+7, 1);
  2698. break;
  2699. case 6:
  2700. redStones[6].drawSprite(202+7, 2);
  2701. break;
  2702.  
  2703. case 7:
  2704. redStones[12].drawSprite(22, 296);
  2705. break;
  2706. case 8:
  2707. redStones[9].drawSprite(54, 297);
  2708. break;
  2709. case 9:
  2710. redStones[9].drawSprite(82, 297);
  2711. break;
  2712. case 10:
  2713. redStones[10].drawSprite(110, 299);
  2714. break;
  2715. case 11:
  2716. redStones[8].drawSprite(153, 297);
  2717. break;
  2718. case 12:
  2719. redStones[8].drawSprite(181, 297);
  2720. break;
  2721. case 13:
  2722. redStones[11].drawSprite(209, 297);
  2723. break;
  2724. }
  2725. }
  2726. }
  2727. }
  2728.  
  2729. private void drawTabArea() {
  2730. inventoryBackImage.initDrawingArea();
  2731. Texture.anIntArray1472 = anIntArray1181;
  2732. tabArea[getSpriteID()].drawSprite(0, 0);
  2733. if(spriteChanged)
  2734. needDrawTabArea = true;
  2735. tabAreaAltered = true;
  2736. if(invOverlayInterfaceID == -1) {
  2737. drawRedStones();
  2738. drawSideIcons();
  2739. }
  2740. if(is474 || is480 || is508 || is525 || is562) {
  2741. if(invOverlayInterfaceID != -1)
  2742. drawInterface(0, 32, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2743. else if(tabInterfaceIDs[tabID] != -1)
  2744. drawInterface(0, 32, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2745. } else if(is562){
  2746. if(tabHPos == 0 && tabInterfaceIDs[0] != -1)
  2747. tabHover.drawSprite(3, 0);
  2748. else if(tabHPos == 1 && tabInterfaceIDs[1] != -1)
  2749. tabHover.drawSprite(33, 0);
  2750. else if(tabHPos == 2 && tabInterfaceIDs[2] != -1)
  2751. tabHover.drawSprite(63, 0);
  2752. else if(tabHPos == 3 && tabInterfaceIDs[14] != -1)
  2753. tabHover.drawSprite(93, 0);
  2754. else if(tabHPos == 4 && tabInterfaceIDs[3] != -1)
  2755. tabHover.drawSprite(123, 0);
  2756. else if(tabHPos == 5 && tabInterfaceIDs[4] != -1)
  2757. tabHover.drawSprite(153, 0);
  2758. else if(tabHPos == 6 && tabInterfaceIDs[5] != -1)
  2759. tabHover.drawSprite(183, 0);
  2760. else if(tabHPos == 7 && tabInterfaceIDs[6] != -1)
  2761. tabHover.drawSprite(213, 0);
  2762. else if(tabHPos == 15 && tabInterfaceIDs[16] != -1)
  2763. tabHover.drawSprite(3, 298);
  2764. else if(tabHPos == 8 && tabInterfaceIDs[9] != -1)
  2765. tabHover.drawSprite(33, 298);
  2766. else if(tabHPos == 9 && tabInterfaceIDs[8] != -1)
  2767. tabHover.drawSprite(63, 298);
  2768. else if(tabHPos == 10 && tabInterfaceIDs[7] != -1)
  2769. tabHover.drawSprite(93, 298);
  2770. else if(tabHPos == 11 && tabInterfaceIDs[11] != -1)
  2771. tabHover.drawSprite(123, 298);
  2772. else if(tabHPos == 12 && tabInterfaceIDs[12] != -1)
  2773. tabHover.drawSprite(153, 298);
  2774. else if(tabHPos == 13 && tabInterfaceIDs[13] != -1)
  2775. tabHover.drawSprite(183,298);
  2776. else if(tabHPos == 14 && tabInterfaceIDs[15] != -1)
  2777. tabHover.drawSprite(213, 298);
  2778. } else {
  2779. if(invOverlayInterfaceID != -1)
  2780. drawInterface(0, 38, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2781. else if(tabInterfaceIDs[tabID] != -1)
  2782. drawInterface(0, 38, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2783. }
  2784. if(menuOpen)
  2785. drawMenu(516, 168);
  2786. inventoryBackImage.drawGraphics(168, super.graphics, 516);//519
  2787. inGameScreen.initDrawingArea();
  2788. Texture.anIntArray1472 = anIntArray1182;
  2789. }
  2790.  
  2791. private void method37(int j) {
  2792. if(!lowMem) {
  2793. if(Texture.anIntArray1480[17] >= j) {
  2794.  
  2795. Background background = Texture.aBackgroundArray1474s[17];
  2796. int k = background.anInt1452 * background.anInt1453 - 1;
  2797. //fire cape apparently?
  2798. int j1 = background.anInt1452 * anInt945 * 2;
  2799. byte abyte0[] = background.aByteArray1450;
  2800. byte abyte3[] = aByteArray912;
  2801. for(int i2 = 0; i2 <= k; i2++)
  2802. abyte3[i2] = abyte0[i2 - j1 & k];
  2803.  
  2804. background.aByteArray1450 = abyte3;
  2805. aByteArray912 = abyte0;
  2806. Texture.method370(17);
  2807. anInt854++;
  2808. if(anInt854 > 1235) {
  2809. anInt854 = 0;
  2810. stream.createFrame(226);
  2811. stream.writeWordBigEndian(0);
  2812. int l2 = stream.currentOffset;
  2813. stream.writeWord(58722);
  2814. stream.writeWordBigEndian(240);
  2815. stream.writeWord((int)(Math.random() * 65536D));
  2816. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2817. if((int)(Math.random() * 2D) == 0)
  2818. stream.writeWord(51825);
  2819. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2820. stream.writeWord((int)(Math.random() * 65536D));
  2821. stream.writeWord(7130);
  2822. stream.writeWord((int)(Math.random() * 65536D));
  2823. stream.writeWord(61657);
  2824. stream.writeBytes(stream.currentOffset - l2);
  2825. }
  2826. }
  2827. if(Texture.anIntArray1480[24] >= j) {
  2828. Background background_1 = Texture.aBackgroundArray1474s[24];
  2829. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2830. int k1 = background_1.anInt1452 * anInt945 * 2;
  2831. byte abyte1[] = background_1.aByteArray1450;
  2832. byte abyte4[] = aByteArray912;
  2833. for(int j2 = 0; j2 <= l; j2++)
  2834. abyte4[j2] = abyte1[j2 - k1 & l];
  2835.  
  2836. background_1.aByteArray1450 = abyte4;
  2837. aByteArray912 = abyte1;
  2838. Texture.method370(24);
  2839. }
  2840. if(Texture.anIntArray1480[34] >= j) {
  2841. Background background_2 = Texture.aBackgroundArray1474s[34];
  2842. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2843. int l1 = background_2.anInt1452 * anInt945 * 2;
  2844. byte abyte2[] = background_2.aByteArray1450;
  2845. byte abyte5[] = aByteArray912;
  2846. for(int k2 = 0; k2 <= i1; k2++)
  2847. abyte5[k2] = abyte2[k2 - l1 & i1];
  2848.  
  2849. background_2.aByteArray1450 = abyte5;
  2850. aByteArray912 = abyte2;
  2851. Texture.method370(34);
  2852. }
  2853. if(Texture.anIntArray1480[40] >= j)
  2854. {
  2855. Background background_2 = Texture.aBackgroundArray1474s[40];
  2856. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2857. int l1 = background_2.anInt1452 * anInt945 * 2;
  2858. byte abyte2[] = background_2.aByteArray1450;
  2859. byte abyte5[] = aByteArray912;
  2860. for(int k2 = 0; k2 <= i1; k2++)
  2861. abyte5[k2] = abyte2[k2 - l1 & i1];
  2862.  
  2863. background_2.aByteArray1450 = abyte5;
  2864. aByteArray912 = abyte2;
  2865. Texture.method370(40);
  2866.  
  2867. }
  2868. }
  2869. }
  2870.  
  2871. private void method38() {
  2872. for(int i = -1; i < playerCount; i++) {
  2873. int j;
  2874. if(i == -1)
  2875. j = myPlayerIndex;
  2876. else
  2877. j = playerIndices[i];
  2878. Player player = playerArray[j];
  2879. if(player != null && player.textCycle > 0) {
  2880. player.textCycle--;
  2881. if(player.textCycle == 0)
  2882. player.textSpoken = null;
  2883. }
  2884. }
  2885. for(int k = 0; k < npcCount; k++) {
  2886. int l = npcIndices[k];
  2887. NPC npc = npcArray[l];
  2888. if(npc != null && npc.textCycle > 0) {
  2889. npc.textCycle--;
  2890. if(npc.textCycle == 0)
  2891. npc.textSpoken = null;
  2892. }
  2893. }
  2894. }
  2895.  
  2896. private void calcCameraPos() {
  2897.  
  2898. int i = anInt1098 * 128 + 64;
  2899. int j = anInt1099 * 128 + 64;
  2900. int k = method42(plane, j, i) - anInt1100;
  2901. if(xCameraPos < i) {
  2902. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2903. if(xCameraPos > i)
  2904. xCameraPos = i;
  2905. }
  2906. if(xCameraPos > i) {
  2907. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2908. if(xCameraPos < i)
  2909. xCameraPos = i;
  2910. }
  2911. if(zCameraPos < k) {
  2912. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2913. if(zCameraPos > k)
  2914. zCameraPos = k;
  2915. }
  2916. if(zCameraPos > k) {
  2917. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2918. if(zCameraPos < k)
  2919. zCameraPos = k;
  2920. }
  2921. if(yCameraPos < j) {
  2922. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2923. if(yCameraPos > j)
  2924. yCameraPos = j;
  2925. }
  2926. if(yCameraPos > j) {
  2927. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2928. if(yCameraPos < j)
  2929. yCameraPos = j;
  2930. }
  2931. i = anInt995 * 128 + 64;
  2932. j = anInt996 * 128 + 64;
  2933. k = method42(plane, j, i) - anInt997;
  2934. int l = i - xCameraPos;
  2935. int i1 = k - zCameraPos;
  2936. int j1 = j - yCameraPos;
  2937. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  2938. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2939. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2940. if(l1 < 128)
  2941. l1 = 128;
  2942. if(l1 > 383)
  2943. l1 = 383;
  2944. if(yCameraCurve < l1) {
  2945. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2946. if(yCameraCurve > l1)
  2947. yCameraCurve = l1;
  2948. }
  2949. if(yCameraCurve > l1) {
  2950. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2951. if(yCameraCurve < l1)
  2952. yCameraCurve = l1;
  2953. }
  2954. int j2 = i2 - xCameraCurve;
  2955. if(j2 > 1024)
  2956. j2 -= 2048;
  2957. if(j2 < -1024)
  2958. j2 += 2048;
  2959. if(j2 > 0) {
  2960. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2961. xCameraCurve &= 0x7ff;
  2962. }
  2963. if(j2 < 0) {
  2964. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2965. xCameraCurve &= 0x7ff;
  2966. }
  2967. int k2 = i2 - xCameraCurve;
  2968. if(k2 > 1024)
  2969. k2 -= 2048;
  2970. if(k2 < -1024)
  2971. k2 += 2048;
  2972. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2973. xCameraCurve = i2;
  2974. }
  2975.  
  2976. private void drawMenu(int xOffSet, int yOffSet) {
  2977. if(menuToggle == false) {
  2978. int xPos = menuOffsetX - (xOffSet - 4);
  2979. int yPos = (-yOffSet + 4) + menuOffsetY;
  2980. int menuW = menuWidth;
  2981. int menuH = menuHeight + 1;
  2982. int color = 0x5d5447;
  2983. needDrawTabArea = true;
  2984. inputTaken = true;
  2985. tabAreaAltered = true;
  2986. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2987. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2988. DrawingArea.drawPixels(menuH, yPos, xPos, color, menuW);
  2989. DrawingArea.drawPixels(16, yPos + 1, xPos + 1, 0, menuW - 2);
  2990. DrawingArea.fillPixels(xPos + 1, menuW - 2, menuH - 19, 0, yPos + 18);
  2991. chatTextDrawingArea.method385(color, "Choose Option", yPos + 14, xPos + 3);
  2992. int mouseX = super.mouseX - (xOffSet);
  2993. int mouseY = (-yOffSet) + super.mouseY;
  2994. for(int l1 = 0; l1 < menuActionRow; l1++) {
  2995. int textY = yPos + 31 + (menuActionRow - 1 - l1) * 15;
  2996. int disColor = 0xffffff;
  2997. if(mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13 && mouseY < textY + 3)
  2998. disColor = 0xffff00;
  2999. chatTextDrawingArea.method389(true, xPos + 3, disColor, menuActionName[l1], textY);
  3000. }
  3001. } else if(menuToggle == true) {
  3002. int xPos = menuOffsetX - (xOffSet - 4);
  3003. int yPos = (-yOffSet + 4) + menuOffsetY;
  3004. int menuW = menuWidth;
  3005. int menuH = menuHeight + 1;
  3006. needDrawTabArea = true;
  3007. inputTaken = true;
  3008. tabAreaAltered = true;
  3009. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  3010. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  3011. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos, 0x706a5e, menuW);
  3012. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 1, 0x706a5e, menuW - 2);
  3013. DrawingArea.drawPixels(menuH, yPos, xPos + 2, 0x706a5e, menuW - 4);
  3014. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 3, 0x2d2822, menuW - 6);
  3015. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos + 2, 0x2d2822, menuW - 4);
  3016. DrawingArea.drawPixels(menuH - 6, yPos + 3, xPos + 1, 0x2d2822, menuW - 2);
  3017. DrawingArea.drawPixels(menuH - 22, yPos + 19, xPos + 2, 0x524a3d, menuW - 4);
  3018. DrawingArea.drawPixels(menuH - 22, yPos + 20, xPos + 3, 0x524a3d, menuW - 6);
  3019. DrawingArea.drawPixels(menuH - 23, yPos + 20, xPos + 3, 0x2b271c, menuW - 6);
  3020. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x2a291b, yPos + 2);
  3021. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a261b, yPos + 3);
  3022. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x252116, yPos + 4);
  3023. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x211e15, yPos + 5);
  3024. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1e1b12, yPos + 6);
  3025. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1a170e, yPos + 7);
  3026. DrawingArea.fillPixels(xPos + 2, menuW - 4, 2, 0x15120b, yPos + 8);
  3027. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x100d08, yPos + 10);
  3028. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 11);
  3029. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x080703, yPos + 12);
  3030. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 13);
  3031. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 14);
  3032. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 15);
  3033. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 16);
  3034. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 17);
  3035. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a291b, yPos + 18);
  3036. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x564943, yPos + 19);
  3037. chatTextDrawingArea.method385(0xc6b895, "Choose Option", yPos + 14, xPos + 3);
  3038. int j1 = super.mouseX;
  3039. int k1 = super.mouseY;
  3040. int mouseX = super.mouseX - (xOffSet);
  3041. int mouseY = (-yOffSet) + super.mouseY;
  3042. for(int l1 = 0; l1 < menuActionRow; l1++) {
  3043. int textY = yPos + 31 + (menuActionRow - 1 - l1) * 15;
  3044. int disColor = 0xc6b895;
  3045. if(mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13 && mouseY < textY + 3) {
  3046. DrawingArea.drawPixels(15, textY - 11, xPos + 3, 0x6f695d, menuWidth - 6);
  3047. disColor = 0xeee5c6;
  3048. }
  3049. chatTextDrawingArea.method389(true, xPos + 3, disColor, menuActionName[l1], textY);
  3050. }
  3051. }
  3052. }
  3053.  
  3054. private void addFriend(long l) {
  3055. try {
  3056. if(l == 0L)
  3057. return;
  3058. if(friendsCount >= 100 && anInt1046 != 1) {
  3059. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  3060. return;
  3061. }
  3062. if(friendsCount >= 200) {
  3063. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  3064. return;
  3065. }
  3066. String s = TextClass.fixName(TextClass.nameForLong(l));
  3067. for(int i = 0; i < friendsCount; i++)
  3068. if(friendsListAsLongs[i] == l) {
  3069. pushMessage(s + " is already on your friend list", 0, "");
  3070. return;
  3071. }
  3072. for(int j = 0; j < ignoreCount; j++)
  3073. if(ignoreListAsLongs[j] == l) {
  3074. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  3075. return;
  3076. }
  3077.  
  3078. if(s.equals(myPlayer.name)) {
  3079. return;
  3080. } else {
  3081. friendsList[friendsCount] = s;
  3082. friendsListAsLongs[friendsCount] = l;
  3083. friendsNodeIDs[friendsCount] = 0;
  3084. friendsCount++;
  3085. needDrawTabArea = true;
  3086. stream.createFrame(188);
  3087. stream.writeQWord(l);
  3088. return;
  3089. }
  3090. } catch(RuntimeException runtimeexception) {
  3091. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  3092. }
  3093. throw new RuntimeException();
  3094. }
  3095.  
  3096. private int method42(int i, int j, int k) {
  3097. int l = k >> 7;
  3098. int i1 = j >> 7;
  3099. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  3100. return 0;
  3101. int j1 = i;
  3102. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  3103. j1++;
  3104. int k1 = k & 0x7f;
  3105. int l1 = j & 0x7f;
  3106. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  3107. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  3108. return i2 * (128 - l1) + j2 * l1 >> 7;
  3109. }
  3110.  
  3111. private static String intToKOrMil(int j) {
  3112. if(j < 0x186a0)
  3113. return String.valueOf(j);
  3114. if(j < 0x989680)
  3115. return j / 1000 + "K";
  3116. else
  3117. return j / 0xf4240 + "M";
  3118. }
  3119.  
  3120. private void resetLogout() {
  3121. try {
  3122. if(socketStream != null)
  3123. socketStream.close();
  3124. }
  3125. catch(Exception _ex) { }
  3126. socketStream = null;
  3127. loggedIn = false;
  3128. loginScreenState = 0;
  3129. //myUsername = "";
  3130. //myPassword = "";
  3131. unlinkMRUNodes();
  3132. worldController.initToNull();
  3133. for(int i = 0; i < 4; i++)
  3134. aClass11Array1230[i].method210();
  3135. System.gc();
  3136. stopMidi();
  3137. currentSong = -1;
  3138. nextSong = -1;
  3139. prevSong = 0;
  3140. followPlayer = 0;
  3141. followNPC = 0;
  3142. followDistance = 1;
  3143. }
  3144.  
  3145. private void method45() {
  3146.  
  3147.  
  3148. aBoolean1031 = true;
  3149. for(int j = 0; j < 7; j++) {
  3150. anIntArray1065[j] = -1;
  3151. for(int k = 0; k < IdentityKit.length; k++) {
  3152. if(IdentityKit.cache[k].aBoolean662 || IdentityKit.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  3153. continue;
  3154. anIntArray1065[j] = k;
  3155. break;
  3156. }
  3157. }
  3158. }
  3159.  
  3160. private void method46(int i, Stream stream) {
  3161. while(stream.bitPosition + 21 < i * 8) {
  3162. int k = stream.readBits(14);
  3163. if(k == 16383)
  3164. break;
  3165. if(npcArray[k] == null)
  3166. npcArray[k] = new NPC();
  3167. NPC npc = npcArray[k];
  3168. npcIndices[npcCount++] = k;
  3169. npc.anInt1537 = loopCycle;
  3170. int l = stream.readBits(5);
  3171. if(l > 15)
  3172. l -= 32;
  3173. int i1 = stream.readBits(5);
  3174. if(i1 > 15)
  3175. i1 -= 32;
  3176. int j1 = stream.readBits(1);
  3177. npc.desc = EntityDef.forID(stream.readBits(14));//NPC FIX
  3178. int k1 = stream.readBits(1);
  3179. if(k1 == 1)
  3180. anIntArray894[anInt893++] = k;
  3181. npc.anInt1540 = npc.desc.aByte68;
  3182. npc.anInt1504 = npc.desc.anInt79;
  3183. npc.anInt1554 = npc.desc.anInt67;
  3184. npc.anInt1555 = npc.desc.anInt58;
  3185. npc.anInt1556 = npc.desc.anInt83;
  3186. npc.anInt1557 = npc.desc.anInt55;
  3187. npc.anInt1511 = npc.desc.anInt77;
  3188. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  3189. }
  3190. stream.finishBitAccess();
  3191. }
  3192.  
  3193. public void processGameLoop() {
  3194.  
  3195.  
  3196. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  3197. return;
  3198. loopCycle++;
  3199. if(!loggedIn)
  3200. processLoginScreenInput();
  3201. else
  3202. mainGameProcessor();
  3203. processOnDemandQueue();
  3204. }
  3205.  
  3206. private void method47(boolean flag) {
  3207. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  3208. destX = 0;
  3209. int j = playerCount;
  3210. if(flag)
  3211. j = 1;
  3212. for(int l = 0; l < j; l++) {
  3213. Player player;
  3214. int i1;
  3215. if(flag) {
  3216. player = myPlayer;
  3217. i1 = myPlayerIndex << 14;
  3218. } else {
  3219. player = playerArray[playerIndices[l]];
  3220. i1 = playerIndices[l] << 14;
  3221. }
  3222. if(player == null || !player.isVisible())
  3223. continue;
  3224. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  3225. int j1 = player.x >> 7;
  3226. int k1 = player.y >> 7;
  3227. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  3228. continue;
  3229. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  3230. player.aBoolean1699 = false;
  3231. player.anInt1709 = method42(plane, player.y, player.x);
  3232. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  3233. continue;
  3234. }
  3235. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  3236. if(anIntArrayArray929[j1][k1] == anInt1265)
  3237. continue;
  3238. anIntArrayArray929[j1][k1] = anInt1265;
  3239. }
  3240. player.anInt1709 = method42(plane, player.y, player.x);
  3241. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  3242. }
  3243. }
  3244.  
  3245. private boolean promptUserForInput(RSInterface class9) {
  3246. int j = class9.contentType;
  3247. if(anInt900 == 2) {
  3248. if(j == 201) {
  3249. inputTaken = true;
  3250. inputDialogState = 0;
  3251. messagePromptRaised = true;
  3252. promptInput = "";
  3253. friendsListAction = 1;
  3254. aString1121 = "Enter name of friend to add to list";
  3255. }
  3256. if(j == 202) {
  3257. inputTaken = true;
  3258. inputDialogState = 0;
  3259. messagePromptRaised = true;
  3260. promptInput = "";
  3261. friendsListAction = 2;
  3262. aString1121 = "Enter name of friend to delete from list";
  3263. }
  3264. }
  3265. if(j == 205) {
  3266. anInt1011 = 250;
  3267. return true;
  3268. }
  3269. if(j == 501) {
  3270. inputTaken = true;
  3271. inputDialogState = 0;
  3272. messagePromptRaised = true;
  3273. promptInput = "";
  3274. friendsListAction = 4;
  3275. aString1121 = "Enter name of player to add to list";
  3276. }
  3277. if(j == 502) {
  3278. inputTaken = true;
  3279. inputDialogState = 0;
  3280. messagePromptRaised = true;
  3281. promptInput = "";
  3282. friendsListAction = 5;
  3283. aString1121 = "Enter name of player to delete from list";
  3284. }
  3285. if(j == 550) {
  3286. inputTaken = true;
  3287. inputDialogState = 0;
  3288. messagePromptRaised = true;
  3289. promptInput = "";
  3290. friendsListAction = 6;
  3291. aString1121 = "Enter the name of the chat you wish to join";
  3292. }
  3293. if(j >= 300 && j <= 313) {
  3294. int k = (j - 300) / 2;
  3295. int j1 = j & 1;
  3296. int i2 = anIntArray1065[k];
  3297. if(i2 != -1) {
  3298. do {
  3299. if(j1 == 0 && --i2 < 0)
  3300. i2 = IdentityKit.length - 1;
  3301. if(j1 == 1 && ++i2 >= IdentityKit.length)
  3302. i2 = 0;
  3303. } while(IdentityKit.cache[i2].aBoolean662 || IdentityKit.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  3304. anIntArray1065[k] = i2;
  3305. aBoolean1031 = true;
  3306. }
  3307. }
  3308. if(j >= 314 && j <= 323) {
  3309. int l = (j - 314) / 2;
  3310. int k1 = j & 1;
  3311. int j2 = anIntArray990[l];
  3312. if(k1 == 0 && --j2 < 0)
  3313. j2 = anIntArrayArray1003[l].length - 1;
  3314. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  3315. j2 = 0;
  3316. anIntArray990[l] = j2;
  3317. aBoolean1031 = true;
  3318. }
  3319. if(j == 324 && !aBoolean1047) {
  3320. aBoolean1047 = true;
  3321. method45();
  3322. }
  3323. if(j == 325 && aBoolean1047) {
  3324. aBoolean1047 = false;
  3325. method45();
  3326. }
  3327. if(j == 326) {
  3328. stream.createFrame(101);
  3329. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  3330. for(int i1 = 0; i1 < 7; i1++)
  3331. stream.writeWordBigEndian(anIntArray1065[i1]);
  3332.  
  3333. for(int l1 = 0; l1 < 5; l1++)
  3334. stream.writeWordBigEndian(anIntArray990[l1]);
  3335.  
  3336. return true;
  3337. }
  3338. if(j == 613)
  3339. canMute = !canMute;
  3340. if(j >= 601 && j <= 612) {
  3341. clearTopInterfaces();
  3342. if(reportAbuseInput.length() > 0) {
  3343. stream.createFrame(218);
  3344. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  3345. stream.writeWordBigEndian(j - 601);
  3346. stream.writeWordBigEndian(canMute ? 1 : 0);
  3347. }
  3348. }
  3349. return false;
  3350. }
  3351.  
  3352. /*private void method49(Stream stream) {
  3353. for(int j = 0; j < anInt893; j++) {
  3354. int k = anIntArray894[j];
  3355. Player player = playerArray[k];
  3356. int l = stream.readUnsignedByte();
  3357. if((l & 0x40) != 0)
  3358. l += stream.readUnsignedByte() << 8;
  3359. method107(l, k, stream, player);
  3360. }
  3361. }*/
  3362. private void method49(Stream stream)
  3363. {
  3364. for(int j = 0; j < anInt893; j++)
  3365. {
  3366. int k = anIntArray894[j];
  3367. Player player = playerArray[k];
  3368. int l = stream.readUnsignedByte();
  3369. if((l & 0x40) != 0)
  3370. l += stream.readUnsignedByte() << 8;
  3371. method107(l, k, stream, player);
  3372. }
  3373.  
  3374. }
  3375.  
  3376. private void method50(int i, int k, int l, int i1, int j1) {
  3377. int k1 = worldController.method300(j1, l, i);
  3378. if(k1 != 0) {
  3379. int l1 = worldController.method304(j1, l, i, k1);
  3380. int k2 = l1 >> 6 & 3;
  3381. int i3 = l1 & 0x1f;
  3382. int k3 = k;
  3383. if(k1 > 0)
  3384. k3 = i1;
  3385. int ai[] = aSprite_1263.myPixels;
  3386. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3387. int i5 = k1 >> 14 & 0x7fff;
  3388. ObjectDef class46_2 = ObjectDef.forID(i5);
  3389. if(class46_2.anInt758 != -1) {
  3390. Background background_2 = mapScenes[class46_2.anInt758];
  3391. if(background_2 != null) {
  3392. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  3393. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  3394. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  3395. }
  3396. } else {
  3397. if(i3 == 0 || i3 == 2)
  3398. if(k2 == 0) {
  3399. ai[k4] = k3;
  3400. ai[k4 + 512] = k3;
  3401. ai[k4 + 1024] = k3;
  3402. ai[k4 + 1536] = k3;
  3403. } else if(k2 == 1) {
  3404. ai[k4] = k3;
  3405. ai[k4 + 1] = k3;
  3406. ai[k4 + 2] = k3;
  3407. ai[k4 + 3] = k3;
  3408. } else if(k2 == 2) {
  3409. ai[k4 + 3] = k3;
  3410. ai[k4 + 3 + 512] = k3;
  3411. ai[k4 + 3 + 1024] = k3;
  3412. ai[k4 + 3 + 1536] = k3;
  3413. } else if(k2 == 3) {
  3414. ai[k4 + 1536] = k3;
  3415. ai[k4 + 1536 + 1] = k3;
  3416. ai[k4 + 1536 + 2] = k3;
  3417. ai[k4 + 1536 + 3] = k3;
  3418. }
  3419. if(i3 == 3)
  3420. if(k2 == 0)
  3421. ai[k4] = k3;
  3422. else if(k2 == 1)
  3423. ai[k4 + 3] = k3;
  3424. else if(k2 == 2)
  3425. ai[k4 + 3 + 1536] = k3;
  3426. else if(k2 == 3)
  3427. ai[k4 + 1536] = k3;
  3428. if(i3 == 2)
  3429. if(k2 == 3) {
  3430. ai[k4] = k3;
  3431. ai[k4 + 512] = k3;
  3432. ai[k4 + 1024] = k3;
  3433. ai[k4 + 1536] = k3;
  3434. } else if(k2 == 0) {
  3435. ai[k4] = k3;
  3436. ai[k4 + 1] = k3;
  3437. ai[k4 + 2] = k3;
  3438. ai[k4 + 3] = k3;
  3439. } else if(k2 == 1) {
  3440. ai[k4 + 3] = k3;
  3441. ai[k4 + 3 + 512] = k3;
  3442. ai[k4 + 3 + 1024] = k3;
  3443. ai[k4 + 3 + 1536] = k3;
  3444. } else if(k2 == 2) {
  3445. ai[k4 + 1536] = k3;
  3446. ai[k4 + 1536 + 1] = k3;
  3447. ai[k4 + 1536 + 2] = k3;
  3448. ai[k4 + 1536 + 3] = k3;
  3449. }
  3450. }
  3451. }
  3452. k1 = worldController.method302(j1, l, i);
  3453. if(k1 != 0) {
  3454. int i2 = worldController.method304(j1, l, i, k1);
  3455. int l2 = i2 >> 6 & 3;
  3456. int j3 = i2 & 0x1f;
  3457. int l3 = k1 >> 14 & 0x7fff;
  3458. ObjectDef class46_1 = ObjectDef.forID(l3);
  3459. if(class46_1.anInt758 != -1) {
  3460. Background background_1 = mapScenes[class46_1.anInt758];
  3461. if(background_1 != null) {
  3462. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  3463. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  3464. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  3465. }
  3466. } else if(j3 == 9) {
  3467. int l4 = 0xeeeeee;
  3468. if(k1 > 0)
  3469. l4 = 0xee0000;
  3470. int ai1[] = aSprite_1263.myPixels;
  3471. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3472. if(l2 == 0 || l2 == 2) {
  3473. ai1[l5 + 1536] = l4;
  3474. ai1[l5 + 1024 + 1] = l4;
  3475. ai1[l5 + 512 + 2] = l4;
  3476. ai1[l5 + 3] = l4;
  3477. } else {
  3478. ai1[l5] = l4;
  3479. ai1[l5 + 512 + 1] = l4;
  3480. ai1[l5 + 1024 + 2] = l4;
  3481. ai1[l5 + 1536 + 3] = l4;
  3482. }
  3483. }
  3484. }
  3485. k1 = worldController.method303(j1, l, i);
  3486. if(k1 != 0) {
  3487. int j2 = k1 >> 14 & 0x7fff;
  3488. ObjectDef class46 = ObjectDef.forID(j2);
  3489. if(class46.anInt758 != -1) {
  3490. Background background = mapScenes[class46.anInt758];
  3491. if(background != null) {
  3492. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  3493. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  3494. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  3495. }
  3496. }
  3497. }
  3498. }
  3499.  
  3500. private void loadTitleScreen() {
  3501. if(normalLogin == true)
  3502. titleBox = new Background(titleStreamLoader, "titlebox", 0);
  3503. else
  3504. titleBox1 = new Sprite("Login/Random/TITLEBOX");
  3505. titleButton = new Background(titleStreamLoader, "titlebutton", 0);
  3506. aBackgroundArray1152s = new Background[12];
  3507. if(super.mouseX >= 600 && super.mouseX <= 645 + 16 && super.mouseY >= 400 && super.mouseY <= 412 + 16){
  3508. drawbutton("./.ss_474/Sprites/Interfaces/Bank/Change1",600,400);
  3509. }else{
  3510. drawbutton("./.ss_474/Sprites/Interfaces/Bank/Change2",600,400);
  3511. }
  3512. int j = 0;
  3513. try {
  3514. j = Integer.parseInt(getParameter("fl_icon"));
  3515. } catch(Exception _ex) {
  3516. }
  3517. if(j == 0) {
  3518. for(int k = 0; k < 12; k++)
  3519. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  3520.  
  3521. } else {
  3522. for(int l = 0; l < 12; l++)
  3523. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  3524.  
  3525. }
  3526. aSprite_1201 = new Sprite(128, 265);
  3527. aSprite_1202 = new Sprite(128, 265);
  3528. System.arraycopy(leftSideFlame.anIntArray315, 0, aSprite_1201.myPixels, 0, 33920);
  3529.  
  3530. System.arraycopy(rightSideFlame.anIntArray315, 0, aSprite_1202.myPixels, 0, 33920);
  3531.  
  3532. anIntArray851 = new int[256];
  3533. for(int k1 = 0; k1 < 64; k1++)
  3534. anIntArray851[k1] = k1 * 0x40000;
  3535.  
  3536. for(int l1 = 0; l1 < 64; l1++)
  3537. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3538.  
  3539. for(int i2 = 0; i2 < 64; i2++)
  3540. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3541.  
  3542. for(int j2 = 0; j2 < 64; j2++)
  3543. anIntArray851[j2 + 192] = 0xffffff;
  3544.  
  3545. anIntArray852 = new int[256];
  3546. for(int k2 = 0; k2 < 64; k2++)
  3547. anIntArray852[k2] = k2 * 1024;
  3548.  
  3549. for(int l2 = 0; l2 < 64; l2++)
  3550. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3551.  
  3552. for(int i3 = 0; i3 < 64; i3++)
  3553. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3554.  
  3555. for(int j3 = 0; j3 < 64; j3++)
  3556. anIntArray852[j3 + 192] = 0xffffff;
  3557.  
  3558. anIntArray853 = new int[256];
  3559. for(int k3 = 0; k3 < 64; k3++)
  3560. anIntArray853[k3] = k3 * 4;
  3561.  
  3562. for(int l3 = 0; l3 < 64; l3++)
  3563. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3564.  
  3565. for(int i4 = 0; i4 < 64; i4++)
  3566. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3567.  
  3568. for(int j4 = 0; j4 < 64; j4++)
  3569. anIntArray853[j4 + 192] = 0xffffff;
  3570.  
  3571. anIntArray850 = new int[256];
  3572. anIntArray1190 = new int[32768];
  3573. anIntArray1191 = new int[32768];
  3574. randomizeBackground(null);
  3575. anIntArray828 = new int[32768];
  3576. anIntArray829 = new int[32768];
  3577. if(!aBoolean831) {
  3578. drawFlames = true;
  3579. aBoolean831 = true;
  3580. startRunnable(this, 2);
  3581. }
  3582. }
  3583.  
  3584. private static void setHighMem() {
  3585. WorldController.lowMem = false;
  3586. Texture.lowMem = false;
  3587. lowMem = false;
  3588. ObjectManager.lowMem = false;
  3589. ObjectDef.lowMem = false;
  3590. }
  3591.  
  3592. public static void main(String args[]) {
  3593. try {
  3594. nodeID = 10;
  3595. portOff = 0;
  3596. setLowMem();//sets high or low detail
  3597. isMembers = true;
  3598. signlink.storeid = 32;
  3599. signlink.startpriv(InetAddress.getLocalHost());
  3600. //sign.signlink.startpriv(InetAddress.getByName(("theparadiseowns.no-ip.biz")));
  3601. //sign.signlink.startpriv(InetAddress.getByName(("runedynasty.no-ip.org")));
  3602. instance = new client();
  3603. instance.createClientFrame(503, 765);//client frame size
  3604. } catch(Exception e) {
  3605. e.printStackTrace();
  3606. }
  3607. }
  3608.  
  3609. public static client instance;
  3610.  
  3611. private void loadingStages() {
  3612. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3613. inGameScreen.initDrawingArea();
  3614. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  3615. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  3616. inGameScreen.drawGraphics(4, super.graphics, 4);
  3617. loadingStage = 1;
  3618. aLong824 = System.currentTimeMillis();
  3619. }
  3620. if(loadingStage == 1) {
  3621. int j = method54();
  3622. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3623. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  3624. aLong824 = System.currentTimeMillis();
  3625. }
  3626. }
  3627. if(loadingStage == 2 && plane != anInt985) {
  3628. anInt985 = plane;
  3629. method24(plane);
  3630. }
  3631. }
  3632.  
  3633. private int method54() {
  3634. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  3635. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3636. return -1;
  3637. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3638. return -2;
  3639. }
  3640. boolean flag = true;
  3641. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  3642. byte abyte0[] = aByteArrayArray1247[j];
  3643. if(abyte0 != null) {
  3644. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3645. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3646. if(aBoolean1159) {
  3647. k = 10;
  3648. l = 10;
  3649. }
  3650. flag &= ObjectManager.method189(k, abyte0, l);
  3651. }
  3652. }
  3653. if(!flag)
  3654. return -3;
  3655. if(aBoolean1080) {
  3656. return -4;
  3657. } else {
  3658. loadingStage = 2;
  3659. ObjectManager.anInt131 = plane;
  3660. method22();
  3661. stream.createFrame(121);
  3662. return 0;
  3663. }
  3664. }
  3665.  
  3666. private void method55()
  3667. {
  3668. 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())
  3669. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3670. class30_sub2_sub4_sub4.unlink();
  3671. else
  3672. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  3673. {
  3674. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  3675. {
  3676. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3677. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  3678. 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);
  3679. }
  3680. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  3681. {
  3682. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3683. Player player;
  3684. if(j == unknownInt10)
  3685. player = myPlayer;
  3686. else
  3687. player = playerArray[j];
  3688. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  3689. 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);
  3690. }
  3691. class30_sub2_sub4_sub4.method456(anInt945);
  3692. 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);
  3693. }
  3694.  
  3695. }
  3696.  
  3697. public AppletContext getAppletContext()
  3698. {
  3699. if(signlink.mainapp != null)
  3700. return signlink.mainapp.getAppletContext();
  3701. else
  3702. return super.getAppletContext();
  3703. }
  3704.  
  3705. private void drawLogo() {
  3706. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  3707. Sprite sprite = new Sprite(abyte0, this);
  3708. if(normalLogin == true) {
  3709. leftSideFlame.initDrawingArea();
  3710. sprite.method346(0, 0);
  3711. rightSideFlame.initDrawingArea();
  3712. sprite.method346(-637, 0);
  3713. aRSImageProducer_1107.initDrawingArea();
  3714. sprite.method346(-128, 0);
  3715. aRSImageProducer_1108.initDrawingArea();
  3716. sprite.method346(-202, -371);
  3717. loginScreenArea.initDrawingArea();
  3718. sprite.method346(-202, -171);
  3719. gameLogo.initDrawingArea();
  3720. sprite.method346(0, -265);
  3721. aRSImageProducer_1113.initDrawingArea();
  3722. sprite.method346(-562, -265);
  3723. aRSImageProducer_1114.initDrawingArea();
  3724. sprite.method346(-128, -171);
  3725. aRSImageProducer_1115.initDrawingArea();
  3726. sprite.method346(-562, -171);
  3727. int ai[] = new int[sprite.myWidth];
  3728. for(int j = 0; j < sprite.myHeight; j++) {
  3729. for(int k = 0; k < sprite.myWidth; k++)
  3730. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  3731. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  3732. }
  3733. if(normalLogin == true) {
  3734. leftSideFlame.initDrawingArea();
  3735. sprite.method346(382, 0);
  3736. rightSideFlame.initDrawingArea();
  3737. sprite.method346(-255, 0);
  3738. aRSImageProducer_1107.initDrawingArea();
  3739. sprite.method346(254, 0);
  3740. aRSImageProducer_1108.initDrawingArea();
  3741. sprite.method346(180, -371);
  3742. loginScreenArea.initDrawingArea();
  3743. sprite.method346(180, -171);
  3744. gameLogo.initDrawingArea();
  3745. sprite.method346(382, -265);
  3746. aRSImageProducer_1113.initDrawingArea();
  3747. sprite.method346(-180, -265);
  3748. aRSImageProducer_1114.initDrawingArea();
  3749. sprite.method346(254, -171);
  3750. aRSImageProducer_1115.initDrawingArea();
  3751. sprite.method346(-180, -171);
  3752. sprite = new Sprite(titleStreamLoader, "logo", 0);
  3753. aRSImageProducer_1107.initDrawingArea();
  3754. sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  3755. }
  3756. } else {
  3757. int ai[] = new int[sprite.myWidth];
  3758. for(int j = 0; j < sprite.myHeight; j++) {
  3759. for(int k = 0; k < sprite.myWidth; k++)
  3760. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  3761. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  3762. }
  3763. LFull = new Sprite("Login/Random/LFull.png");
  3764. LEmpty = new Sprite("Login/Random/LEmpty.png");
  3765. Sprite logo = new Sprite(sign.signlink.findcachedir()+"/Sprites/Logo.PNG");
  3766. logo.drawSprite(385-174-174, 14+25);
  3767. loginScreenArea.initDrawingArea();
  3768. sprite.method346(0, 0);
  3769. }
  3770. sprite = null;
  3771. Object obj = null;
  3772. Object obj1 = null;
  3773. System.gc();
  3774. }
  3775.  
  3776. private void processOnDemandQueue()
  3777. {
  3778. do
  3779. {
  3780. OnDemandData onDemandData;
  3781. do
  3782. {
  3783. onDemandData = onDemandFetcher.getNextNode();
  3784. if(onDemandData == null)
  3785. return;
  3786. if(onDemandData.dataType == 0)
  3787. {
  3788. Model.method460(onDemandData.buffer, onDemandData.ID);
  3789. needDrawTabArea = true;
  3790. if(backDialogID != -1)
  3791. inputTaken = true;
  3792. }
  3793. if(onDemandData.dataType == 1 && onDemandData.buffer != null)
  3794. Class36.method529(onDemandData.buffer, onDemandData.ID);
  3795. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  3796. saveMidi(songChanging, onDemandData.buffer);
  3797. if(onDemandData.dataType == 3 && loadingStage == 1)
  3798. {
  3799. //System.out.println(onDemandData.ID);
  3800. try {
  3801. writeFile(onDemandData.buffer, "./maps/" + onDemandData.ID + ".dat");
  3802. } catch (Exception e) {}
  3803. for(int i = 0; i < aByteArrayArray1183.length; i++)
  3804. {
  3805. if(anIntArray1235[i] == onDemandData.ID)
  3806. {
  3807. aByteArrayArray1183[i] = onDemandData.buffer;
  3808. if(onDemandData.buffer == null) {
  3809. anIntArray1235[i] = -1;
  3810. }
  3811. break;
  3812. }
  3813. if(anIntArray1236[i] != onDemandData.ID)
  3814. continue;
  3815. aByteArrayArray1247[i] = onDemandData.buffer;
  3816. if(onDemandData.buffer == null) {
  3817. anIntArray1236[i] = -1;
  3818. }
  3819. break;
  3820. }
  3821.  
  3822. }
  3823. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  3824. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  3825. } while(true);
  3826. }
  3827.  
  3828. private void calcFlamesPosition()
  3829. {
  3830. char c = '\u0100';
  3831. for(int j = 10; j < 117; j++)
  3832. {
  3833. int k = (int)(Math.random() * 100D);
  3834. if(k < 50)
  3835. anIntArray828[j + (c - 2 << 7)] = 255;
  3836. }
  3837. for(int l = 0; l < 100; l++)
  3838. {
  3839. int i1 = (int)(Math.random() * 124D) + 2;
  3840. int k1 = (int)(Math.random() * 128D) + 128;
  3841. int k2 = i1 + (k1 << 7);
  3842. anIntArray828[k2] = 192;
  3843. }
  3844.  
  3845. for(int j1 = 1; j1 < c - 1; j1++)
  3846. {
  3847. for(int l1 = 1; l1 < 127; l1++)
  3848. {
  3849. int l2 = l1 + (j1 << 7);
  3850. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3851. }
  3852.  
  3853. }
  3854.  
  3855. anInt1275 += 128;
  3856. if(anInt1275 > anIntArray1190.length)
  3857. {
  3858. anInt1275 -= anIntArray1190.length;
  3859. int i2 = (int)(Math.random() * 12D);
  3860. randomizeBackground(aBackgroundArray1152s[i2]);
  3861. }
  3862. for(int j2 = 1; j2 < c - 1; j2++)
  3863. {
  3864. for(int i3 = 1; i3 < 127; i3++)
  3865. {
  3866. int k3 = i3 + (j2 << 7);
  3867. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  3868. if(i4 < 0)
  3869. i4 = 0;
  3870. anIntArray828[k3] = i4;
  3871. }
  3872.  
  3873. }
  3874.  
  3875. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3876.  
  3877. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  3878. if(anInt1040 > 0)
  3879. anInt1040 -= 4;
  3880. if(anInt1041 > 0)
  3881. anInt1041 -= 4;
  3882. if(anInt1040 == 0 && anInt1041 == 0)
  3883. {
  3884. int l3 = (int)(Math.random() * 2000D);
  3885. if(l3 == 0)
  3886. anInt1040 = 1024;
  3887. if(l3 == 1)
  3888. anInt1041 = 1024;
  3889. }
  3890. }
  3891.  
  3892. private boolean saveWave(byte abyte0[], int i)
  3893. {
  3894. return abyte0 == null || signlink.wavesave(abyte0, i);
  3895. }
  3896.  
  3897. private void method60(int i)
  3898. {
  3899. RSInterface class9 = RSInterface.interfaceCache[i];
  3900. for(int j = 0; j < class9.children.length; j++)
  3901. {
  3902. if(class9.children[j] == -1)
  3903. break;
  3904. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3905. if(class9_1.interfaceType == 1)
  3906. method60(class9_1.id);
  3907. class9_1.animationLength = 0;
  3908. class9_1.animationDelay = 0;
  3909. }
  3910. }
  3911.  
  3912. private void drawHeadIcon()
  3913. {
  3914. if(anInt855 != 2)
  3915. return;
  3916. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  3917. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  3918. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3919. }
  3920. public void processKeyPress()
  3921. {
  3922. try{
  3923. if (super.idleTime == 0)
  3924. {
  3925. if (super.keyArray[0] == 1)
  3926. {
  3927. super.keyArray[0] = 0;
  3928. needDrawTabArea = true;
  3929. tabID = 3;
  3930. tabAreaAltered = true;
  3931. }
  3932. else if (super.keyArray[1008] == 1)
  3933. {
  3934. super.keyArray[1008] = 0;
  3935. needDrawTabArea = true;
  3936. tabID = 0;
  3937. tabAreaAltered = true;
  3938. }
  3939. else if (super.keyArray[1009] == 1)
  3940. {
  3941. super.keyArray[1009] = 0;
  3942. needDrawTabArea = true;
  3943. tabID = 1;
  3944. tabAreaAltered = true;
  3945. }
  3946. else if (super.keyArray[1010] == 1)
  3947. {
  3948. super.keyArray[1010] = 0;
  3949. needDrawTabArea = true;
  3950. tabID = 2;
  3951. tabAreaAltered = true;
  3952. }
  3953. else if (super.keyArray[1011] == 1)
  3954. {
  3955. super.keyArray[1011] = 0;
  3956. needDrawTabArea = true;
  3957. tabID = 4;
  3958. tabAreaAltered = true;
  3959. }
  3960. else if (super.keyArray[1012] == 1)
  3961. {
  3962. super.keyArray[1012] = 0;
  3963. needDrawTabArea = true;
  3964. tabID = 5;
  3965. tabAreaAltered = true;
  3966. }
  3967. else if (super.keyArray[1013] == 1)
  3968. {
  3969. super.keyArray[1013] = 0;
  3970. needDrawTabArea = true;
  3971. tabID = 6;
  3972. tabAreaAltered = true;
  3973. }
  3974. else if (super.keyArray[1014] == 1)
  3975. {
  3976. super.keyArray[1014] = 0;
  3977. needDrawTabArea = true;
  3978. tabID = 7;
  3979. tabAreaAltered = true;
  3980. }
  3981. else if (super.keyArray[1015] == 1)
  3982. {
  3983. super.keyArray[1015] = 0;
  3984. needDrawTabArea = true;
  3985. tabID = 8;
  3986. tabAreaAltered = true;
  3987. }
  3988. else if (super.keyArray[1016] == 1)
  3989. {
  3990. super.keyArray[1016] = 0;
  3991. needDrawTabArea = true;
  3992. tabID = 9;
  3993. tabAreaAltered = true;
  3994. }
  3995. else if (super.keyArray[1017] == 1)
  3996. {
  3997. super.keyArray[1017] = 0;
  3998. needDrawTabArea = true;
  3999. tabID = 10;
  4000. tabAreaAltered = true;
  4001. }
  4002. else if (super.keyArray[1018] == 1)
  4003. {
  4004. super.keyArray[1018] = 0;
  4005. needDrawTabArea = true;
  4006. tabID = 11;
  4007. tabAreaAltered = true;
  4008. }
  4009. else if (super.keyArray[1019] == 1)
  4010. {
  4011. super.keyArray[1019] = 0;
  4012. needDrawTabArea = true;
  4013. tabID = 12;
  4014. tabAreaAltered = true;
  4015. }
  4016. else if (super.keyArray[1020] == 1)
  4017. {
  4018. super.keyArray[1020] = 0;
  4019. needDrawTabArea = true;
  4020. tabID = 13;
  4021. tabAreaAltered = true;
  4022. }
  4023. else if (super.keyArray[1021] == 1)
  4024. {
  4025. super.keyArray[1021] = 0;
  4026. needDrawTabArea = true;
  4027. tabID = 14;
  4028. tabAreaAltered = true;
  4029. }
  4030. else if (super.keyArray[1022] == 1)
  4031. {
  4032. super.keyArray[1022] = 0;
  4033. needDrawTabArea = true;
  4034. tabID = 15;
  4035. tabAreaAltered = true;
  4036. }
  4037. }
  4038. } catch(Exception ex){
  4039. System.out.println("Exception in following, method : processKeyPress()");
  4040. }
  4041. }
  4042.  
  4043. public boolean withinDistance(int x1, int y1, int x2, int y2, int dis)
  4044. {
  4045. for (int i = 0; i <= dis; i++)
  4046. {
  4047. try{
  4048. if ((x1 + i) == x2 && ((y1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  4049. return true;
  4050. else
  4051. if ((x1 - i) == x2 && ((x1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  4052. return true;
  4053. else
  4054. if (x1 == x2 && ((x1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  4055. return true;
  4056. } catch(Exception ex){
  4057. System.out.println("Exception in following, method : WithingDistance");
  4058. }
  4059. }
  4060. return false;
  4061. }
  4062.  
  4063. public int getDis(int coordX1, int coordY1, int coordX2, int coordY2)
  4064. {
  4065. int deltaX = coordX2 - coordX1;
  4066. int deltaY = coordY2 - coordY1;
  4067. return ((int)Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2)));
  4068. }
  4069.  
  4070. public int random(int range)
  4071. {
  4072. return (int)(Math.random() * range);
  4073. }
  4074.  
  4075. public int canWalkDelay = 0;
  4076. private void mainGameProcessor()
  4077. {
  4078. if(anInt1104 > 1)
  4079. anInt1104--;
  4080. if(anInt1011 > 0)
  4081. anInt1011--;
  4082. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  4083. if (anInt1501 < 100) {
  4084. anInt1501++;
  4085. if (anInt1501 == 100) {
  4086. if (anInt1500 != 0) {
  4087. inputTaken = true;
  4088. }
  4089. if (anInt1044 != 0) {
  4090. needDrawTabArea = true;
  4091. }
  4092. }
  4093. }
  4094. } else if (anInt1501 > 0) {
  4095. anInt1501--;
  4096. }
  4097. for(int j = 0; j < 5; j++)
  4098. if(!parsePacket())
  4099. break;
  4100. if(!loggedIn)
  4101. return;
  4102. try{
  4103. canWalkDelay--;
  4104. if (followNPC > 0)
  4105. {
  4106. NPC n = npcArray[followNPC];
  4107. if (n != null)
  4108. {
  4109. if (!withinDistance(myPlayer.smallX[0], myPlayer.smallY[0], n.smallX[0], n.smallY[0], followDistance))
  4110. {
  4111. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, n.smallY[0], myPlayer.smallX[0], false, n.smallX[0]);
  4112. }
  4113. }
  4114. }
  4115. else if (followPlayer > 0 && canWalkDelay <= 0)
  4116. {
  4117. Player p = playerArray[followPlayer];
  4118. if (p != null)
  4119. {
  4120. int dis = getDis(myPlayer.smallX[0], myPlayer.smallY[0], p.smallX[0], p.smallY[0]);
  4121. if (dis > followDistance)
  4122. {
  4123. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], followDistance, 0, p.smallY[0], myPlayer.smallX[0], false, p.smallX[0]);
  4124. canWalkDelay = 30;
  4125. }
  4126. else if (dis == 0)
  4127. {
  4128. int rnd = random(4);
  4129. if (rnd == 0)
  4130. {
  4131. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0], myPlayer.smallX[0], false, p.smallX[0] - 2);
  4132. }
  4133. else if (rnd == 1)
  4134. {
  4135. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0], myPlayer.smallX[0], false, p.smallX[0] + 2);
  4136. }
  4137. else if (rnd == 2)
  4138. {
  4139. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0] - 2, myPlayer.smallX[0], false, p.smallX[0]);
  4140. }
  4141. else if (rnd == 3)
  4142. {
  4143. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0] + 2, myPlayer.smallX[0], false, p.smallX[0]);
  4144. }
  4145. canWalkDelay = 60;
  4146. }
  4147. }
  4148. }
  4149. } catch(Exception ex){
  4150. System.out.println("Exception in following, method : in process.)");
  4151. }
  4152. //processKeyPress(); //may throw exception.
  4153. synchronized(mouseDetection.syncObject)
  4154. {
  4155. if(flagged)
  4156. {
  4157. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  4158. {
  4159. stream.createFrame(45);
  4160. stream.writeWordBigEndian(0);
  4161. int j2 = stream.currentOffset;
  4162. int j3 = 0;
  4163. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  4164. {
  4165. if(j2 - stream.currentOffset >= 240)
  4166. break;
  4167. j3++;
  4168. int l4 = mouseDetection.coordsY[j4];
  4169. if(l4 < 0)
  4170. l4 = 0;
  4171. else
  4172. if(l4 > 502)
  4173. l4 = 502;
  4174. int k5 = mouseDetection.coordsX[j4];
  4175. if(k5 < 0)
  4176. k5 = 0;
  4177. else
  4178. if(k5 > 764)
  4179. k5 = 764;
  4180. int i6 = l4 * 765 + k5;
  4181. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  4182. {
  4183. k5 = -1;
  4184. l4 = -1;
  4185. i6 = 0x7ffff;
  4186. }
  4187. if(k5 == anInt1237 && l4 == anInt1238)
  4188. {
  4189. if(anInt1022 < 2047)
  4190. anInt1022++;
  4191. } else
  4192. {
  4193. int j6 = k5 - anInt1237;
  4194. anInt1237 = k5;
  4195. int k6 = l4 - anInt1238;
  4196. anInt1238 = l4;
  4197. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  4198. {
  4199. j6 += 32;
  4200. k6 += 32;
  4201. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  4202. anInt1022 = 0;
  4203. } else
  4204. if(anInt1022 < 8)
  4205. {
  4206. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  4207. anInt1022 = 0;
  4208. } else
  4209. {
  4210. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  4211. anInt1022 = 0;
  4212. }
  4213. }
  4214. }
  4215.  
  4216. stream.writeBytes(stream.currentOffset - j2);
  4217. if(j3 >= mouseDetection.coordsIndex)
  4218. {
  4219. mouseDetection.coordsIndex = 0;
  4220. } else
  4221. {
  4222. mouseDetection.coordsIndex -= j3;
  4223. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  4224. {
  4225. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  4226. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  4227. }
  4228.  
  4229. }
  4230. }
  4231. } else
  4232. {
  4233. mouseDetection.coordsIndex = 0;
  4234. }
  4235. }
  4236. if(super.clickMode3 != 0)
  4237. {
  4238. long l = (super.aLong29 - aLong1220) / 50L;
  4239. if(l > 4095L)
  4240. l = 4095L;
  4241. aLong1220 = super.aLong29;
  4242. int k2 = super.saveClickY;
  4243. if(k2 < 0)
  4244. k2 = 0;
  4245. else
  4246. if(k2 > 502)
  4247. k2 = 502;
  4248. int k3 = super.saveClickX;
  4249. if(k3 < 0)
  4250. k3 = 0;
  4251. else
  4252. if(k3 > 764)
  4253. k3 = 764;
  4254. int k4 = k2 * 765 + k3;
  4255. int j5 = 0;
  4256. if(super.clickMode3 == 2)
  4257. j5 = 1;
  4258. int l5 = (int)l;
  4259. stream.createFrame(241);
  4260. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  4261. }
  4262. if(anInt1016 > 0)
  4263. anInt1016--;
  4264. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  4265. aBoolean1017 = true;
  4266. if(aBoolean1017 && anInt1016 <= 0)
  4267. {
  4268. anInt1016 = 20;
  4269. aBoolean1017 = false;
  4270. stream.createFrame(86);
  4271. stream.writeWord(anInt1184);
  4272. stream.method432(minimapInt1);
  4273. }
  4274. if(super.awtFocus && !aBoolean954)
  4275. {
  4276. aBoolean954 = true;
  4277. stream.createFrame(3);
  4278. stream.writeWordBigEndian(1);
  4279. }
  4280. if(!super.awtFocus && aBoolean954)
  4281. {
  4282. aBoolean954 = false;
  4283. stream.createFrame(3);
  4284. stream.writeWordBigEndian(0);
  4285. }
  4286. loadingStages();
  4287. method115();
  4288. method90();
  4289. anInt1009++;
  4290. if(anInt1009 > 750)
  4291. dropClient();
  4292. method114();
  4293. method95();
  4294. method38();
  4295.  
  4296. anInt945++;
  4297. if(crossType != 0)
  4298. {
  4299. crossIndex += 20;
  4300. if(crossIndex >= 400)
  4301. crossType = 0;
  4302. }
  4303. if(atInventoryInterfaceType != 0)
  4304. {
  4305. atInventoryLoopCycle++;
  4306. if(atInventoryLoopCycle >= 15)
  4307. {
  4308. if(atInventoryInterfaceType == 2)
  4309. needDrawTabArea = true;
  4310. if(atInventoryInterfaceType == 3)
  4311. inputTaken = true;
  4312. atInventoryInterfaceType = 0;
  4313. }
  4314. }
  4315. if(activeInterfaceType != 0)
  4316. {
  4317. anInt989++;
  4318. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  4319. aBoolean1242 = true;
  4320. if(super.clickMode2 == 0)
  4321. {
  4322. if(activeInterfaceType == 2)
  4323. needDrawTabArea = true;
  4324. if(activeInterfaceType == 3)
  4325. inputTaken = true;
  4326. activeInterfaceType = 0;
  4327. if(aBoolean1242 && anInt989 >= 5)
  4328. {
  4329. lastActiveInvInterface = -1;
  4330. processRightClick();
  4331. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  4332. {
  4333. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  4334. int j1 = 0;
  4335. if(anInt913 == 1 && class9.contentType == 206)
  4336. j1 = 1;
  4337. if(class9.inventory[mouseInvInterfaceIndex] <= 0)
  4338. j1 = 0;
  4339. if(class9.deletesTargetSlot)
  4340. {
  4341. int l2 = anInt1085;
  4342. int l3 = mouseInvInterfaceIndex;
  4343. class9.inventory[l3] = class9.inventory[l2];
  4344. class9.inventoryValue[l3] = class9.inventoryValue[l2];
  4345. class9.inventory[l2] = -1;
  4346. class9.inventoryValue[l2] = 0;
  4347. } else
  4348. if(j1 == 1)
  4349. {
  4350. int i3 = anInt1085;
  4351. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  4352. if(i3 > i4)
  4353. {
  4354. class9.swapInventoryItems(i3, i3 - 1);
  4355. i3--;
  4356. } else
  4357. if(i3 < i4)
  4358. {
  4359. class9.swapInventoryItems(i3, i3 + 1);
  4360. i3++;
  4361. }
  4362.  
  4363. } else
  4364. {
  4365. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  4366. }
  4367. stream.createFrame(214);
  4368. stream.method433(anInt1084);
  4369. stream.method424(j1);
  4370. stream.method433(anInt1085);
  4371. stream.method431(mouseInvInterfaceIndex);
  4372. }
  4373. } else
  4374. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  4375. determineMenuSize();
  4376. else
  4377. if(menuActionRow > 0)
  4378. doAction(menuActionRow - 1);
  4379. atInventoryLoopCycle = 10;
  4380. super.clickMode3 = 0;
  4381. }
  4382. }
  4383. if(WorldController.anInt470 != -1)
  4384. {
  4385. int k = WorldController.anInt470;
  4386. int k1 = WorldController.anInt471;
  4387. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  4388. WorldController.anInt470 = -1;
  4389. if(flag)
  4390. {
  4391. crossX = super.saveClickX;
  4392. crossY = super.saveClickY;
  4393. crossType = 1;
  4394. crossIndex = 0;
  4395. }
  4396. }
  4397. if(super.clickMode3 == 1 && aString844 != null)
  4398. {
  4399. aString844 = null;
  4400. inputTaken = true;
  4401. super.clickMode3 = 0;
  4402. }
  4403. processMenuClick();
  4404. processMainScreenClick();
  4405. processTabClick();
  4406. processChatModeClick();
  4407. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  4408. anInt1213++;
  4409. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  4410. if (anInt1501 < 100) {
  4411. anInt1501++;
  4412. if (anInt1501 == 100) {
  4413. if (anInt1500 != 0) {
  4414. inputTaken = true;
  4415. }
  4416. if (anInt1044 != 0) {
  4417. needDrawTabArea = true;
  4418. }
  4419. }
  4420. }
  4421. } else if (anInt1501 > 0) {
  4422. anInt1501--;
  4423. }
  4424. if(loadingStage == 2)
  4425. method108();
  4426. if(loadingStage == 2 && aBoolean1160)
  4427. calcCameraPos();
  4428. for(int i1 = 0; i1 < 5; i1++)
  4429. anIntArray1030[i1]++;
  4430.  
  4431. method73();
  4432. super.idleTime++;
  4433. if(super.idleTime > 4500)
  4434. {
  4435. anInt1011 = 250;
  4436. super.idleTime -= 500;
  4437. stream.createFrame(202);
  4438. }
  4439. anInt988++;
  4440. if(anInt988 > 500)
  4441. {
  4442. anInt988 = 0;
  4443. int l1 = (int)(Math.random() * 8D);
  4444. if((l1 & 1) == 1)
  4445. anInt1278 += anInt1279;
  4446. if((l1 & 2) == 2)
  4447. anInt1131 += anInt1132;
  4448. if((l1 & 4) == 4)
  4449. anInt896 += anInt897;
  4450. }
  4451. if(anInt1278 < -50)
  4452. anInt1279 = 2;
  4453. if(anInt1278 > 50)
  4454. anInt1279 = -2;
  4455. if(anInt1131 < -55)
  4456. anInt1132 = 2;
  4457. if(anInt1131 > 55)
  4458. anInt1132 = -2;
  4459. if(anInt896 < -40)
  4460. anInt897 = 1;
  4461. if(anInt896 > 40)
  4462. anInt897 = -1;
  4463. anInt1254++;
  4464. if(anInt1254 > 500)
  4465. {
  4466. anInt1254 = 0;
  4467. int i2 = (int)(Math.random() * 8D);
  4468. if((i2 & 1) == 1)
  4469. minimapInt2 += anInt1210;
  4470. if((i2 & 2) == 2)
  4471. minimapInt3 += anInt1171;
  4472. }
  4473. if(minimapInt2 < -60)
  4474. anInt1210 = 2;
  4475. if(minimapInt2 > 60)
  4476. anInt1210 = -2;
  4477. if(minimapInt3 < -20)
  4478. anInt1171 = 1;
  4479. if(minimapInt3 > 10)
  4480. anInt1171 = -1;
  4481. anInt1010++;
  4482. if(anInt1010 > 50)
  4483. stream.createFrame(0);
  4484. try
  4485. {
  4486. if(socketStream != null && stream.currentOffset > 0)
  4487. {
  4488. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  4489. stream.currentOffset = 0;
  4490. anInt1010 = 0;
  4491. }
  4492. } catch(IOException _ex) {
  4493. dropClient();
  4494. } catch(Exception exception) {
  4495. resetLogout();
  4496. }
  4497. }
  4498.  
  4499. private void method63()
  4500. {
  4501. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  4502. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  4503. if(class30_sub1.anInt1294 == -1) {
  4504. class30_sub1.anInt1302 = 0;
  4505. method89(class30_sub1);
  4506. } else {
  4507. class30_sub1.unlink();
  4508. }
  4509.  
  4510. }
  4511.  
  4512. private void resetImageProducers()
  4513. {
  4514. if(aRSImageProducer_1107 != null)
  4515. return;
  4516. super.fullGameScreen = null;
  4517. chatBackImage = null;
  4518. mapBackImage = null;
  4519. inventoryBackImage = null;
  4520. inGameScreen = null;
  4521. //aRSImageProducer_1123 = null;
  4522. aRSImageProducer_1124 = null;
  4523. aRSImageProducer_1125 = null;
  4524.  
  4525. leftSideFlame = new RSImageProducer(128, 265, getGameComponent());
  4526. DrawingArea.setAllPixelsToZero();
  4527. rightSideFlame = new RSImageProducer(128, 265, getGameComponent());
  4528. DrawingArea.setAllPixelsToZero();
  4529. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  4530. DrawingArea.setAllPixelsToZero();
  4531. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  4532. DrawingArea.setAllPixelsToZero();
  4533. if(normalLogin == true) {
  4534. loginScreenArea = new RSImageProducer(360, 200, getGameComponent());
  4535. DrawingArea.setAllPixelsToZero();
  4536. } else if(normalLogin == false) {
  4537. loginScreenArea = new RSImageProducer(765, 503, getGameComponent());
  4538. DrawingArea.setAllPixelsToZero();
  4539. }
  4540. gameLogo = new RSImageProducer(202, 238, getGameComponent());
  4541. DrawingArea.setAllPixelsToZero();
  4542. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  4543. DrawingArea.setAllPixelsToZero();
  4544. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  4545. DrawingArea.setAllPixelsToZero();
  4546. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  4547. DrawingArea.setAllPixelsToZero();
  4548. if(titleStreamLoader != null) {
  4549. drawLogo();
  4550. loadTitleScreen();
  4551. }
  4552. welcomeScreenRaised = true;
  4553. }
  4554.  
  4555. void drawLoadingText(int i, String s) {
  4556. anInt1079 = i;
  4557. super.drawLoadingText(i, s);
  4558. aString1049 = s;
  4559. resetImageProducers();
  4560. if(titleStreamLoader == null) {
  4561. //super.drawLoadingText(i, s);
  4562. return;
  4563. }
  4564. loginScreenArea.initDrawingArea();
  4565. if(normalLogin == true) {
  4566. char c = '\u0168';
  4567. char c1 = '\310';
  4568. byte byte1 = 20;
  4569. chatTextDrawingArea.drawText(0xffffff, "The Client is loading - please wait...", c1 / 2 - 26 - byte1, c / 2);
  4570. int j = c1 / 2 - 18 - byte1;
  4571. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  4572. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  4573. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  4574. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  4575. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  4576. loginScreenArea.drawGraphics(171, super.graphics, 202);
  4577. if(welcomeScreenRaised)
  4578. {
  4579. welcomeScreenRaised = false;
  4580. if(!aBoolean831)
  4581. {
  4582. leftSideFlame.drawGraphics(0, super.graphics, 0);
  4583. rightSideFlame.drawGraphics(0, super.graphics, 637);
  4584. }
  4585. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  4586. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  4587. gameLogo.drawGraphics(265, super.graphics, 0);
  4588. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  4589. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  4590. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  4591. }
  4592. } else if(normalLogin == false) {
  4593. int totWidth = 765;
  4594. int totHeight = 503;
  4595. int barWidth = 350;
  4596. int barHeight = 30;
  4597. int lpMax = (i * barWidth) / 100;
  4598. if(lpMax > barWidth) {
  4599. lpMax = barWidth;
  4600. }
  4601. LEmpty.drawSprite(200, 220);
  4602. LFull = new Sprite("Login/Random/LFull.png", lpMax, barHeight);
  4603. LFull.drawSprite(200, 220);
  4604. loginScreenArea.drawGraphics(0, super.graphics, 0);
  4605. }
  4606. }
  4607.  
  4608. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  4609. int j1)
  4610. {
  4611. int anInt992;
  4612. if(aBoolean972)
  4613. anInt992 = 32;
  4614. else
  4615. anInt992 = 0;
  4616. aBoolean972 = false;
  4617. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  4618. {
  4619. class9.scrollPosition -= anInt1213 * 4;
  4620. if(flag)
  4621. {
  4622. needDrawTabArea = true;
  4623. }
  4624. } else
  4625. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  4626. {
  4627. class9.scrollPosition += anInt1213 * 4;
  4628. if(flag)
  4629. {
  4630. needDrawTabArea = true;
  4631. }
  4632. } else
  4633. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  4634. {
  4635. int l1 = ((j - 32) * j) / j1;
  4636. if(l1 < 8)
  4637. l1 = 8;
  4638. int i2 = l - i1 - 16 - l1 / 2;
  4639. int j2 = j - 32 - l1;
  4640. class9.scrollPosition = ((j1 - j) * i2) / j2;
  4641. if(flag)
  4642. needDrawTabArea = true;
  4643. aBoolean972 = true;
  4644. }
  4645. }
  4646.  
  4647. private boolean method66(int i, int j, int k)
  4648. {
  4649. int i1 = i >> 14 & 0x7fff;
  4650. int j1 = worldController.method304(plane, k, j, i);
  4651. if(j1 == -1)
  4652. return false;
  4653. int k1 = j1 & 0x1f;
  4654. int l1 = j1 >> 6 & 3;
  4655. if(k1 == 10 || k1 == 11 || k1 == 22)
  4656. {
  4657. ObjectDef class46 = ObjectDef.forID(i1);
  4658. int i2;
  4659. int j2;
  4660. if(l1 == 0 || l1 == 2)
  4661. {
  4662. i2 = class46.anInt744;
  4663. j2 = class46.anInt761;
  4664. } else
  4665. {
  4666. i2 = class46.anInt761;
  4667. j2 = class46.anInt744;
  4668. }
  4669. int k2 = class46.anInt768;
  4670. if(l1 != 0)
  4671. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  4672. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  4673. } else
  4674. {
  4675. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  4676. }
  4677. crossX = super.saveClickX;
  4678. crossY = super.saveClickY;
  4679. crossType = 2;
  4680. crossIndex = 0;
  4681. return true;
  4682. }
  4683.  
  4684. private NamedArchive streamLoaderForName(int i, String s, String s1, int j, int k)
  4685. {
  4686. byte abyte0[] = null;
  4687. int l = 5;
  4688. try
  4689. {
  4690. if(decompressors[0] != null) {
  4691. abyte0 = decompressors[0].decompress(i);
  4692. }
  4693. if(abyte0 == null)
  4694. {
  4695. drawLoadingText(0, "Connecting to File Server...");
  4696. //new Update("http://72.8.134.108/474/cache.zip", "cache.zip", signlink.findcachedir());
  4697. abyte0 = decompressors[0].decompress(i);
  4698. }
  4699. } catch (Exception e) {
  4700. e.printStackTrace();
  4701. }
  4702. if(abyte0 != null)
  4703. {
  4704. NamedArchive archive = new NamedArchive(abyte0, s);
  4705. return archive;
  4706. }
  4707. while (true) {
  4708. drawLoadingText(0, "Error loading... Please report!");
  4709. try {
  4710. Thread.sleep(1000);
  4711. } catch (Exception e) {
  4712. e.printStackTrace();
  4713. }
  4714. }
  4715. }
  4716.  
  4717. private void dropClient()
  4718. {
  4719. if(anInt1011 > 0)
  4720. {
  4721. resetLogout();
  4722. return;
  4723. }
  4724. inGameScreen.initDrawingArea();
  4725.  
  4726. aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
  4727. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
  4728. aTextDrawingArea_1271.drawText(0, "Please wait - attempting to reestablish", 159, 257);
  4729. aTextDrawingArea_1271.drawText(0xffffff, "Please wait - attempting to reestablish", 158, 256);
  4730.  
  4731. inGameScreen.drawGraphics(4, super.graphics, 4);
  4732. anInt1021 = 0;
  4733. destX = 0;
  4734. RSSocket rsSocket = socketStream;
  4735. loggedIn = false;
  4736. loginFailures = 0;
  4737. login(capitalize(myUsername), myPassword, true);
  4738. if(!loggedIn)
  4739. resetLogout();
  4740. try
  4741. {
  4742. rsSocket.close();
  4743. }
  4744. catch(Exception _ex)
  4745. {
  4746. }
  4747. }
  4748.  
  4749. private void doAction(int i)
  4750. {
  4751. if(i < 0)
  4752. return;
  4753. if(inputDialogState != 0)
  4754. {
  4755. inputDialogState = 0;
  4756. inputTaken = true;
  4757. }
  4758. int j = menuActionCmd2[i];
  4759. int k = menuActionCmd3[i];
  4760. int l = menuActionID[i];
  4761. int i1 = menuActionCmd1[i];
  4762. if(l >= 2000)
  4763. l -= 2000;
  4764. if(l == 582)
  4765. {
  4766. NPC npc = npcArray[i1];
  4767. if(npc != null)
  4768. {
  4769. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  4770. crossX = super.saveClickX;
  4771. crossY = super.saveClickY;
  4772. crossType = 2;
  4773. crossIndex = 0;
  4774. stream.createFrame(57);
  4775. stream.method432(anInt1285);
  4776. stream.method432(i1);
  4777. stream.method431(anInt1283);
  4778. stream.method432(anInt1284);
  4779. }
  4780. }
  4781. if(l == 234)
  4782. {
  4783. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4784. if(!flag1)
  4785. flag1 = 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(236);
  4791. stream.method431(k + baseY);
  4792. stream.writeWord(i1);
  4793. stream.method431(j + baseX);
  4794. }
  4795. if(l == 62 && method66(i1, k, j))
  4796. {
  4797. stream.createFrame(192);
  4798. stream.writeWord(anInt1284);
  4799. stream.method431(i1 >> 14 & 0x7fff);
  4800. stream.method433(k + baseY);
  4801. stream.method431(anInt1283);
  4802. stream.method433(j + baseX);
  4803. stream.writeWord(anInt1285);
  4804. }
  4805. if(l == 511)
  4806. {
  4807. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4808. if(!flag2)
  4809. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4810. crossX = super.saveClickX;
  4811. crossY = super.saveClickY;
  4812. crossType = 2;
  4813. crossIndex = 0;
  4814. stream.createFrame(25);
  4815. stream.method431(anInt1284);
  4816. stream.method432(anInt1285);
  4817. stream.writeWord(i1);
  4818. stream.method432(k + baseY);
  4819. stream.method433(anInt1283);
  4820. stream.writeWord(j + baseX);
  4821. }
  4822. if(l == 74)
  4823. {
  4824. stream.createFrame(122);
  4825. stream.method433(k);
  4826. stream.method432(j);
  4827. stream.method431(i1);
  4828. atInventoryLoopCycle = 0;
  4829. atInventoryInterface = k;
  4830. atInventoryIndex = j;
  4831. atInventoryInterfaceType = 2;
  4832. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4833. atInventoryInterfaceType = 1;
  4834. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4835. atInventoryInterfaceType = 3;
  4836. }
  4837. if(is480 || is508 || is525) {
  4838. switch(l){
  4839. case 1014: setTab(13); setSidebarInterface(13, 29500); break;//harp
  4840. case 1013: setTab(12); setSidebarInterface(12, 147); break;//emotes
  4841. case 1012: setTab(11); setSidebarInterface(11, 904); break;//options
  4842. case 1010: setTab(9); setSidebarInterface(9, 5715); break;//ignore
  4843. case 1009: setTab(8); setSidebarInterface(8, 5065); break;//friend
  4844. case 1027: setTab(6); break;//spellbook
  4845. case 1026: setTab(5); /*setSidebarInterface(5, 5608);*/ break;//prayer
  4846. case 1030: setTab(4); setSidebarInterface(4, 1644); break;//worn
  4847. case 1024: setTab(3); setSidebarInterface(3, 3213); break;//inventory
  4848. case 1023: setTab(2); setSidebarInterface(2, 638); break;//quests
  4849. case 1022: setTab(1); setSidebarInterface(1, 3917); break;//stats
  4850. case 1021: setTab(0); break;//style
  4851. case 1008: setTab(10); setSidebarInterface(10, 18128); break;//logout new clan
  4852. case 1011: setTab(14); setSidebarInterface(14, 2449); break;//logout
  4853. case 1502: setTab(7); setSidebarInterface(7, 2449); break;//clan
  4854. }
  4855. } else {
  4856. switch(l){
  4857. case 1014: setTab(13); setSidebarInterface(13, 29500); break;//harp
  4858. case 1013: setTab(12); setSidebarInterface(12, 147); break;//emotes
  4859. case 1012: setTab(11); setSidebarInterface(11, 904); break;//options
  4860. case 1010: setTab(9); setSidebarInterface(9, 5715); break;//ignore
  4861. case 1009: setTab(8); setSidebarInterface(8, 5065); break;//friend
  4862. case 1027: setTab(6); break;//spellbook
  4863. case 1026: setTab(5); /*setSidebarInterface(5, 5608);*/ break;//prayer
  4864. case 1030: setTab(4); setSidebarInterface(4, 1644); break;//worn
  4865. case 1024: setTab(3); setSidebarInterface(3, 3213); break;//inventory
  4866. case 1023: setTab(2); setSidebarInterface(2, 638); break;//quests
  4867. case 1022: setTab(1); setSidebarInterface(1, 3917); break;//stats
  4868. case 1021: setTab(0); break;//style
  4869. case 1008: setTab(7); setSidebarInterface(7, 18128); break;
  4870. case 1011: setTab(10); setSidebarInterface(10, 2449); break;
  4871. }
  4872. }
  4873. switch(l){
  4874. case 1050:
  4875. runState = 1;
  4876. if(!runClicked) {
  4877. runClicked = true;
  4878. musicOrb = false;
  4879. restOrb = false;
  4880. stream.createFrame(185);
  4881. stream.writeWord(153);
  4882. } else {
  4883. runClicked = false;
  4884. stream.createFrame(185);
  4885. stream.writeWord(152);
  4886. }
  4887. break;
  4888. case 1500:
  4889. if(!prayClicked){
  4890. prayClicked = true;
  4891. } else {
  4892. prayClicked = false;
  4893. }
  4894. break;
  4895. }
  4896. if (l == 315) {
  4897. System.out.println("sendPacket185("+k+")");
  4898. RSInterface class9 = RSInterface.interfaceCache[k];
  4899. boolean flag8 = true;
  4900. if (class9.contentType > 0)
  4901. flag8 = promptUserForInput(class9);
  4902. if (flag8) {
  4903.  
  4904. switch(k){
  4905. case 19144:
  4906. sendFrame248(15106,3213);
  4907. method60(15106);
  4908. inputTaken = true;
  4909. break;
  4910. case 27615:
  4911. setSidebarInterface(4, 1644);
  4912. break;
  4913. case 25843://arrow
  4914. setSidebarInterface(11, 24500);
  4915. break;
  4916. case 27610://return
  4917. setSidebarInterface(11, 904);
  4918. break;
  4919. case 27508://hp
  4920. sendFrame126("Off", 27528);
  4921. if (hitbarToggle) {
  4922. hitbarToggle = false;
  4923. sendFrame126("Off", 27528); sendFrame126("", 27524);
  4924. } else {
  4925. hitbarToggle = true;
  4926. sendFrame126("On", 27524); sendFrame126("", 27528);
  4927. }
  4928. break;
  4929. case 27509://menu
  4930. sendFrame126("Off", 27529);
  4931. if (menuToggle) {
  4932. menuToggle = false;
  4933. sendFrame126("Off", 27529); sendFrame126("", 27525);
  4934. } else {
  4935. menuToggle = true;
  4936. sendFrame126("On", 27525); sendFrame126("", 27529);
  4937. }
  4938. break;
  4939. case 27510://names
  4940. sendFrame126("@yel@Yellow", 27530);
  4941. /*if(tabby == 0){
  4942. tabClicked = new Sprite("Gameframe/SIcons/562/tabclicked1");
  4943. tabby = 1;
  4944. } else {
  4945. tabClicked = new Sprite("Gameframe/SIcons/562/tabclicked2");
  4946. tabby = 0;
  4947. }*/
  4948. if(tColour == 0 || tColour == -1){
  4949. tColour = 1;
  4950. sendFrame126("@gre@Green", 27526); sendFrame126("", 27530);
  4951. } else if(tColour == 1)
  4952. {
  4953. tColour = 2;
  4954. sendFrame126("@whi@White", 27526); sendFrame126("", 27530);
  4955. } else if(tColour == 2)
  4956. {
  4957. sendFrame126("@red@Red", 27526); sendFrame126("", 27530);
  4958. tColour = 3;
  4959. }
  4960. else if(tColour == 3)
  4961. {
  4962. sendFrame126("@yel@Yellow", 27526); sendFrame126("", 27530);
  4963. tColour = 0;
  4964. }
  4965. /*
  4966. if (namesToggle) {
  4967. namesToggle = false;
  4968. sendFrame126("Off", 27530); sendFrame126("", 27526);
  4969. } else {
  4970. namesToggle = true;
  4971. sendFrame126("On", 27526); sendFrame126("", 27530);
  4972. }*/
  4973. break;
  4974. case 27532://gameframe
  4975. sendFrame126("@whi@None", 27531);
  4976. if(tEffect == 0){
  4977. tEffect = 1;
  4978. sendFrame126("@lre@Wave", 27531);
  4979. } else if(tEffect == 1)
  4980. {
  4981. tEffect = 2;
  4982. sendFrame126("@lre@Shake", 27531);
  4983. } else if(tEffect == 2)
  4984. {
  4985. sendFrame126("@lre@Slide", 27531);
  4986. tEffect = 3;
  4987. }
  4988. else if(tEffect == 3)
  4989. {
  4990. sendFrame126("@whi@None", 27531);
  4991. tEffect = 0;
  4992. }
  4993. break;
  4994. case 27606://x10
  4995. sendFrame126("Off", 27605);
  4996. if (newDamage) {
  4997. newDamage = false;
  4998. sendFrame126("Off", 27605);
  4999. sendFrame126("", 27604);
  5000. } else {
  5001. newDamage = true;
  5002. sendFrame126("On", 27604);
  5003. sendFrame126("", 27605);
  5004. }
  5005. break;
  5006. case 27521://hitmarks
  5007. sendFrame126("Off", 27603);
  5008. if (hitmarks) {
  5009. hitmarks = false;
  5010. sendFrame126("Off", 27603);
  5011. sendFrame126("", 27602);
  5012. } else {
  5013. hitmarks = true;
  5014. sendFrame126("On", 27602);
  5015. sendFrame126("", 27603);
  5016. }
  5017. break;
  5018. case 29156://achievement
  5019. setSidebarInterface(2, 29265);
  5020. break;
  5021. case 29267://Quest
  5022. setSidebarInterface(2, 638);
  5023. break;
  5024.  
  5025. default:
  5026. stream.createFrame(185);
  5027. stream.writeWord(k);
  5028. break;
  5029.  
  5030. }
  5031. }
  5032. }
  5033. if(l == 561)
  5034. {
  5035. Player player = playerArray[i1];
  5036. if(player != null)
  5037. {
  5038. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  5039. crossX = super.saveClickX;
  5040. crossY = super.saveClickY;
  5041. crossType = 2;
  5042. crossIndex = 0;
  5043. anInt1188 += i1;
  5044. if(anInt1188 >= 90)
  5045. {
  5046. stream.createFrame(136);
  5047. anInt1188 = 0;
  5048. }
  5049. stream.createFrame(128);
  5050. stream.writeWord(i1);
  5051. }
  5052. }
  5053. if(l == 20)
  5054. {
  5055. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  5056. if(class30_sub2_sub4_sub1_sub1_1 != null)
  5057. {
  5058. 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]);
  5059. crossX = super.saveClickX;
  5060. crossY = super.saveClickY;
  5061. crossType = 2;
  5062. crossIndex = 0;
  5063. stream.createFrame(155);
  5064. stream.method431(i1);
  5065. }
  5066. }
  5067. if(l == 779)
  5068. {
  5069. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  5070. if(class30_sub2_sub4_sub1_sub2_1 != null)
  5071. {
  5072. 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]);
  5073. crossX = super.saveClickX;
  5074. crossY = super.saveClickY;
  5075. crossType = 2;
  5076. crossIndex = 0;
  5077. stream.createFrame(153);
  5078. stream.method431(i1);
  5079. }
  5080. }
  5081. if(l == 516)
  5082. if(!menuOpen)
  5083. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  5084. else
  5085. worldController.method312(k - 4, j - 4);
  5086. if(l == 1062)
  5087. {
  5088. anInt924 += baseX;
  5089. if(anInt924 >= 113)
  5090. {
  5091. stream.createFrame(183);
  5092. stream.writeDWordBigEndian(0xe63271);
  5093. anInt924 = 0;
  5094. }
  5095. method66(i1, k, j);
  5096. stream.createFrame(228);
  5097. stream.method432(i1 >> 14 & 0x7fff);
  5098. stream.method432(k + baseY);
  5099. stream.writeWord(j + baseX);
  5100. }
  5101. if(l == 679 && !aBoolean1149)
  5102. {
  5103. stream.createFrame(40);
  5104. stream.writeWord(k);
  5105. aBoolean1149 = true;
  5106. }
  5107. if(l == 431)
  5108. {
  5109. stream.createFrame(129);
  5110. stream.method432(j);
  5111. stream.writeWord(k);
  5112. stream.method432(i1);
  5113. atInventoryLoopCycle = 0;
  5114. atInventoryInterface = k;
  5115. atInventoryIndex = j;
  5116. atInventoryInterfaceType = 2;
  5117. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5118. atInventoryInterfaceType = 1;
  5119. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5120. atInventoryInterfaceType = 3;
  5121. }
  5122. if(l == 337 || l == 42 || l == 792 || l == 322)
  5123. {
  5124. String s = menuActionName[i];
  5125. int k1 = s.indexOf("@whi@");
  5126. if(k1 != -1)
  5127. {
  5128. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  5129. if(l == 337)
  5130. addFriend(l3);
  5131. if(l == 42)
  5132. addIgnore(l3);
  5133. if(l == 792)
  5134. delFriend(l3);
  5135. if(l == 322)
  5136. delIgnore(l3);
  5137. }
  5138. }
  5139. if(l == 53)
  5140. {
  5141. stream.createFrame(135);
  5142. stream.method431(j);
  5143. stream.method432(k);
  5144. stream.method431(i1);
  5145. atInventoryLoopCycle = 0;
  5146. atInventoryInterface = k;
  5147. atInventoryIndex = j;
  5148. atInventoryInterfaceType = 2;
  5149. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5150. atInventoryInterfaceType = 1;
  5151. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5152. atInventoryInterfaceType = 3;
  5153. }
  5154. if(l == 539)
  5155. {
  5156. stream.createFrame(16);
  5157. stream.method432(i1);
  5158. stream.method433(j);
  5159. stream.method433(k);
  5160. atInventoryLoopCycle = 0;
  5161. atInventoryInterface = k;
  5162. atInventoryIndex = j;
  5163. atInventoryInterfaceType = 2;
  5164. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5165. atInventoryInterfaceType = 1;
  5166. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5167. atInventoryInterfaceType = 3;
  5168. }
  5169. if(l == 927) {
  5170. String s1 = menuActionName[i];
  5171. int l1 = s1.indexOf("@lre@");
  5172. s1 = s1.substring(l1 + 5).trim();
  5173. launchURL(s1);//Launches the URL in a web browser when clicked
  5174. }
  5175. if(l == 484 || l == 6)
  5176. {
  5177. String s1 = menuActionName[i];
  5178. int l1 = s1.indexOf("@whi@");
  5179. if(l1 != -1)
  5180. {
  5181. s1 = s1.substring(l1 + 5).trim();
  5182. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  5183. boolean flag9 = false;
  5184. for(int j3 = 0; j3 < playerCount; j3++)
  5185. {
  5186. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  5187. 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))
  5188. continue;
  5189. 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]);
  5190. if(l == 484)
  5191. {
  5192. stream.createFrame(139);
  5193. stream.method431(playerIndices[j3]);
  5194. }
  5195. if(l == 6)
  5196. {
  5197. anInt1188 += i1;
  5198. if(anInt1188 >= 90)
  5199. {
  5200. stream.createFrame(136);
  5201. anInt1188 = 0;
  5202. }
  5203. stream.createFrame(128);
  5204. stream.writeWord(playerIndices[j3]);
  5205. }
  5206. flag9 = true;
  5207. break;
  5208. }
  5209.  
  5210. if(!flag9)
  5211. pushMessage("Unable to find " + s7, 0, "");
  5212. }
  5213. }
  5214. if(l == 870)
  5215. {
  5216. stream.createFrame(53);
  5217. stream.writeWord(j);
  5218. stream.method432(anInt1283);
  5219. stream.method433(i1);
  5220. stream.writeWord(anInt1284);
  5221. stream.method431(anInt1285);
  5222. stream.writeWord(k);
  5223. atInventoryLoopCycle = 0;
  5224. atInventoryInterface = k;
  5225. atInventoryIndex = j;
  5226. atInventoryInterfaceType = 2;
  5227. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5228. atInventoryInterfaceType = 1;
  5229. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5230. atInventoryInterfaceType = 3;
  5231. }
  5232. if(l == 847)
  5233. {
  5234. stream.createFrame(87);
  5235. stream.method432(i1);
  5236. stream.writeWord(k);
  5237. stream.method432(j);
  5238. atInventoryLoopCycle = 0;
  5239. atInventoryInterface = k;
  5240. atInventoryIndex = j;
  5241. atInventoryInterfaceType = 2;
  5242. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5243. atInventoryInterfaceType = 1;
  5244. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5245. atInventoryInterfaceType = 3;
  5246. }
  5247. if(l == 626)
  5248. {
  5249. RSInterface class9_1 = RSInterface.interfaceCache[k];
  5250. spellSelected = 1;
  5251. spellID = class9_1.id;
  5252. anInt1137 = k;
  5253. spellUsableOn = class9_1.spellUsableOn;
  5254. itemSelected = 0;
  5255. needDrawTabArea = true;
  5256. spellID = class9_1.id;
  5257. String s4 = class9_1.selectedActionName;
  5258. if(s4.indexOf(" ") != -1)
  5259. s4 = s4.substring(0, s4.indexOf(" "));
  5260. String s8 = class9_1.selectedActionName;
  5261. if(s8.indexOf(" ") != -1)
  5262. s8 = s8.substring(s8.indexOf(" ") + 1);
  5263. if(s8.equals("on")) s8 = "@whi@->";
  5264. spellTooltip = s4 + " " + "@gre@" + class9_1.spellName + " " + s8;
  5265.  
  5266. //spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  5267. //class9_1.disabledSprite.drawSprite(class9_1.xOffset, class9_1.yOffset, 0xffffff);
  5268. //class9_1.disabledSprite.drawSprite(200,200);
  5269. //System.out.println("Sprite: " + class9_1.disabledSprite.toString());
  5270. if(spellUsableOn == 16)
  5271. {
  5272. needDrawTabArea = true;
  5273. tabID = 3;
  5274. tabAreaAltered = true;
  5275. }
  5276. return;
  5277. }
  5278. if(l == 78)
  5279. {
  5280. stream.createFrame(117);
  5281. stream.method433(k);
  5282. stream.method433(i1);
  5283. stream.method431(j);
  5284. atInventoryLoopCycle = 0;
  5285. atInventoryInterface = k;
  5286. atInventoryIndex = j;
  5287. atInventoryInterfaceType = 2;
  5288. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5289. atInventoryInterfaceType = 1;
  5290. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5291. atInventoryInterfaceType = 3;
  5292. }
  5293. if(l == 27)
  5294. {
  5295. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  5296. if(class30_sub2_sub4_sub1_sub2_2 != null)
  5297. {
  5298. 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]);
  5299. crossX = super.saveClickX;
  5300. crossY = super.saveClickY;
  5301. crossType = 2;
  5302. crossIndex = 0;
  5303. anInt986 += i1;
  5304. if(anInt986 >= 54 || loginPackets[1] != 10)
  5305. {
  5306. loginPackets[1] = 10;
  5307. stream.createFrame(189);
  5308. stream.writeWordBigEndian(455);
  5309. anInt986 = 0;
  5310. }
  5311. stream.createFrame(73);
  5312. stream.method431(i1);
  5313. }
  5314. }
  5315. if(l == 213)
  5316. {
  5317. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5318. if(!flag3)
  5319. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5320. crossX = super.saveClickX;
  5321. crossY = super.saveClickY;
  5322. crossType = 2;
  5323. crossIndex = 0;
  5324. stream.createFrame(79);
  5325. stream.method431(k + baseY);
  5326. stream.writeWord(i1);
  5327. stream.method432(j + baseX);
  5328. }
  5329. if(l == 632)
  5330. {
  5331. stream.createFrame(145);
  5332. stream.method432(k);
  5333. stream.method432(j);
  5334. stream.method432(i1);
  5335. atInventoryLoopCycle = 0;
  5336. atInventoryInterface = k;
  5337. atInventoryIndex = j;
  5338. atInventoryInterfaceType = 2;
  5339. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5340. atInventoryInterfaceType = 1;
  5341. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5342. atInventoryInterfaceType = 3;
  5343. }
  5344. if(l == 1005) {
  5345. launchURL("www.pk-forever.com/vote.php");
  5346. pushMessage("Thanks for Voting!", 0, "");
  5347. }
  5348. if(l == 1004) {
  5349. if(tabInterfaceIDs[10] != -1) {
  5350. needDrawTabArea = true;
  5351. tabID = 10;
  5352. tabAreaAltered = true;
  5353. }
  5354. }
  5355. if(l == 1003) {
  5356. clanChatMode = 2;
  5357. aBoolean1233 = true;
  5358. inputTaken = true;
  5359. }
  5360. if(l == 1002) {
  5361. clanChatMode = 1;
  5362. aBoolean1233 = true;
  5363. inputTaken = true;
  5364. }
  5365. if(l == 1001) {
  5366. clanChatMode = 0;
  5367. aBoolean1233 = true;
  5368. inputTaken = true;
  5369. }
  5370. if(l == 1000) {
  5371. cButtonCPos = 4;
  5372. chatTypeView = 11;
  5373. aBoolean1233 = true;
  5374. inputTaken = true;
  5375. }
  5376. if(l == 999) {
  5377. cButtonCPos = 0;
  5378. chatTypeView = 0;
  5379. aBoolean1233 = true;
  5380. inputTaken = true;
  5381. }
  5382. if(l == 998) {
  5383. cButtonCPos = 1;
  5384. chatTypeView = 5;
  5385. aBoolean1233 = true;
  5386. inputTaken = true;
  5387. }
  5388. if(l == 997) {
  5389. publicChatMode = 3;
  5390. aBoolean1233 = true;
  5391. inputTaken = true;
  5392. }
  5393. if(l == 996) {
  5394. publicChatMode = 2;
  5395. aBoolean1233 = true;
  5396. inputTaken = true;
  5397. }
  5398. if(l == 995) {
  5399. publicChatMode = 1;
  5400. aBoolean1233 = true;
  5401. inputTaken = true;
  5402. }
  5403. if(l == 994) {
  5404. publicChatMode = 0;
  5405. aBoolean1233 = true;
  5406. inputTaken = true;
  5407. }
  5408. if(l == 993) {
  5409. cButtonCPos = 2;
  5410. chatTypeView = 1;
  5411. aBoolean1233 = true;
  5412. inputTaken = true;
  5413. }
  5414. if(l == 992) {
  5415. privateChatMode = 2;
  5416. aBoolean1233 = true;
  5417. inputTaken = true;
  5418. }
  5419. if(l == 991) {
  5420. privateChatMode = 1;
  5421. aBoolean1233 = true;
  5422. inputTaken = true;
  5423. }
  5424. if(l == 990) {
  5425. privateChatMode = 0;
  5426. aBoolean1233 = true;
  5427. inputTaken = true;
  5428. }
  5429. if(l == 989) {
  5430. cButtonCPos = 3;
  5431. chatTypeView = 2;
  5432. aBoolean1233 = true;
  5433. inputTaken = true;
  5434. }
  5435. if(l == 987) {
  5436. tradeMode = 2;
  5437. aBoolean1233 = true;
  5438. inputTaken = true;
  5439. }
  5440. if(l == 986) {
  5441. tradeMode = 1;
  5442. aBoolean1233 = true;
  5443. inputTaken = true;
  5444. }
  5445. if(l == 985) {
  5446. tradeMode = 0;
  5447. aBoolean1233 = true;
  5448. inputTaken = true;
  5449. }
  5450. if(l == 984) {
  5451. cButtonCPos = 5;
  5452. chatTypeView = 3;
  5453. aBoolean1233 = true;
  5454. inputTaken = true;
  5455. }
  5456. if(l == 983) {
  5457. duelMode = 2;
  5458. aBoolean1233 = true;
  5459. inputTaken = true;
  5460. }
  5461. if(l == 982) {
  5462. duelMode = 1;
  5463. aBoolean1233 = true;
  5464. inputTaken = true;
  5465. }
  5466. if(l == 981) {
  5467. duelMode = 0;
  5468. aBoolean1233 = true;
  5469. inputTaken = true;
  5470. }
  5471. if(l == 980) {
  5472. cButtonCPos = 6;
  5473. chatTypeView = 4;
  5474. aBoolean1233 = true;
  5475. inputTaken = true;
  5476. }
  5477. if(l == 493)
  5478. {
  5479. stream.createFrame(75);
  5480. stream.method433(k);
  5481. stream.method431(j);
  5482. stream.method432(i1);
  5483. atInventoryLoopCycle = 0;
  5484. atInventoryInterface = k;
  5485. atInventoryIndex = j;
  5486. atInventoryInterfaceType = 2;
  5487. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5488. atInventoryInterfaceType = 1;
  5489. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5490. atInventoryInterfaceType = 3;
  5491. }
  5492. if(l == 652)
  5493. {
  5494. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5495. if(!flag4)
  5496. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5497. crossX = super.saveClickX;
  5498. crossY = super.saveClickY;
  5499. crossType = 2;
  5500. crossIndex = 0;
  5501. stream.createFrame(156);
  5502. stream.method432(j + baseX);
  5503. stream.method431(k + baseY);
  5504. stream.method433(i1);
  5505. }
  5506. if(l == 94)
  5507. {
  5508. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5509. if(!flag5)
  5510. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5511. crossX = super.saveClickX;
  5512. crossY = super.saveClickY;
  5513. crossType = 2;
  5514. crossIndex = 0;
  5515. stream.createFrame(181);
  5516. stream.method431(k + baseY);
  5517. stream.writeWord(i1);
  5518. stream.method431(j + baseX);
  5519. stream.method432(anInt1137);
  5520. }
  5521. if(l == 646)
  5522. {
  5523. stream.createFrame(185);
  5524. stream.writeWord(k);
  5525. RSInterface class9_2 = RSInterface.interfaceCache[k];
  5526. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  5527. {
  5528. int i2 = class9_2.valueIndexArray[0][1];
  5529. if(variousSettings[i2] != class9_2.requiredValues[0])
  5530. {
  5531. variousSettings[i2] = class9_2.requiredValues[0];
  5532. method33(i2);
  5533. needDrawTabArea = true;
  5534. }
  5535. }
  5536. }
  5537. if(l == 225)
  5538. {
  5539. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  5540. if(class30_sub2_sub4_sub1_sub1_2 != null)
  5541. {
  5542. 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]);
  5543. crossX = super.saveClickX;
  5544. crossY = super.saveClickY;
  5545. crossType = 2;
  5546. crossIndex = 0;
  5547. anInt1226 += i1;
  5548. if(anInt1226 >= 85 || loginPackets[0] != 10)
  5549. {
  5550. loginPackets[0] = 10;
  5551. stream.createFrame(230);
  5552. stream.writeWordBigEndian(239);
  5553. anInt1226 = 0;
  5554. }
  5555. stream.createFrame(17);
  5556. stream.method433(i1);
  5557. }
  5558. }
  5559. if(l == 965)
  5560. {
  5561. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  5562. if(class30_sub2_sub4_sub1_sub1_3 != null)
  5563. {
  5564. 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]);
  5565. crossX = super.saveClickX;
  5566. crossY = super.saveClickY;
  5567. crossType = 2;
  5568. crossIndex = 0;
  5569. anInt1134++;
  5570. if(anInt1134 >= 96 || loginPackets[2] != 10)
  5571. {
  5572. stream.createFrame(152);
  5573. stream.writeWordBigEndian(88);
  5574. anInt1134 = 0;
  5575. loginPackets[2] = 10;
  5576. }
  5577. stream.createFrame(21);
  5578. stream.writeWord(i1);
  5579. }
  5580. }
  5581. if(l == 413)
  5582. {
  5583. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  5584. if(class30_sub2_sub4_sub1_sub1_4 != null)
  5585. {
  5586. 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]);
  5587. crossX = super.saveClickX;
  5588. crossY = super.saveClickY;
  5589. crossType = 2;
  5590. crossIndex = 0;
  5591. stream.createFrame(131);
  5592. stream.method433(i1);
  5593. stream.method432(anInt1137);
  5594. }
  5595. }
  5596. if(l == 200)
  5597. clearTopInterfaces();
  5598. if(l == 1025)
  5599. {
  5600. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  5601. if(class30_sub2_sub4_sub1_sub1_5 != null)
  5602. {
  5603. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  5604. if(entityDef.childrenIDs != null)
  5605. entityDef = entityDef.method161();
  5606. if(entityDef != null)
  5607. {
  5608. String s9;
  5609. if(entityDef.description != null)
  5610. s9 = new String(entityDef.description);
  5611. else
  5612. s9 = "It's a " + entityDef.name + ".";
  5613. pushMessage(s9, 0, "");
  5614. }
  5615. }
  5616. }
  5617. if(l == 900)
  5618. {
  5619. method66(i1, k, j);
  5620. stream.createFrame(252);
  5621. stream.method433(i1 >> 14 & 0x7fff);
  5622. stream.method431(k + baseY);
  5623. stream.method432(j + baseX);
  5624. }
  5625. if(l == 412)
  5626. {
  5627. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  5628. if(class30_sub2_sub4_sub1_sub1_6 != null)
  5629. {
  5630. 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]);
  5631. crossX = super.saveClickX;
  5632. crossY = super.saveClickY;
  5633. crossType = 2;
  5634. crossIndex = 0;
  5635. stream.createFrame(72);
  5636. stream.method432(i1);
  5637. }
  5638. }
  5639. if(l == 365)
  5640. {
  5641. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  5642. if(class30_sub2_sub4_sub1_sub2_3 != null)
  5643. {
  5644. 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]);
  5645. crossX = super.saveClickX;
  5646. crossY = super.saveClickY;
  5647. crossType = 2;
  5648. crossIndex = 0;
  5649. stream.createFrame(249);
  5650. stream.method432(i1);
  5651. stream.method431(anInt1137);
  5652. }
  5653. }
  5654. if(l == 729)
  5655. {
  5656. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  5657. if(class30_sub2_sub4_sub1_sub2_4 != null)
  5658. {
  5659. 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]);
  5660. crossX = super.saveClickX;
  5661. crossY = super.saveClickY;
  5662. crossType = 2;
  5663. crossIndex = 0;
  5664. stream.createFrame(39);
  5665. stream.method431(i1);
  5666. }
  5667. }
  5668. if(l == 577)
  5669. {
  5670. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  5671. if(class30_sub2_sub4_sub1_sub2_5 != null)
  5672. {
  5673. 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]);
  5674. crossX = super.saveClickX;
  5675. crossY = super.saveClickY;
  5676. crossType = 2;
  5677. crossIndex = 0;
  5678. stream.createFrame(139);
  5679. stream.method431(i1);
  5680. }
  5681. }
  5682. if(l == 956 && method66(i1, k, j))
  5683. {
  5684. stream.createFrame(35);
  5685. stream.method431(j + baseX);
  5686. stream.method432(anInt1137);
  5687. stream.method432(k + baseY);
  5688. stream.method431(i1 >> 14 & 0x7fff);
  5689. }
  5690. if(l == 567)
  5691. {
  5692. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5693. if(!flag6)
  5694. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5695. crossX = super.saveClickX;
  5696. crossY = super.saveClickY;
  5697. crossType = 2;
  5698. crossIndex = 0;
  5699. stream.createFrame(23);
  5700. stream.method431(k + baseY);
  5701. stream.method431(i1);
  5702. stream.method431(j + baseX);
  5703. }
  5704. if(l == 867)
  5705. {
  5706. if((i1 & 3) == 0)
  5707. anInt1175++;
  5708. if(anInt1175 >= 59 || loginPackets[3] != 10)
  5709. {
  5710. stream.createFrame(200);
  5711. stream.writeWord(25501);
  5712. loginPackets[3] = 10;
  5713. anInt1175 = 0;
  5714. }
  5715. stream.createFrame(43);
  5716. stream.method431(k);
  5717. stream.method432(i1);
  5718. stream.method432(j);
  5719. atInventoryLoopCycle = 0;
  5720. atInventoryInterface = k;
  5721. atInventoryIndex = j;
  5722. atInventoryInterfaceType = 2;
  5723. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5724. atInventoryInterfaceType = 1;
  5725. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5726. atInventoryInterfaceType = 3;
  5727. }
  5728. if(l == 543)
  5729. {
  5730. stream.createFrame(237);
  5731. stream.writeWord(j);
  5732. stream.method432(i1);
  5733. stream.writeWord(k);
  5734. stream.method432(anInt1137);
  5735. atInventoryLoopCycle = 0;
  5736. atInventoryInterface = k;
  5737. atInventoryIndex = j;
  5738. atInventoryInterfaceType = 2;
  5739. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5740. atInventoryInterfaceType = 1;
  5741. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5742. atInventoryInterfaceType = 3;
  5743. }
  5744. if(l == 606)
  5745. {
  5746. String s2 = menuActionName[i];
  5747. int j2 = s2.indexOf("@whi@");
  5748. if(j2 != -1)
  5749. if(openInterfaceID == -1)
  5750. {
  5751. clearTopInterfaces();
  5752. reportAbuseInput = s2.substring(j2 + 5).trim();
  5753. canMute = false;
  5754. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  5755. {
  5756. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  5757. continue;
  5758. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  5759. break;
  5760. }
  5761.  
  5762. } else
  5763. {
  5764. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  5765. }
  5766. }
  5767. if(l == 491)
  5768. {
  5769. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  5770. if(class30_sub2_sub4_sub1_sub2_6 != null)
  5771. {
  5772. 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]);
  5773. crossX = super.saveClickX;
  5774. crossY = super.saveClickY;
  5775. crossType = 2;
  5776. crossIndex = 0;
  5777. stream.createFrame(14);
  5778. stream.method432(anInt1284);
  5779. stream.writeWord(i1);
  5780. stream.writeWord(anInt1285);
  5781. stream.method431(anInt1283);
  5782. }
  5783. }
  5784. if(l == 639)
  5785. {
  5786. String s3 = menuActionName[i];
  5787. int k2 = s3.indexOf("@whi@");
  5788. if(k2 != -1)
  5789. {
  5790. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  5791. int k3 = -1;
  5792. for(int i4 = 0; i4 < friendsCount; i4++)
  5793. {
  5794. if(friendsListAsLongs[i4] != l4)
  5795. continue;
  5796. k3 = i4;
  5797. break;
  5798. }
  5799.  
  5800. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  5801. {
  5802. inputTaken = true;
  5803. inputDialogState = 0;
  5804. messagePromptRaised = true;
  5805. promptInput = "";
  5806. friendsListAction = 3;
  5807. aLong953 = friendsListAsLongs[k3];
  5808. aString1121 = "Enter message to send to " + friendsList[k3];
  5809. }
  5810. }
  5811. }
  5812. if(l == 454)
  5813. {
  5814. stream.createFrame(41);
  5815. stream.writeWord(i1);
  5816. stream.method432(j);
  5817. stream.method432(k);
  5818. atInventoryLoopCycle = 0;
  5819. atInventoryInterface = k;
  5820. atInventoryIndex = j;
  5821. atInventoryInterfaceType = 2;
  5822. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5823. atInventoryInterfaceType = 1;
  5824. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5825. atInventoryInterfaceType = 3;
  5826. }
  5827. if(l == 478)
  5828. {
  5829. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  5830. if(class30_sub2_sub4_sub1_sub1_7 != null)
  5831. {
  5832. 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]);
  5833. crossX = super.saveClickX;
  5834. crossY = super.saveClickY;
  5835. crossType = 2;
  5836. crossIndex = 0;
  5837. if((i1 & 3) == 0)
  5838. anInt1155++;
  5839. if(anInt1155 >= 53 || loginPackets[4] != 10)
  5840. {
  5841. stream.createFrame(85);
  5842. stream.writeWordBigEndian(66);
  5843. anInt1155 = 0;
  5844. loginPackets[4] = 10;
  5845. }
  5846. stream.createFrame(18);
  5847. stream.method431(i1);
  5848. }
  5849. }
  5850. if(l == 113)
  5851. {
  5852. method66(i1, k, j);
  5853. stream.createFrame(70);
  5854. stream.method431(j + baseX);
  5855. stream.writeWord(k + baseY);
  5856. stream.method433(i1 >> 14 & 0x7fff);
  5857. }
  5858. if(l == 872)
  5859. {
  5860. method66(i1, k, j);
  5861. stream.createFrame(234);
  5862. stream.method433(j + baseX);
  5863. stream.method432(i1 >> 14 & 0x7fff);
  5864. stream.method433(k + baseY);
  5865. }
  5866. if(l == 502)
  5867. {
  5868. method66(i1, k, j);
  5869. stream.createFrame(132);
  5870. stream.method433(j + baseX);
  5871. stream.writeWord(i1 >> 14 & 0x7fff);
  5872. stream.method432(k + baseY);
  5873. }
  5874. if(l == 1125)
  5875. {
  5876. atInventoryLoopCycle = 0;
  5877. atInventoryInterface = k;
  5878. atInventoryIndex = j;
  5879. atInventoryInterfaceType = 2;
  5880. ItemDef itemDef = ItemDef.forID(i1);
  5881. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5882. String s5;
  5883. if(class9_4 != null && class9_4.inventoryValue[j] >= 0x186a0)
  5884. s5 = class9_4.inventoryValue[j] + " x " + itemDef.name;
  5885. else
  5886. if(itemDef.description != null)
  5887. s5 = new String(itemDef.description);
  5888. else
  5889. s5 = "It's a " + itemDef.name + ".";
  5890. pushMessage(s5, 0, "");
  5891. }
  5892. if(l == 169)
  5893. {
  5894. stream.createFrame(185);
  5895. stream.writeWord(k);
  5896. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5897. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  5898. {
  5899. int l2 = class9_3.valueIndexArray[0][1];
  5900. variousSettings[l2] = 1 - variousSettings[l2];
  5901. method33(l2);
  5902. needDrawTabArea = true;
  5903. }
  5904. }
  5905. if(l == 447)
  5906. {
  5907. itemSelected = 1;
  5908. anInt1283 = j;
  5909. anInt1284 = k;
  5910. anInt1285 = i1;
  5911. selectedItemName = ItemDef.forID(i1).name;
  5912. spellSelected = 0;
  5913. needDrawTabArea = true;
  5914. return;
  5915. }
  5916. if(l == 1226)
  5917. {
  5918. int j1 = i1 >> 14 & 0x7fff;
  5919. ObjectDef class46 = ObjectDef.forID(j1);
  5920. String s10;
  5921. if(class46.description != null)
  5922. s10 = new String(class46.description);
  5923. else
  5924. s10 = "It's a " + class46.name + ".";
  5925. pushMessage(s10, 0, "");
  5926. }
  5927. if(l == 244)
  5928. {
  5929. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5930. if(!flag7)
  5931. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5932. crossX = super.saveClickX;
  5933. crossY = super.saveClickY;
  5934. crossType = 2;
  5935. crossIndex = 0;
  5936. stream.createFrame(253);
  5937. stream.method431(j + baseX);
  5938. stream.method433(k + baseY);
  5939. stream.method432(i1);
  5940. }
  5941. if(l == 1448)
  5942. {
  5943. ItemDef itemDef_1 = ItemDef.forID(i1);
  5944. String s6;
  5945. if(itemDef_1.description != null)
  5946. s6 = new String(itemDef_1.description);
  5947. else
  5948. s6 = "It's a " + itemDef_1.name + ".";
  5949. pushMessage(s6, 0, "");
  5950. }
  5951. itemSelected = 0;
  5952. spellSelected = 0;
  5953. needDrawTabArea = true;
  5954.  
  5955. }
  5956.  
  5957. private void method70()
  5958. {
  5959. anInt1251 = 0;
  5960. int j = (myPlayer.x >> 7) + baseX;
  5961. int k = (myPlayer.y >> 7) + baseY;
  5962. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5963. anInt1251 = 1;
  5964. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5965. anInt1251 = 1;
  5966. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5967. anInt1251 = 0;
  5968. }
  5969.  
  5970. public void run() {
  5971. if(drawFlames) {
  5972. drawFlames();
  5973. } else {
  5974. super.run();
  5975. }
  5976. }
  5977.  
  5978. private void build3dScreenMenu()
  5979. {
  5980. if(itemSelected == 0 && spellSelected == 0)
  5981. {
  5982. menuActionName[menuActionRow] = "Walk here";
  5983. menuActionID[menuActionRow] = 516;
  5984. menuActionCmd2[menuActionRow] = super.mouseX;
  5985. menuActionCmd3[menuActionRow] = super.mouseY;
  5986. menuActionRow++;
  5987. }
  5988. int j = -1;
  5989. for(int k = 0; k < Model.anInt1687; k++)
  5990. {
  5991. int l = Model.anIntArray1688[k];
  5992. int i1 = l & 0x7f;
  5993. int j1 = l >> 7 & 0x7f;
  5994. int k1 = l >> 29 & 3;
  5995. int l1 = l >> 14 & 0x7fff;
  5996. if(l == j)
  5997. continue;
  5998. j = l;
  5999. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  6000. {
  6001. ObjectDef class46 = ObjectDef.forID(l1);
  6002. if(class46.childrenIDs != null)
  6003. class46 = class46.method580();
  6004. if(class46 == null)
  6005. continue;
  6006. if(itemSelected == 1)
  6007. {
  6008. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @cya@" + class46.name;
  6009. menuActionID[menuActionRow] = 62;
  6010. menuActionCmd1[menuActionRow] = l;
  6011. menuActionCmd2[menuActionRow] = i1;
  6012. menuActionCmd3[menuActionRow] = j1;
  6013. menuActionRow++;
  6014. } else
  6015. if(spellSelected == 1)
  6016. {
  6017. if((spellUsableOn & 4) == 4)
  6018. {
  6019. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  6020. menuActionID[menuActionRow] = 956;
  6021. menuActionCmd1[menuActionRow] = l;
  6022. menuActionCmd2[menuActionRow] = i1;
  6023. menuActionCmd3[menuActionRow] = j1;
  6024. menuActionRow++;
  6025. }
  6026. } else
  6027. {
  6028. if(class46.itemActions != null)
  6029. {
  6030. for(int i2 = 4; i2 >= 0; i2--)
  6031. if(class46.itemActions[i2] != null)
  6032. {
  6033. menuActionName[menuActionRow] = class46.itemActions[i2] + " @cya@" + class46.name;
  6034. if(i2 == 0)
  6035. menuActionID[menuActionRow] = 502;
  6036. if(i2 == 1)
  6037. menuActionID[menuActionRow] = 900;
  6038. if(i2 == 2)
  6039. menuActionID[menuActionRow] = 113;
  6040. if(i2 == 3)
  6041. menuActionID[menuActionRow] = 872;
  6042. if(i2 == 4)
  6043. menuActionID[menuActionRow] = 1062;
  6044. menuActionCmd1[menuActionRow] = l;
  6045. menuActionCmd2[menuActionRow] = i1;
  6046. menuActionCmd3[menuActionRow] = j1;
  6047. menuActionRow++;
  6048. }
  6049.  
  6050. }
  6051. if(idToggle == true) {
  6052. menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  6053. } else {
  6054. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  6055. }
  6056. menuActionID[menuActionRow] = 1226;
  6057. menuActionCmd1[menuActionRow] = class46.type << 14;
  6058. menuActionCmd2[menuActionRow] = i1;
  6059. menuActionCmd3[menuActionRow] = j1;
  6060. menuActionRow++;
  6061. }
  6062. }
  6063. if(k1 == 1)
  6064. {
  6065. NPC npc = npcArray[l1];
  6066. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  6067. {
  6068. for(int j2 = 0; j2 < npcCount; j2++)
  6069. {
  6070. NPC npc2 = npcArray[npcIndices[j2]];
  6071. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  6072. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  6073. }
  6074.  
  6075. for(int l2 = 0; l2 < playerCount; l2++)
  6076. {
  6077. Player player = playerArray[playerIndices[l2]];
  6078. if(player != null && player.x == npc.x && player.y == npc.y)
  6079. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  6080. }
  6081.  
  6082. }
  6083. buildAtNPCMenu(npc.desc, l1, j1, i1);
  6084. }
  6085. if(k1 == 0)
  6086. {
  6087. Player player = playerArray[l1];
  6088. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  6089. {
  6090. for(int k2 = 0; k2 < npcCount; k2++)
  6091. {
  6092. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  6093. 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)
  6094. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  6095. }
  6096.  
  6097. for(int i3 = 0; i3 < playerCount; i3++)
  6098. {
  6099. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  6100. 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)
  6101. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  6102. }
  6103.  
  6104. }
  6105. buildAtPlayerMenu(i1, l1, player, j1);
  6106. }
  6107. if(k1 == 3)
  6108. {
  6109. NodeList class19 = groundArray[plane][i1][j1];
  6110. if(class19 != null)
  6111. {
  6112. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  6113. {
  6114. ItemDef itemDef = ItemDef.forID(item.ID);
  6115. if(itemSelected == 1)
  6116. {
  6117. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @lre@" + itemDef.name;
  6118. menuActionID[menuActionRow] = 511;
  6119. menuActionCmd1[menuActionRow] = item.ID;
  6120. menuActionCmd2[menuActionRow] = i1;
  6121. menuActionCmd3[menuActionRow] = j1;
  6122. menuActionRow++;
  6123. } else
  6124. if(spellSelected == 1)
  6125. {
  6126. if((spellUsableOn & 1) == 1)
  6127. {
  6128. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  6129. menuActionID[menuActionRow] = 94;
  6130. menuActionCmd1[menuActionRow] = item.ID;
  6131. menuActionCmd2[menuActionRow] = i1;
  6132. menuActionCmd3[menuActionRow] = j1;
  6133. menuActionRow++;
  6134. }
  6135. } else
  6136. {
  6137. for(int j3 = 4; j3 >= 0; j3--)
  6138. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  6139. {
  6140. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  6141. if(j3 == 0)
  6142. menuActionID[menuActionRow] = 652;
  6143. if(j3 == 1)
  6144. menuActionID[menuActionRow] = 567;
  6145. if(j3 == 2)
  6146. menuActionID[menuActionRow] = 234;
  6147. if(j3 == 3)
  6148. menuActionID[menuActionRow] = 244;
  6149. if(j3 == 4)
  6150. menuActionID[menuActionRow] = 213;
  6151. menuActionCmd1[menuActionRow] = item.ID;
  6152. menuActionCmd2[menuActionRow] = i1;
  6153. menuActionCmd3[menuActionRow] = j1;
  6154. menuActionRow++;
  6155. } else
  6156. if(j3 == 2)
  6157. {
  6158. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  6159. menuActionID[menuActionRow] = 234;
  6160. menuActionCmd1[menuActionRow] = item.ID;
  6161. menuActionCmd2[menuActionRow] = i1;
  6162. menuActionCmd3[menuActionRow] = j1;
  6163. menuActionRow++;
  6164. }
  6165. if(idToggle == true) {
  6166. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  6167. } else {
  6168. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  6169. }
  6170. menuActionID[menuActionRow] = 1448;
  6171. menuActionCmd1[menuActionRow] = item.ID;
  6172. menuActionCmd2[menuActionRow] = i1;
  6173. menuActionCmd3[menuActionRow] = j1;
  6174. menuActionRow++;
  6175. }
  6176. }
  6177.  
  6178. }
  6179. }
  6180. }
  6181. }
  6182.  
  6183. public void cleanUpForQuit()
  6184. {
  6185. signlink.reporterror = false;
  6186. try
  6187. {
  6188. if(socketStream != null)
  6189. socketStream.close();
  6190. System.out.println("Here6");
  6191. }
  6192. catch(Exception _ex) { }
  6193. socketStream = null;
  6194. stopMidi();
  6195. if(mouseDetection != null)
  6196. mouseDetection.running = false;
  6197. mouseDetection = null;
  6198. onDemandFetcher.disable();
  6199. onDemandFetcher = null;
  6200. aStream_834 = null;
  6201. stream = null;
  6202. aStream_847 = null;
  6203. inStream = null;
  6204. anIntArray1234 = null;
  6205. aByteArrayArray1183 = null;
  6206. aByteArrayArray1247 = null;
  6207. anIntArray1235 = null;
  6208. anIntArray1236 = null;
  6209. intGroundArray = null;
  6210. byteGroundArray = null;
  6211. worldController = null;
  6212. aClass11Array1230 = null;
  6213. anIntArrayArray901 = null;
  6214. anIntArrayArray825 = null;
  6215. bigX = null;
  6216. bigY = null;
  6217. aByteArray912 = null;
  6218. inventoryBackImage = null;
  6219. mapEdgeIP = null;
  6220. leftFrame = null;
  6221. topFrame = null;
  6222. rightFrame = null;
  6223. mapBackImage = null;
  6224. inGameScreen = null;
  6225. chatBackImage = null;
  6226. //aRSImageProducer_1123 = null;
  6227. aRSImageProducer_1124 = null;
  6228. aRSImageProducer_1125 = null;
  6229. /* Null pointers for custom sprites */
  6230.  
  6231.  
  6232. chatArea = null;
  6233. chatButtons = null;
  6234. tabArea = null;
  6235. mapArea = null;
  6236. HPBarFull = null;
  6237. HPBarEmpty = null;
  6238. tabHover = null;
  6239. tabClicked = null;
  6240. newSideIcons = null;
  6241. /**/
  6242. mapBack = null;
  6243. CustomMapback = null;
  6244.  
  6245. sideIcons = null;
  6246. sIcons483 = null;
  6247. sIcons459 = null;
  6248.  
  6249. redStones = null;
  6250. compass = null;
  6251. hitMarks = null;
  6252. hitMark = null;
  6253. headIcons = null;
  6254. skullIcons = null;
  6255. headIconsHint = null;
  6256. crosses = null;
  6257. mapDotItem = null;
  6258. mapDotNPC = null;
  6259. mapDotPlayer = null;
  6260. mapDotFriend = null;
  6261. mapDotTeam = null;
  6262. mapScenes = null;
  6263. mapFunctions = null;
  6264. anIntArrayArray929 = null;
  6265. playerArray = null;
  6266. playerIndices = null;
  6267. anIntArray894 = null;
  6268. aStreamArray895s = null;
  6269. anIntArray840 = null;
  6270. npcArray = null;
  6271. npcIndices = null;
  6272. groundArray = null;
  6273. aClass19_1179 = null;
  6274. aClass19_1013 = null;
  6275. aClass19_1056 = null;
  6276. menuActionCmd2 = null;
  6277. menuActionCmd3 = null;
  6278. menuActionID = null;
  6279. menuActionCmd1 = null;
  6280. menuActionName = null;
  6281. variousSettings = null;
  6282. anIntArray1072 = null;
  6283. anIntArray1073 = null;
  6284. aSpriteArray1140 = null;
  6285. aSprite_1263 = null;
  6286. friendsList = null;
  6287. friendsListAsLongs = null;
  6288. friendsNodeIDs = null;
  6289. leftSideFlame = null;
  6290. rightSideFlame = null;
  6291. aRSImageProducer_1107 = null;
  6292. aRSImageProducer_1108 = null;
  6293. loginScreenArea = null;
  6294. gameLogo = null;
  6295. aRSImageProducer_1113 = null;
  6296. aRSImageProducer_1114 = null;
  6297. aRSImageProducer_1115 = null;
  6298. multiOverlay = null;
  6299. nullLoader();
  6300. ObjectDef.nullLoader();
  6301. EntityDef.nullLoader();
  6302. ItemDef.nullLoader();
  6303. Flo.cache = null;
  6304. IdentityKit.cache = null;
  6305. RSInterface.interfaceCache = null;
  6306. DummyClass.cache = null;
  6307. Animation.anims = null;
  6308. SpotAnim.cache = null;
  6309. SpotAnim.aMRUNodes_415 = null;
  6310. Varp.cache = null;
  6311. super.fullGameScreen = null;
  6312. Player.mruNodes = null;
  6313. Texture.nullLoader();
  6314. WorldController.nullLoader();
  6315. Model.nullLoader();
  6316. Class36.nullLoader();
  6317. System.gc();
  6318. }
  6319.  
  6320. private void printDebug()
  6321. {
  6322. System.out.println("============");
  6323. System.out.println("flame-cycle:" + anInt1208);
  6324. if(onDemandFetcher != null)
  6325. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  6326. System.out.println("loop-cycle:" + loopCycle);
  6327. System.out.println("draw-cycle:" + anInt1061);
  6328. System.out.println("ptype:" + pktType);
  6329. System.out.println("psize:" + pktSize);
  6330. if(socketStream != null)
  6331. socketStream.printDebug();
  6332. super.shouldDebug = true;
  6333. }
  6334.  
  6335. Component getGameComponent() {
  6336.  
  6337.  
  6338. if(signlink.mainapp != null)
  6339. return signlink.mainapp;
  6340. if(super.gameFrame != null)
  6341. return super.gameFrame;
  6342. else
  6343. return this;
  6344. }
  6345.  
  6346. private void method73() {
  6347. do {
  6348. int j = readChar(-796);
  6349. if(j == -1)
  6350. break;
  6351. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  6352. if(j == 8 && reportAbuseInput.length() > 0)
  6353. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  6354. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  6355. reportAbuseInput += (char)j;
  6356. } else if(messagePromptRaised) {
  6357. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  6358. promptInput += (char)j;
  6359. inputTaken = true;
  6360. }
  6361. if(j == 8 && promptInput.length() > 0) {
  6362. promptInput = promptInput.substring(0, promptInput.length() - 1);
  6363. inputTaken = true;
  6364. }
  6365. if(j == 13 || j == 10) {
  6366. messagePromptRaised = false;
  6367. inputTaken = true;
  6368. if(friendsListAction == 1) {
  6369. long l = TextClass.longForName(promptInput);
  6370. addFriend(l);
  6371. }
  6372. if(friendsListAction == 2 && friendsCount > 0) {
  6373. long l1 = TextClass.longForName(promptInput);
  6374. delFriend(l1);
  6375. }
  6376. if(friendsListAction == 3 && promptInput.length() > 0) {
  6377. stream.createFrame(126);
  6378. stream.writeWordBigEndian(0);
  6379. int k = stream.currentOffset;
  6380. stream.writeQWord(aLong953);
  6381. TextInput.method526(promptInput, stream);
  6382. stream.writeBytes(stream.currentOffset - k);
  6383. promptInput = TextInput.processText(promptInput);
  6384. //promptInput = Censor.doCensor(promptInput);
  6385. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  6386. if(privateChatMode == 2) {
  6387. privateChatMode = 1;
  6388. aBoolean1233 = true;
  6389. stream.createFrame(95);
  6390. stream.writeWordBigEndian(publicChatMode);
  6391. stream.writeWordBigEndian(privateChatMode);
  6392. stream.writeWordBigEndian(tradeMode);
  6393. }
  6394. }
  6395. if(friendsListAction == 4 && ignoreCount < 100) {
  6396. long l2 = TextClass.longForName(promptInput);
  6397. addIgnore(l2);
  6398. }
  6399. if(friendsListAction == 5 && ignoreCount > 0) {
  6400. long l3 = TextClass.longForName(promptInput);
  6401. delIgnore(l3);
  6402. }
  6403. if(friendsListAction == 6) {
  6404. long l3 = TextClass.longForName(promptInput);
  6405. chatJoin(l3);
  6406. }
  6407. }
  6408. } else if(inputDialogState == 1) {
  6409. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  6410. amountOrNameInput += (char)j;
  6411. inputTaken = true;
  6412. }
  6413. if(j == 8 && amountOrNameInput.length() > 0) {
  6414. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  6415. inputTaken = true;
  6416. }
  6417. if(j == 13 || j == 10) {
  6418. if(amountOrNameInput.length() > 0) {
  6419. int i1 = 0;
  6420. try {
  6421. i1 = Integer.parseInt(amountOrNameInput);
  6422. }
  6423. catch(Exception _ex) { }
  6424. stream.createFrame(208);
  6425. stream.writeDWord(i1);
  6426. }
  6427. inputDialogState = 0;
  6428. inputTaken = true;
  6429. }
  6430. } else if(inputDialogState == 2) {
  6431. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  6432. amountOrNameInput += (char)j;
  6433. inputTaken = true;
  6434. }
  6435. if(j == 8 && amountOrNameInput.length() > 0) {
  6436. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  6437. inputTaken = true;
  6438. }
  6439. if(j == 13 || j == 10) {
  6440. if(amountOrNameInput.length() > 0) {
  6441. stream.createFrame(60);
  6442. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  6443. }
  6444. inputDialogState = 0;
  6445. inputTaken = true;
  6446. }
  6447. } else if(backDialogID == -1) {
  6448. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  6449. inputString += (char)j;
  6450. inputTaken = true;
  6451. }
  6452. if(j == 8 && inputString.length() > 0) {
  6453. inputString = inputString.substring(0, inputString.length() - 1);
  6454. inputTaken = true;
  6455. }
  6456. if((j == 13 || j == 10) && inputString.length() > 0) {
  6457.  
  6458. if(myPrivilege >= 2 || server.equals("127.0.0.1") || 1 == 1) {
  6459. if(inputString.equals("region")) {
  6460. System.out.println("Current region: " + anInt1069 + ", " + anInt1070);
  6461. }
  6462. //17511 = Question Type
  6463. //15819 = Christmas Type
  6464. //15812 = Security Type
  6465. //15801 = Item Scam Type
  6466. //15791 = Password Safety ?
  6467. //15774 = Good/Bad Password
  6468. //15767 = Drama Type ????
  6469. if(inputString.equals("::coords")){
  6470. pushMessage("Barbarian Assault: X2587, Y5284, H0", 0, "");
  6471. pushMessage("GodWars Dungeon: X2871, Y5318, H2", 0, "");
  6472. pushMessage("Pest Control: X2658, Y2649, H0", 0, "");
  6473. pushMessage("Warriors Guild: X2870, Y3546, H0", 0, "");
  6474. }
  6475. if(inputString.equals("::idtoggle")){
  6476. if(idToggle) {
  6477. idToggle = false;
  6478. } else {
  6479. idToggle = true;
  6480. }
  6481. }
  6482. if(inputString.equals("clientdrop"))
  6483. dropClient();
  6484. if(inputString.equals("::lag"))
  6485. printDebug();
  6486. if(inputString.equals("::fpson"))
  6487. fpsOn = true;
  6488. if(inputString.equals("::fpsoff"))
  6489. fpsOn = false;
  6490. if(inputString.equals("::dataon"))
  6491. clientData = true;
  6492. if(inputString.equals("::dataoff"))
  6493. clientData = false;
  6494. /* if(inputString.equals("::noclip")) {
  6495. try {
  6496. for(int k1 = 0; k1 < 4; k1++) {
  6497. for(int i2 = 1; i2 < 103; i2++) {
  6498. for(int k2 = 1; k2 < 103; k2++)
  6499. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  6500. }
  6501. }
  6502. } catch (Exception e) {
  6503. }
  6504. }
  6505. if (inputString.equals("::interface")) {
  6506. try {
  6507. String[] args = inputString.split(" ");
  6508. int id2 = Integer.parseInt(args[1]);
  6509. sendFrame97(id2);
  6510. pushMessage("Opened Interface", 0, "");
  6511. } catch (Exception e) {
  6512. pushMessage("Interface Failed to load", 0, "");
  6513. }
  6514. }*/
  6515. }
  6516. if(inputString.startsWith("/"))
  6517. inputString = "::" + inputString;
  6518. if(inputString.startsWith("::")) {
  6519. stream.createFrame(103);
  6520. stream.writeWordBigEndian(inputString.length() - 1);
  6521. stream.writeString(inputString.substring(2));
  6522. } else {
  6523. String s = inputString.toLowerCase();
  6524. int j2 = 0;
  6525. if(s.startsWith("yellow:"))
  6526. {
  6527. j2 = 0;
  6528. inputString = inputString.substring(7);
  6529. } else if(s.startsWith("red:"))
  6530. {
  6531. j2 = 1;
  6532. inputString = inputString.substring(4);
  6533. } else if(tColour == 0){
  6534. j2 = 0;
  6535. //inputString = inputString.substring(7);
  6536. } else if(tColour == 1){
  6537. j2 = 2;
  6538. //inputString = inputString.substring(6);
  6539. } else if(tColour == 2){
  6540. j2 = 5;
  6541. } else if(tColour == 3){
  6542. j2 = 1;
  6543. } else if(s.startsWith("green:")) {
  6544. j2 = 2;
  6545. inputString = inputString.substring(6);
  6546. } else if(s.startsWith("cyan:"))
  6547. {
  6548. j2 = 3;
  6549. inputString = inputString.substring(5);
  6550. } else if(s.startsWith("purple:"))
  6551. {
  6552. j2 = 4;
  6553. inputString = inputString.substring(7);
  6554. } else if(s.startsWith("white:"))
  6555. {
  6556. j2 = 5;
  6557. inputString = inputString.substring(6);
  6558. } else if(s.startsWith("flash1:")){
  6559. j2 = 6;
  6560. inputString = inputString.substring(7);
  6561. } else if(s.startsWith("flash2:"))
  6562. {
  6563. j2 = 7;
  6564. inputString = inputString.substring(7);
  6565. } else if(s.startsWith("flash3:"))
  6566. {
  6567. j2 = 8;
  6568. inputString = inputString.substring(7);
  6569. } else if(s.startsWith("glow1:"))
  6570. {
  6571. j2 = 9;
  6572. inputString = inputString.substring(6);
  6573. } else if(s.startsWith("glow2:"))
  6574. {
  6575. j2 = 10;
  6576. inputString = inputString.substring(6);
  6577. } else if(s.startsWith("glow3:"))
  6578. {
  6579. j2 = 11;
  6580. inputString = inputString.substring(6);
  6581. }
  6582. s = inputString.toLowerCase();
  6583. int i3 = 0;
  6584. if(s.startsWith("wave:"))
  6585. {
  6586. i3 = 1;
  6587. inputString = inputString.substring(5);
  6588. } else if(s.startsWith("wave2:"))
  6589. {
  6590. i3 = 2;
  6591. inputString = inputString.substring(6);
  6592. } else if(s.startsWith("shake:"))
  6593. {
  6594. i3 = 3;
  6595. inputString = inputString.substring(6);
  6596. }
  6597. else if(tEffect == 1){
  6598. i3 = 1;
  6599. } else if(tEffect == 2){
  6600. i3 = 3;
  6601. } else if(tEffect == 3){
  6602. i3 = 5;
  6603. } else if(tEffect == 0){
  6604. i3 = 0;
  6605. } else if(s.startsWith("scroll:"))
  6606. {
  6607. i3 = 4;
  6608. inputString = inputString.substring(7);
  6609. } else if(s.startsWith("slide:"))
  6610. {
  6611. i3 = 5;
  6612. inputString = inputString.substring(6);
  6613. }
  6614. stream.createFrame(4);
  6615. stream.writeWordBigEndian(0);
  6616. int j3 = stream.currentOffset;
  6617. stream.method425(i3);
  6618. stream.method425(j2);
  6619. aStream_834.currentOffset = 0;
  6620. TextInput.method526(inputString, aStream_834);
  6621. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  6622. stream.writeBytes(stream.currentOffset - j3);
  6623. inputString = TextInput.processText(inputString);
  6624. //inputString = Censor.doCensor(inputString);
  6625. myPlayer.textSpoken = inputString;
  6626. myPlayer.anInt1513 = j2;
  6627. myPlayer.anInt1531 = i3;
  6628. myPlayer.textCycle = 150;
  6629. //My players icons showing up when I speak
  6630. if(myPrivilege == 4) {
  6631. pushMessage(myPlayer.textSpoken, 2, "@cr3@" + myPlayer.name);
  6632. } else if(myPrivilege == 3) {
  6633. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  6634. } else if(myPrivilege == 2) {
  6635. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  6636. } else if(myPrivilege == 1) {
  6637. pushMessage(myPlayer.textSpoken, 2, "@cr0@" + myPlayer.name);
  6638. } else if(myPrivilege == 5) {
  6639. pushMessage(myPlayer.textSpoken, 2, "@cr4@" + myPlayer.name);
  6640. } else {
  6641. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  6642. }
  6643. if(publicChatMode == 2)
  6644. {
  6645. publicChatMode = 3;
  6646. aBoolean1233 = true;
  6647. stream.createFrame(95);
  6648. stream.writeWordBigEndian(publicChatMode);
  6649. stream.writeWordBigEndian(privateChatMode);
  6650. stream.writeWordBigEndian(tradeMode);
  6651. }
  6652. }
  6653. inputString = "";
  6654. inputTaken = true;
  6655. }
  6656. }
  6657. } while(true);
  6658. }
  6659.  
  6660. private void buildPublicChat(int j)
  6661. {
  6662. int l = 0;
  6663. for(int i1 = 0; i1 < 500; i1++)
  6664. {
  6665. if(chatMessages[i1] == null)
  6666. continue;
  6667. if(chatTypeView != 1)
  6668. continue;
  6669. int j1 = chatTypes[i1];
  6670. String s = chatNames[i1];
  6671. String ct = chatMessages[i1];
  6672. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6673. if(k1 < -23)
  6674. break;
  6675. if(s != null && s.startsWith("@cr0@"))
  6676. s = s.substring(5);
  6677. if(s != null && s.startsWith("@cr1@"))
  6678. s = s.substring(5);
  6679. if(s != null && s.startsWith("@cr2@"))
  6680. s = s.substring(5);
  6681. if(s != null && s.startsWith("@cr3@"))
  6682. s = s.substring(5);
  6683. if(s != null && s.startsWith("@cr4@"))
  6684. s = s.substring(5);
  6685. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6686. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6687. if(myPrivilege >= 1) {
  6688. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6689. menuActionID[menuActionRow] = 606;
  6690. menuActionRow++;
  6691. }
  6692. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6693. menuActionID[menuActionRow] = 42;
  6694. menuActionRow++;
  6695. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6696. menuActionID[menuActionRow] = 337;
  6697. menuActionRow++;
  6698. }
  6699. l++;
  6700. }
  6701. }
  6702. }
  6703.  
  6704. private void buildFriendChat(int j)
  6705. {
  6706. int l = 0;
  6707. for(int i1 = 0; i1 < 500; i1++) {
  6708. if(chatMessages[i1] == null)
  6709. continue;
  6710. if(chatTypeView != 2)
  6711. continue;
  6712. int j1 = chatTypes[i1];
  6713. String s = chatNames[i1];
  6714. String ct = chatMessages[i1];
  6715. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6716. if(k1 < -23)
  6717. break;
  6718. if(s != null && s.startsWith("@cr0@"))
  6719. s = s.substring(5);
  6720. if(s != null && s.startsWith("@cr1@"))
  6721. s = s.substring(5);
  6722. if(s != null && s.startsWith("@cr2@"))
  6723. s = s.substring(5);
  6724. if(s != null && s.startsWith("@cr3@"))
  6725. s = s.substring(5);
  6726. if(s != null && s.startsWith("@cr4@"))
  6727. s = s.substring(5);
  6728. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6729. l++;
  6730. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6731. {
  6732. if(j > k1 - 14 && j <= k1) {
  6733. if(myPrivilege >= 1) {
  6734. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6735. menuActionID[menuActionRow] = 606;
  6736. menuActionRow++;
  6737. }
  6738. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6739. menuActionID[menuActionRow] = 42;
  6740. menuActionRow++;
  6741. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6742. menuActionID[menuActionRow] = 337;
  6743. menuActionRow++;
  6744. }
  6745. l++;
  6746. }
  6747. }
  6748. }
  6749.  
  6750. private void buildDuelorTrade(int j) {
  6751. int l = 0;
  6752. for(int i1 = 0; i1 < 500; i1++) {
  6753. if(chatMessages[i1] == null)
  6754. continue;
  6755. if(chatTypeView != 3 && chatTypeView != 4)
  6756. continue;
  6757. int j1 = chatTypes[i1];
  6758. String s = chatNames[i1];
  6759. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6760. if(k1 < -23)
  6761. break;
  6762. if(s != null && s.startsWith("@cr0@"))
  6763. s = s.substring(5);
  6764. if(s != null && s.startsWith("@cr1@"))
  6765. s = s.substring(5);
  6766. if(s != null && s.startsWith("@cr2@"))
  6767. s = s.substring(5);
  6768. if(s != null && s.startsWith("@cr3@"))
  6769. s = s.substring(5);
  6770. if(s != null && s.startsWith("@cr4@"))
  6771. s = s.substring(5);
  6772. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6773. if(j > k1 - 14 && j <= k1) {
  6774. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6775. menuActionID[menuActionRow] = 484;
  6776. menuActionRow++;
  6777. }
  6778. l++;
  6779. }
  6780. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6781. if(j > k1 - 14 && j <= k1) {
  6782. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6783. menuActionID[menuActionRow] = 6;
  6784. menuActionRow++;
  6785. }
  6786. l++;
  6787. }
  6788. if(j1 == 12) {
  6789. if(j > k1 - 14 && j <= k1) {
  6790. menuActionName[menuActionRow] = "Go-to @cya@" + s;
  6791. menuActionID[menuActionRow] = 915;
  6792. menuActionRow++;
  6793. }
  6794. l++;
  6795. }
  6796. }
  6797. }
  6798.  
  6799. private void buildChatAreaMenu(int j) {
  6800. int l = 0;
  6801. int test = 0;
  6802. for(int i1 = 0; i1 < 500; i1++) {
  6803. if(chatMessages[i1] == null)
  6804. continue;
  6805. int j1 = chatTypes[i1];
  6806. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6807. if(k1 < -23)
  6808. break;
  6809. String s = chatNames[i1];
  6810. String ct = chatMessages[i1];
  6811. boolean flag = false;
  6812. if(chatTypeView == 1) {
  6813. buildPublicChat(j);
  6814. break;
  6815. }
  6816. if(chatTypeView == 2) {
  6817. buildFriendChat(j);
  6818. break;
  6819. }
  6820. if(chatTypeView == 3 || chatTypeView == 4) {
  6821. buildDuelorTrade(j);
  6822. break;
  6823. }
  6824. if(chatTypeView == 5) {
  6825. break;
  6826. }
  6827. if (s != null && s.startsWith("@cr0@")) {
  6828. s = s.substring(5);
  6829. byte byte0 = 1;
  6830. }
  6831. if(s != null && s.startsWith("@cr1@")) {
  6832. s = s.substring(5);
  6833. boolean flag1 = true;
  6834. byte byte0 = 2;
  6835. }
  6836. if(s != null && s.startsWith("@cr2@")) {
  6837. s = s.substring(5);
  6838. byte byte0 = 3;
  6839. }
  6840. if(s != null && s.startsWith("@cr3@")) {
  6841. s = s.substring(5);
  6842. byte byte0 = 4;
  6843. }
  6844. if(s != null && s.startsWith("@cr4@")) {
  6845. s = s.substring(5);
  6846. byte byte0 = 4;
  6847. }
  6848. if(j1 == 0)
  6849. l++;
  6850. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6851. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6852. if(myPrivilege >= 1) {
  6853. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6854. menuActionID[menuActionRow] = 606;
  6855. menuActionRow++;
  6856. }
  6857. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6858. menuActionID[menuActionRow] = 42;
  6859. menuActionRow++;
  6860. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6861. menuActionID[menuActionRow] = 337;
  6862. menuActionRow++;
  6863. }
  6864. l++;
  6865. }
  6866. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  6867. if(j > k1 - 14 && j <= k1) {
  6868. if(myPrivilege >= 1) {
  6869. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6870. menuActionID[menuActionRow] = 606;
  6871. menuActionRow++;
  6872. }
  6873. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6874. menuActionID[menuActionRow] = 42;
  6875. menuActionRow++;
  6876. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6877. menuActionID[menuActionRow] = 337;
  6878. menuActionRow++;
  6879. }
  6880. l++;
  6881. }
  6882. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6883. if(j > k1 - 14 && j <= k1) {
  6884. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6885. menuActionID[menuActionRow] = 484;
  6886. menuActionRow++;
  6887. }
  6888. l++;
  6889. }
  6890. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  6891. l++;
  6892. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6893. if(j > k1 - 14 && j <= k1) {
  6894. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6895. menuActionID[menuActionRow] = 6;
  6896. menuActionRow++;
  6897. }
  6898. l++;
  6899. }
  6900. if(j1 == 9) {
  6901. if(j > k1 - 14 && j <= k1) {
  6902. menuActionName[menuActionRow] = "Go-to @cya@" + s;
  6903. menuActionID[menuActionRow] = 927;
  6904. menuActionRow++;
  6905. }
  6906. l++;
  6907. }
  6908. if(j1 == 10) {
  6909. if(j > k1 - 14 && j <= k1) {
  6910. menuActionName[menuActionRow] = s;
  6911. menuActionID[menuActionRow] = 1090;
  6912. menuActionRow++;
  6913. }
  6914. l++;
  6915. }
  6916. }
  6917.  
  6918. }
  6919.  
  6920.  
  6921.  
  6922. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  6923. {
  6924. int j = class9.contentType;
  6925. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  6926. {
  6927. if(j == 1 && anInt900 == 0)
  6928. {
  6929. class9.disabledMessage = "Loading friend list";
  6930. class9.atActionType = 0;
  6931. return;
  6932. }
  6933. if(j == 1 && anInt900 == 1)
  6934. {
  6935. class9.disabledMessage = "Connecting to friendserver";
  6936. class9.atActionType = 0;
  6937. return;
  6938. }
  6939. if(j == 2 && anInt900 != 2)
  6940. {
  6941. class9.disabledMessage = "Please wait...";
  6942. class9.atActionType = 0;
  6943. return;
  6944. }
  6945. int k = friendsCount;
  6946. if(anInt900 != 2)
  6947. k = 0;
  6948. if(j > 700)
  6949. j -= 601;
  6950. else
  6951. j--;
  6952. if(j >= k)
  6953. {
  6954. class9.disabledMessage = "";
  6955. class9.atActionType = 0;
  6956. return;
  6957. } else
  6958. {
  6959. class9.disabledMessage = friendsList[j];
  6960. class9.atActionType = 1;
  6961. return;
  6962. }
  6963. }
  6964. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  6965. {
  6966. int l = friendsCount;
  6967. if(anInt900 != 2)
  6968. l = 0;
  6969. if(j > 800)
  6970. j -= 701;
  6971. else
  6972. j -= 101;
  6973. if(j >= l)
  6974. {
  6975. class9.disabledMessage = "";
  6976. class9.atActionType = 0;
  6977. return;
  6978. }
  6979. if(friendsNodeIDs[j] == 10)
  6980. class9.disabledMessage = "@gre@Online";
  6981. else
  6982. if(friendsNodeIDs[j] == nodeID)
  6983. class9.disabledMessage = "@red@Offline";
  6984. else
  6985. class9.disabledMessage = "@red@Offline";
  6986. class9.atActionType = 1;
  6987. return;
  6988. }
  6989. if(j == 203)
  6990. {
  6991. int i1 = friendsCount;
  6992. if(anInt900 != 2)
  6993. i1 = 0;
  6994. class9.scrollMax = i1 * 15 + 20;
  6995. if(class9.scrollMax <= class9.height)
  6996. class9.scrollMax = class9.height + 1;
  6997. return;
  6998. }
  6999. if(j >= 401 && j <= 500)
  7000. {
  7001. if((j -= 401) == 0 && anInt900 == 0)
  7002. {
  7003. class9.disabledMessage = "Loading ignore list";
  7004. class9.atActionType = 0;
  7005. return;
  7006. }
  7007. if(j == 1 && anInt900 == 0)
  7008. {
  7009. class9.disabledMessage = "Please wait...";
  7010. class9.atActionType = 0;
  7011. return;
  7012. }
  7013. int j1 = ignoreCount;
  7014. if(anInt900 == 0)
  7015. j1 = 0;
  7016. if(j >= j1)
  7017. {
  7018. class9.disabledMessage = "";
  7019. class9.atActionType = 0;
  7020. return;
  7021. } else
  7022. {
  7023. class9.disabledMessage = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  7024. class9.atActionType = 1;
  7025. return;
  7026. }
  7027. }
  7028. if(j == 503)
  7029. {
  7030. class9.scrollMax = ignoreCount * 15 + 20;
  7031. if(class9.scrollMax <= class9.height)
  7032. class9.scrollMax = class9.height + 1;
  7033. return;
  7034. }
  7035. if(j == 327)
  7036. {
  7037. class9.modelRotationY = 150;
  7038. class9.modelRotationX = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  7039. if(aBoolean1031)
  7040. {
  7041. for(int k1 = 0; k1 < 7; k1++)
  7042. {
  7043. int l1 = anIntArray1065[k1];
  7044. if(l1 >= 0 && !IdentityKit.cache[l1].method537())
  7045. return;
  7046. }
  7047.  
  7048. aBoolean1031 = false;
  7049. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  7050. int i2 = 0;
  7051. for(int j2 = 0; j2 < 7; j2++)
  7052. {
  7053. int k2 = anIntArray1065[j2];
  7054. if(k2 >= 0)
  7055. aclass30_sub2_sub4_sub6s[i2++] = IdentityKit.cache[k2].method538();
  7056. }
  7057.  
  7058. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  7059. for(int l2 = 0; l2 < 5; l2++)
  7060. if(anIntArray990[l2] != 0)
  7061. {
  7062. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  7063. if(l2 == 1)
  7064. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  7065. }
  7066.  
  7067. model.method469();
  7068. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  7069. model.method479(64, 850, -30, -50, -30, true);
  7070. class9.disabledMediaType = 5;
  7071. class9.disabledMediaID = 0;
  7072. RSInterface.method208(aBoolean994, model);
  7073. }
  7074. return;
  7075. }
  7076. if(j == 328) {
  7077. RSInterface rsInterface = class9;
  7078. int verticleTilt = 150;
  7079. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  7080. rsInterface.modelRotationY = verticleTilt;
  7081. rsInterface.modelRotationX = animationSpeed;
  7082. if(aBoolean1031) {
  7083. Model characterDisplay = myPlayer.method452();
  7084. for(int l2 = 0; l2 < 5; l2++)
  7085. if(anIntArray990[l2] != 0) {
  7086. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  7087. if(l2 == 1)
  7088. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  7089. }
  7090. int staticFrame = myPlayer.anInt1511;
  7091. characterDisplay.method469();
  7092. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  7093. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  7094. rsInterface.disabledMediaType = 5;
  7095. rsInterface.disabledMediaID = 0;
  7096. RSInterface.method208(aBoolean994, characterDisplay);
  7097. }
  7098. return;
  7099. }
  7100. if(j == 324)
  7101. {
  7102. if(aSprite_931 == null)
  7103. {
  7104. aSprite_931 = class9.disabledSprite;
  7105. aSprite_932 = class9.enabledSprite;
  7106. }
  7107. if(aBoolean1047)
  7108. {
  7109. class9.disabledSprite = aSprite_932;
  7110. return;
  7111. } else
  7112. {
  7113. class9.disabledSprite = aSprite_931;
  7114. return;
  7115. }
  7116. }
  7117. if(j == 325)
  7118. {
  7119. if(aSprite_931 == null)
  7120. {
  7121. aSprite_931 = class9.disabledSprite;
  7122. aSprite_932 = class9.enabledSprite;
  7123. }
  7124. if(aBoolean1047)
  7125. {
  7126. class9.disabledSprite = aSprite_931;
  7127. return;
  7128. } else
  7129. {
  7130. class9.disabledSprite = aSprite_932;
  7131. return;
  7132. }
  7133. }
  7134. if(j == 600)
  7135. {
  7136. class9.disabledMessage = reportAbuseInput;
  7137. if(loopCycle % 20 < 10)
  7138. {
  7139. class9.disabledMessage += "|";
  7140. return;
  7141. } else
  7142. {
  7143. class9.disabledMessage += " ";
  7144. return;
  7145. }
  7146. }
  7147. if(j == 613)
  7148. if(myPrivilege >= 1)
  7149. {
  7150. if(canMute) {
  7151. class9.disabledColor = 0xff0000;
  7152. class9.disabledMessage = "Moderator option: Mute player for 48 hours: <ON>";
  7153. } else {
  7154. class9.disabledColor = 0xffffff;
  7155. class9.disabledMessage = "Moderator option: Mute player for 48 hours: <OFF>";
  7156. }
  7157. } else {
  7158. class9.disabledMessage = "";
  7159. }
  7160. if(j == 650 || j == 655)
  7161. if(anInt1193 != 0)
  7162. {
  7163. String s;
  7164. if(daysSinceLastLogin == 0)
  7165. s = "earlier today";
  7166. else
  7167. if(daysSinceLastLogin == 1)
  7168. s = "yesterday";
  7169. else
  7170. s = daysSinceLastLogin + " days ago";
  7171. class9.disabledMessage = "You last logged in " + s + " from: " + signlink.dns;
  7172. } else
  7173. {
  7174. class9.disabledMessage = "";
  7175. }
  7176. if(j == 651)
  7177. {
  7178. if(unreadMessages == 0)
  7179. {
  7180. class9.disabledMessage = "0 unread messages";
  7181. class9.disabledColor = 0xffff00;
  7182. }
  7183. if(unreadMessages == 1)
  7184. {
  7185. class9.disabledMessage = "1 unread disabledMessage";
  7186. class9.disabledColor = 65280;
  7187. }
  7188. if(unreadMessages > 1)
  7189. {
  7190. class9.disabledMessage = unreadMessages + " unread messages";
  7191. class9.disabledColor = 65280;
  7192. }
  7193. }
  7194. if(j == 652)
  7195. if(daysSinceRecovChange == 201)
  7196. {
  7197. if(membersInt == 1)
  7198. class9.disabledMessage = "@yel@This is a non-members world: @whi@Since you are a member we";
  7199. else
  7200. class9.disabledMessage = "";
  7201. } else
  7202. if(daysSinceRecovChange == 200)
  7203. {
  7204. class9.disabledMessage = "You have not yet set any password recovery questions.";
  7205. } else
  7206. {
  7207. String s1;
  7208. if(daysSinceRecovChange == 0)
  7209. s1 = "Earlier today";
  7210. else
  7211. if(daysSinceRecovChange == 1)
  7212. s1 = "Yesterday";
  7213. else
  7214. s1 = daysSinceRecovChange + " days ago";
  7215. class9.disabledMessage = s1 + " you changed your recovery questions";
  7216. }
  7217. if(j == 653)
  7218. if(daysSinceRecovChange == 201)
  7219. {
  7220. if(membersInt == 1)
  7221. class9.disabledMessage = "@whi@recommend you use a members world instead. You may use";
  7222. else
  7223. class9.disabledMessage = "";
  7224. } else
  7225. if(daysSinceRecovChange == 200)
  7226. class9.disabledMessage = "We strongly recommend you do so now to secure your account.";
  7227. else
  7228. class9.disabledMessage = "If you do not remember making this change then cancel it immediately";
  7229. if(j == 654)
  7230. {
  7231. if(daysSinceRecovChange == 201)
  7232. if(membersInt == 1)
  7233. {
  7234. class9.disabledMessage = "@whi@this world but member benefits are unavailable whilst here.";
  7235. return;
  7236. } else
  7237. {
  7238. class9.disabledMessage = "";
  7239. return;
  7240. }
  7241. if(daysSinceRecovChange == 200)
  7242. {
  7243. class9.disabledMessage = "Do this from the 'account management' area on our front webpage";
  7244. return;
  7245. }
  7246. class9.disabledMessage = "Do this from the 'account management' area on our front webpage";
  7247. }
  7248. }
  7249.  
  7250. private void drawSplitPrivateChat()
  7251. {
  7252. if(splitPrivateChat == 0)
  7253. return;
  7254. RSFont textDrawingArea = aTextDrawingArea_1271;
  7255. int i = 0;
  7256. if(anInt1104 != 0)
  7257. i = 1;
  7258. for(int j = 0; j < 100; j++)
  7259. if(chatMessages[j] != null)
  7260. {
  7261. int k = chatTypes[j];
  7262. String s = chatNames[j];
  7263. byte byte1 = 0;
  7264. if(s != null && s.startsWith("@cr0@")) {
  7265. s = s.substring(5);
  7266. byte1 = 1;
  7267. }
  7268. if(s != null && s.startsWith("@cr1@")) {
  7269. s = s.substring(5);
  7270. byte1 = 2;
  7271. }
  7272. if(s != null && s.startsWith("@cr2@")) {
  7273. s = s.substring(5);
  7274. byte1 = 3;
  7275. }
  7276. if(s != null && s.startsWith("@cr3@")) {
  7277. s = s.substring(5);
  7278. byte1 = 4;
  7279. }
  7280. if(s != null && s.startsWith("@cr4@")) {
  7281. s = s.substring(5);
  7282. byte1 = 5;
  7283. }
  7284.  
  7285. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  7286. {
  7287. int l = 329 - i * 13;
  7288. int k1 = 4;
  7289. textDrawingArea.method385(0, "From", l, k1);
  7290. textDrawingArea.method385(65535, "From", l - 1, k1);
  7291. k1 += textDrawingArea.getTextWidth("From ");
  7292. if(byte1 == 1) {
  7293. modIcons[0].drawSprite(k1, l - 12);
  7294. k1 += 12;
  7295. }
  7296. if(byte1 == 2) {
  7297. modIcons[1].drawSprite(k1, l - 12);
  7298. k1 += 12;
  7299. }
  7300. if(byte1 == 3) {
  7301. modIcons[2].drawSprite(k1, l - 12);
  7302. k1 += 12;
  7303. }
  7304. if(byte1 == 4) {
  7305. modIcons[3].drawSprite(k1, l - 12);
  7306. k1 += 12;
  7307. }
  7308. if(byte1 == 5){
  7309. modIcons[4] = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/MODICONS 5.PNG", 1);
  7310. modIcons[4].drawSprite(k1, l - 12);
  7311. k1 += 12;
  7312. }
  7313. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  7314. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  7315. if(++i >= 5)
  7316. return;
  7317. }
  7318. if(k == 5 && privateChatMode < 2)
  7319. {
  7320. int i1 = 329 - i * 13;
  7321. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  7322. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  7323. if(++i >= 5)
  7324. return;
  7325. }
  7326. if(k == 6 && privateChatMode < 2)
  7327. {
  7328. int j1 = 329 - i * 13;
  7329. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  7330. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  7331. if(++i >= 5)
  7332. return;
  7333. }
  7334. }
  7335.  
  7336. }
  7337.  
  7338. public void pushMessage(String s, int i, String s1) {
  7339. if(i == 0 && dialogID != -1) {
  7340. aString844 = s;
  7341. super.clickMode3 = 0;
  7342. }
  7343. if(backDialogID == -1)
  7344. inputTaken = true;
  7345. for(int j = 499; j > 0; j--) {
  7346. chatTypes[j] = chatTypes[j - 1];
  7347. chatNames[j] = chatNames[j - 1];
  7348. chatMessages[j] = chatMessages[j - 1];
  7349. chatRights[j] = chatRights[j - 1];
  7350. }
  7351. chatTypes[0] = i;
  7352. chatNames[0] = s1;
  7353. chatMessages[0] = s;
  7354. chatRights[0] = rights;
  7355. }
  7356.  
  7357. public static void setTab(int id) {
  7358. needDrawTabArea = true;
  7359. tabID = id;
  7360. tabAreaAltered = true;
  7361. }
  7362. public int tabHPos;
  7363. private void processTabClick() {
  7364. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  7365. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128){
  7366. runHover = true;
  7367. } else {
  7368. runHover = false;
  7369. }
  7370. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52 && super.mouseY < 87){
  7371. prayHover = true;
  7372. } else {
  7373. prayHover = false;
  7374. }
  7375. if(super.mouseX >= 765-24 && super.mouseX <= 765 && super.mouseY >= 3 && super.mouseY <= 25){
  7376. logHover = true;
  7377. } else {
  7378. logHover = false;
  7379. }
  7380. }
  7381.  
  7382. if(is562 == false){
  7383. if(super.clickMode3 == 1) {
  7384. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  7385. {
  7386. needDrawTabArea = true;
  7387. tabID = 0;
  7388. tabAreaAltered = true;
  7389. }
  7390. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  7391. {
  7392. needDrawTabArea = true;
  7393. tabID = 1;
  7394. tabAreaAltered = true;
  7395. }
  7396. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  7397. {
  7398. needDrawTabArea = true;
  7399. tabID = 2;
  7400. tabAreaAltered = true;
  7401. }
  7402. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  7403. {
  7404. needDrawTabArea = true;
  7405. tabID = 3;
  7406. tabAreaAltered = true;
  7407. }
  7408. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  7409. {
  7410. needDrawTabArea = true;
  7411. tabID = 4;
  7412. tabAreaAltered = true;
  7413. }
  7414. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  7415. {
  7416. needDrawTabArea = true;
  7417. tabID = 5;
  7418. tabAreaAltered = true;
  7419. }
  7420. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  7421. {
  7422. needDrawTabArea = true;
  7423. tabID = 6;
  7424. tabAreaAltered = true;
  7425. }
  7426. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  7427. {
  7428. needDrawTabArea = true;
  7429. tabID = 7;
  7430. tabAreaAltered = true;
  7431. }
  7432. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  7433. {
  7434. needDrawTabArea = true;
  7435. tabID = 8;
  7436. tabAreaAltered = true;
  7437. }
  7438. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  7439. {
  7440. needDrawTabArea = true;
  7441. tabID = 9;
  7442. tabAreaAltered = true;
  7443. }
  7444. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
  7445. {
  7446. needDrawTabArea = true;
  7447. tabID = 10;
  7448. tabAreaAltered = true;
  7449. }
  7450. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  7451. {
  7452. needDrawTabArea = true;
  7453. tabID = 11;
  7454. tabAreaAltered = true;
  7455. }
  7456. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  7457. {
  7458. needDrawTabArea = true;
  7459. tabID = 12;
  7460. tabAreaAltered = true;
  7461. }
  7462. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  7463. {
  7464. needDrawTabArea = true;
  7465. tabID = 13;
  7466. tabAreaAltered = true;
  7467. }
  7468. }
  7469. } else {
  7470. if(super.mouseX >= 521 && super.mouseX <= 550 && super.mouseY >= 169 && super.mouseY < 205) {
  7471. tabHPos = 0;
  7472. needDrawTabArea = true;
  7473. tabAreaAltered = true;
  7474. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 168 && super.mouseY < 205) {
  7475. tabHPos = 1;
  7476. needDrawTabArea = true;
  7477. tabAreaAltered = true;
  7478. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 168 && super.mouseY < 205) {
  7479. tabHPos = 2;
  7480. needDrawTabArea = true;
  7481. tabAreaAltered = true;
  7482. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 168 && super.mouseY < 203) {
  7483. tabHPos = 3;
  7484. needDrawTabArea = true;
  7485. tabAreaAltered = true;
  7486. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 168 && super.mouseY < 205) {
  7487. tabHPos = 4;
  7488. needDrawTabArea = true;
  7489. tabAreaAltered = true;
  7490. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 168 && super.mouseY < 205) {
  7491. tabHPos = 5;
  7492. needDrawTabArea = true;
  7493. tabAreaAltered = true;
  7494. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 169 && super.mouseY < 205) {
  7495. tabHPos = 6;
  7496. needDrawTabArea = true;
  7497. tabAreaAltered = true;
  7498. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 169 && super.mouseY < 205) {
  7499. tabHPos = 7;
  7500. needDrawTabArea = true;
  7501. tabAreaAltered = true;
  7502. } else if(super.mouseX >= 522 && super.mouseX <= 551 && super.mouseY >= 466 && super.mouseY < 503) {
  7503. tabHPos = 15;
  7504. needDrawTabArea = true;
  7505. tabAreaAltered = true;
  7506. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 466 && super.mouseY < 503) {
  7507. tabHPos = 8;
  7508. needDrawTabArea = true;
  7509. tabAreaAltered = true;
  7510. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 466 && super.mouseY < 503) {
  7511. tabHPos = 9;
  7512. needDrawTabArea = true;
  7513. tabAreaAltered = true;
  7514. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 466 && super.mouseY < 503) {
  7515. tabHPos = 10;
  7516. needDrawTabArea = true;
  7517. tabAreaAltered = true;
  7518. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 466 && super.mouseY < 503) {
  7519. tabHPos = 11;
  7520. needDrawTabArea = true;
  7521. tabAreaAltered = true;
  7522. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 466 && super.mouseY < 503) {
  7523. tabHPos = 12;
  7524. needDrawTabArea = true;
  7525. tabAreaAltered = true;
  7526. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 466 && super.mouseY < 502) {
  7527. tabHPos = 13;
  7528. needDrawTabArea = true;
  7529. tabAreaAltered = true;
  7530. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 466 && super.mouseY < 502) {
  7531. tabHPos = 14;
  7532. needDrawTabArea = true;
  7533. tabAreaAltered = true;
  7534. } else {
  7535. tabHPos = -1;
  7536. needDrawTabArea = true;
  7537. tabAreaAltered = true;
  7538. }
  7539. if(super.clickMode3 == 1) {
  7540. if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1) {
  7541. needDrawTabArea = true;
  7542. tabID = 0;
  7543. tabAreaAltered = true;
  7544. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1) {
  7545. needDrawTabArea = true;
  7546. tabID = 1;
  7547. tabAreaAltered = true;
  7548. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1) {
  7549. needDrawTabArea = true;
  7550. tabID = 2;
  7551. tabAreaAltered = true;
  7552. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[14] != -1) {
  7553. needDrawTabArea = true;
  7554. tabID = 14;
  7555. tabAreaAltered = true;
  7556. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[3] != -1) {
  7557. needDrawTabArea = true;
  7558. tabID = 3;
  7559. tabAreaAltered = true;
  7560. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1) {
  7561. needDrawTabArea = true;
  7562. tabID = 4;
  7563. tabAreaAltered = true;
  7564. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1) {
  7565. needDrawTabArea = true;
  7566. tabID = 5;
  7567. tabAreaAltered = true;
  7568. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1) {
  7569. needDrawTabArea = true;
  7570. tabID = 6;
  7571. tabAreaAltered = true;
  7572. } else if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[16] != -1) {
  7573. needDrawTabArea = true;
  7574. tabID = 16;
  7575. tabAreaAltered = true;
  7576. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1) {
  7577. needDrawTabArea = true;
  7578. tabID = 8;
  7579. tabAreaAltered = true;
  7580. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1) {
  7581. needDrawTabArea = true;
  7582. tabID = 9;
  7583. tabAreaAltered = true;
  7584. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1) {
  7585. needDrawTabArea = true;
  7586. tabID = 7;
  7587. tabAreaAltered = true;
  7588. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1) {
  7589. needDrawTabArea = true;
  7590. tabID = 11;
  7591. tabAreaAltered = true;
  7592. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1) {
  7593. needDrawTabArea = true;
  7594. tabID = 12;
  7595. tabAreaAltered = true;
  7596. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1) {
  7597. needDrawTabArea = true;
  7598. tabID = 13;
  7599. tabAreaAltered = true;
  7600. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[15] != -1) {
  7601. needDrawTabArea = true;
  7602. tabID = 15;
  7603. tabAreaAltered = true;
  7604. }
  7605. /* Logout X */
  7606. else if(super.saveClickX >= 742 && super.saveClickX <= 764 && super.saveClickY >= 1 && super.saveClickY < 24 && tabInterfaceIDs[10] != -1) {
  7607. needDrawTabArea = true;
  7608. tabID = 10;
  7609. tabAreaAltered = true;
  7610. }
  7611.  
  7612. }
  7613. }
  7614. }
  7615.  
  7616. private void resetImageProducers2() {
  7617. if(chatBackImage != null)
  7618. return;
  7619. nullLoader();
  7620. super.fullGameScreen = null;
  7621. aRSImageProducer_1107 = null;
  7622. aRSImageProducer_1108 = null;
  7623. loginScreenArea = null;
  7624. leftSideFlame = null;
  7625. rightSideFlame = null;
  7626. gameLogo = null;
  7627. aRSImageProducer_1113 = null;
  7628. aRSImageProducer_1114 = null;
  7629. aRSImageProducer_1115 = null;
  7630. chatBackImage = new RSImageProducer(516, 165, getGameComponent());//519
  7631. mapBackImage = new RSImageProducer(249, 168, getGameComponent());//
  7632. DrawingArea.setAllPixelsToZero();
  7633. //mapBack.drawBackground(0, 0);
  7634. CustomMapback[getSpriteID()].drawSprite(0, 0);
  7635. inventoryBackImage = new RSImageProducer(250, 335, getGameComponent());
  7636. inGameScreen = new RSImageProducer(512, 334, getGameComponent());
  7637. DrawingArea.setAllPixelsToZero();
  7638. //aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  7639. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  7640. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  7641. welcomeScreenRaised = true;
  7642. }
  7643.  
  7644. public String getDocumentBaseHost() {
  7645. if (signlink.mainapp != null) {
  7646. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  7647. }
  7648. return null;
  7649. }
  7650.  
  7651. private void method81(Sprite sprite, int j, int k) {
  7652. int l = k * k + j * j;
  7653. if(l > 4225 && l < 0x15f90) {
  7654. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  7655. int j1 = Model.modelIntArray1[i1];
  7656. int k1 = Model.modelIntArray2[i1];
  7657. j1 = (j1 * 256) / (minimapInt3 + 256);
  7658. k1 = (k1 * 256) / (minimapInt3 + 256);
  7659. int l1 = j * j1 + k * k1 >> 16;
  7660. int i2 = j * k1 - k * j1 >> 16;
  7661. double d = Math.atan2(l1, i2);
  7662. int j2 = (int)(Math.sin(d) * 63D);
  7663. int k2 = (int)(Math.cos(d) * 57D);
  7664. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  7665. CustomMapback[getSpriteID()].drawSprite(0, 0);
  7666. return;
  7667. } else {
  7668. markMinimap(sprite, k, j, false);
  7669. CustomMapback[getSpriteID()].drawSprite(0, 0);
  7670. }
  7671. }
  7672.  
  7673. public void processRightClick() {
  7674. if (activeInterfaceType != 0) {
  7675. return;
  7676. }
  7677. menuActionName[0] = "Cancel";
  7678. menuActionID[0] = 1107;
  7679. menuActionRow = 1;
  7680. if (fullscreenInterfaceID != -1) {
  7681. anInt886 = 0;
  7682. anInt1315 = 0;
  7683. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  7684. if (anInt886 != anInt1026) {
  7685. anInt1026 = anInt886;
  7686. }
  7687. if (anInt1315 != anInt1129) {
  7688. anInt1129 = anInt1315;
  7689. }
  7690. return;
  7691. }
  7692. buildSplitPrivateChatMenu();
  7693. anInt886 = 0;
  7694. anInt1315 = 0;
  7695. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  7696. if (openInterfaceID != -1) {
  7697. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  7698. } else {
  7699. build3dScreenMenu();
  7700. }
  7701. }
  7702. if (anInt886 != anInt1026) {
  7703. anInt1026 = anInt886;
  7704. }
  7705. if (anInt1315 != anInt1129) {
  7706. anInt1129 = anInt1315;
  7707. }
  7708. anInt886 = 0;
  7709. anInt1315 = 0;
  7710. if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  7711. if(invOverlayInterfaceID != -1) {
  7712. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  7713. } else if(tabInterfaceIDs[tabID] != -1) {
  7714. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  7715. }
  7716. }
  7717. if (anInt886 != anInt1048) {
  7718. needDrawTabArea = true;
  7719. tabAreaAltered = true;
  7720. anInt1048 = anInt886;
  7721. }
  7722. if (anInt1315 != anInt1044) {
  7723. needDrawTabArea = true;
  7724. tabAreaAltered = true;
  7725. anInt1044 = anInt1315;
  7726. }
  7727. anInt886 = 0;
  7728. anInt1315 = 0;
  7729. if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  7730. if(backDialogID != -1) {
  7731. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  7732. } else if(super.mouseY < 463 && super.mouseX < 490) {
  7733. buildChatAreaMenu(super.mouseY - 338);
  7734. }
  7735. }
  7736. if (backDialogID != -1 && anInt886 != anInt1039) {
  7737. inputTaken = true;
  7738. anInt1039 = anInt886;
  7739. }
  7740. if (backDialogID != -1 && anInt1315 != anInt1500) {
  7741. inputTaken = true;
  7742. anInt1500 = anInt1315;
  7743. }
  7744. /** Custom menu drawing */
  7745. rightClickChatButtons();
  7746. determineTopTabs();
  7747. determineBottomTabs();
  7748.  
  7749. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  7750. processMinimapActions();
  7751. }
  7752.  
  7753. boolean flag = false;
  7754. while (!flag) {
  7755. flag = true;
  7756. for (int j = 0; j < menuActionRow - 1; j++) {
  7757. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  7758. String s = menuActionName[j];
  7759. menuActionName[j] = menuActionName[j + 1];
  7760. menuActionName[j + 1] = s;
  7761. int k = menuActionID[j];
  7762. menuActionID[j] = menuActionID[j + 1];
  7763. menuActionID[j + 1] = k;
  7764. k = menuActionCmd2[j];
  7765. menuActionCmd2[j] = menuActionCmd2[j + 1];
  7766. menuActionCmd2[j + 1] = k;
  7767. k = menuActionCmd3[j];
  7768. menuActionCmd3[j] = menuActionCmd3[j + 1];
  7769. menuActionCmd3[j + 1] = k;
  7770. k = menuActionCmd1[j];
  7771. menuActionCmd1[j] = menuActionCmd1[j + 1];
  7772. menuActionCmd1[j + 1] = k;
  7773. flag = false;
  7774. }
  7775. }
  7776. }
  7777. }
  7778.  
  7779. private int method83(int i, int j, int k)
  7780. {
  7781. int l = 256 - k;
  7782. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  7783. }
  7784.  
  7785. private void login(String s, String s1, boolean flag)
  7786. {
  7787. signlink.errorname = s;
  7788. try
  7789. {
  7790. if(!flag)
  7791. {
  7792. loginMessage1 = "";
  7793. loginMessage2 = "@gre@Connecting to server...";
  7794. drawLoginScreen(true);
  7795. }
  7796. socketStream = new RSSocket(this, openSocket(43594));
  7797. long l = TextClass.longForName(s);
  7798. int i = (int)(l >> 16 & 31L);
  7799. stream.currentOffset = 0;
  7800. stream.writeWordBigEndian(14);
  7801. stream.writeWordBigEndian(i);
  7802. socketStream.queueBytes(2, stream.buffer);
  7803. for(int j = 0; j < 8; j++)
  7804. socketStream.read();
  7805.  
  7806. int k = socketStream.read();
  7807. int i1 = k;
  7808. if(k == 0)
  7809. {
  7810. socketStream.flushInputStream(inStream.buffer, 8);
  7811. inStream.currentOffset = 0;
  7812. aLong1215 = inStream.readQWord();
  7813. int ai[] = new int[4];
  7814. ai[0] = (int)(Math.random() * 99999999D);
  7815. ai[1] = (int)(Math.random() * 99999999D);
  7816. ai[2] = (int)(aLong1215 >> 32);
  7817. ai[3] = (int)aLong1215;
  7818. stream.currentOffset = 0;
  7819. stream.writeWordBigEndian(10);
  7820. stream.writeDWord(ai[0]);
  7821. stream.writeDWord(ai[1]);
  7822. stream.writeDWord(ai[2]);
  7823. stream.writeDWord(ai[3]);
  7824. stream.writeDWord(Integer.parseInt("9632"));
  7825. //stream.writeDWord(signlink.uid);
  7826. stream.writeString(s);
  7827. stream.writeString(s1);
  7828. stream.doKeys();
  7829. aStream_847.currentOffset = 0;
  7830. if(flag)
  7831. aStream_847.writeWordBigEndian(18);
  7832. else
  7833. aStream_847.writeWordBigEndian(16);
  7834. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  7835. aStream_847.writeWordBigEndian(255);
  7836. aStream_847.writeWord(317);
  7837. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  7838. for(int l1 = 0; l1 < 9; l1++)
  7839. aStream_847.writeDWord(expectedCRCs[l1]);
  7840.  
  7841. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  7842. stream.encryption = new ISAACRandomGen(ai);
  7843. for(int j2 = 0; j2 < 4; j2++)
  7844. ai[j2] += 50;
  7845.  
  7846. encryption = new ISAACRandomGen(ai);
  7847. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  7848. k = socketStream.read();
  7849. }
  7850. if(k == 1)
  7851. {
  7852. try
  7853. {
  7854. Thread.sleep(2000L);
  7855. }
  7856. catch(Exception _ex) { }
  7857. login(s, s1, flag);
  7858. return;
  7859. }
  7860. if(k == 2)
  7861. {
  7862. myPrivilege = socketStream.read();
  7863. flagged = socketStream.read() == 1;
  7864. aLong1220 = 0L;
  7865. anInt1022 = 0;
  7866. mouseDetection.coordsIndex = 0;
  7867. super.awtFocus = true;
  7868. aBoolean954 = true;
  7869. loggedIn = true;
  7870. stream.currentOffset = 0;
  7871. inStream.currentOffset = 0;
  7872. pktType = -1;
  7873. anInt841 = -1;
  7874. anInt842 = -1;
  7875. anInt843 = -1;
  7876. pktSize = 0;
  7877. anInt1009 = 0;
  7878. anInt1104 = 0;
  7879. anInt1011 = 0;
  7880. anInt855 = 0;
  7881. menuActionRow = 0;
  7882. menuOpen = false;
  7883. super.idleTime = 0;
  7884. for(int j1 = 0; j1 < 100; j1++)
  7885. chatMessages[j1] = null;
  7886.  
  7887. itemSelected = 0;
  7888. spellSelected = 0;
  7889. loadingStage = 0;
  7890. anInt1062 = 0;
  7891. anInt1278 = (int)(Math.random() * 100D) - 50;
  7892. anInt1131 = (int)(Math.random() * 110D) - 55;
  7893. anInt896 = (int)(Math.random() * 80D) - 40;
  7894. minimapInt2 = (int)(Math.random() * 120D) - 60;
  7895. minimapInt3 = (int)(Math.random() * 30D) - 20;
  7896. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  7897. anInt1021 = 0;
  7898. anInt985 = -1;
  7899. destX = 0;
  7900. destY = 0;
  7901. playerCount = 0;
  7902. npcCount = 0;
  7903. for(int i2 = 0; i2 < maxPlayers; i2++)
  7904. {
  7905. playerArray[i2] = null;
  7906. aStreamArray895s[i2] = null;
  7907. }
  7908. for(int lw = 0; lw < 10; lw++)
  7909. {
  7910. loginPackets[lw] = 0;
  7911. }
  7912.  
  7913. for(int k2 = 0; k2 < 16384; k2++)
  7914. npcArray[k2] = null;
  7915.  
  7916. myPlayer = playerArray[myPlayerIndex] = new Player();
  7917. aClass19_1013.removeAll();
  7918. aClass19_1056.removeAll();
  7919. for(int l2 = 0; l2 < 4; l2++)
  7920. {
  7921. for(int i3 = 0; i3 < 104; i3++)
  7922. {
  7923. for(int k3 = 0; k3 < 104; k3++)
  7924. groundArray[l2][i3][k3] = null;
  7925.  
  7926. }
  7927.  
  7928. }
  7929. aClass19_1179 = new NodeList();
  7930. fullscreenInterfaceID = -1;
  7931. anInt900 = 0;
  7932. friendsCount = 0;
  7933. dialogID = -1;
  7934. backDialogID = -1;
  7935. openInterfaceID = -1;
  7936. invOverlayInterfaceID = -1;
  7937. anInt1018 = -1;
  7938. aBoolean1149 = false;
  7939. tabID = 3;
  7940. inputDialogState = 0;
  7941. menuOpen = false;
  7942. messagePromptRaised = false;
  7943. aString844 = null;
  7944. anInt1055 = 0;
  7945. anInt1054 = -1;
  7946. aBoolean1047 = true;
  7947. method45();
  7948. welcome();
  7949. for(int j3 = 0; j3 < 5; j3++)
  7950. anIntArray990[j3] = 0;
  7951.  
  7952. for(int l3 = 0; l3 < 5; l3++)
  7953. {
  7954. atPlayerActions[l3] = null;
  7955. atPlayerArray[l3] = false;
  7956. }
  7957.  
  7958. anInt1175 = 0;
  7959. anInt1134 = 0;
  7960. anInt986 = 0;
  7961. anInt1288 = 0;
  7962. anInt924 = 0;
  7963. anInt1188 = 0;
  7964. anInt1155 = 0;
  7965. anInt1226 = 0;
  7966. int anInt941 = 0;
  7967. int anInt1260 = 0;
  7968. resetImageProducers2();
  7969. return;
  7970. }
  7971. if(k == 3)
  7972. {
  7973. loginMessage1 = "";
  7974. loginMessage2 = "@gre@Invalid username or password.";
  7975. return;
  7976. }
  7977. if(k == 4)
  7978. {
  7979. loginMessage1 = "@gre@Your account has been disabled.";
  7980. loginMessage2 = "@gre@Please check your disabledMessage-center for details.";
  7981. return;
  7982. }
  7983. if(k == 5)
  7984. {
  7985. loginMessage1 = "@gre@Your account is already logged in.";
  7986. loginMessage2 = "@gre@Try again in 60 secs...";
  7987. return;
  7988. }
  7989. if(k == 6)
  7990. {
  7991. loginMessage1 = "@gre@ProjectNero has been updated!";
  7992. loginMessage2 = "@gre@Please reload this page.";
  7993. return;
  7994. }
  7995. if(k == 7)
  7996. {
  7997. loginMessage1 = "@gre@This world is full.";
  7998. loginMessage2 = "@gre@Please use a different world.";
  7999. return;
  8000. }
  8001. if(k == 8)
  8002. {
  8003. loginMessage1 = "@gre@Unable to connect.";
  8004. loginMessage2 = "@gre@Login server offline.";
  8005. return;
  8006. }
  8007. if(k == 9)
  8008. {
  8009. loginMessage1 = "@gre@Login limit exceeded.";
  8010. loginMessage2 = "@gre@Too many connections from your address.";
  8011. return;
  8012. }
  8013. if(k == 10)
  8014. {
  8015. loginMessage1 = "@gre@Unable to connect.";
  8016. loginMessage2 = "@gre@Bad session id.";
  8017. return;
  8018. }
  8019. if(k == 11)
  8020. {
  8021. loginMessage2 = "@gre@Login server rejected session.";
  8022. loginMessage2 = "@gre@Please try again.";
  8023. return;
  8024. }
  8025. if(k == 12)
  8026. {
  8027. loginMessage1 = "@gre@You need a members account to login to this world.";
  8028. loginMessage2 = "@gre@Please subscribe, or use a different world.";
  8029. return;
  8030. }
  8031. if(k == 13)
  8032. {
  8033. loginMessage1 = "@gre@Could not complete login.";
  8034. loginMessage2 = "@gre@Please try using a different world.";
  8035. return;
  8036. }
  8037. if(k == 14)
  8038. {
  8039. loginMessage1 = "@gre@The server is being updated.";
  8040. loginMessage2 = "@gre@Please wait 1 minute and try again.";
  8041. return;
  8042. }
  8043. if(k == 15)
  8044. {
  8045. loggedIn = true;
  8046. stream.currentOffset = 0;
  8047. inStream.currentOffset = 0;
  8048. pktType = -1;
  8049. anInt841 = -1;
  8050. anInt842 = -1;
  8051. anInt843 = -1;
  8052. pktSize = 0;
  8053. anInt1009 = 0;
  8054. anInt1104 = 0;
  8055. menuActionRow = 0;
  8056. menuOpen = false;
  8057. aLong824 = System.currentTimeMillis();
  8058. return;
  8059. }
  8060. if(k == 16)
  8061. {
  8062. loginMessage1 = "@gre@Login attempts exceeded.";
  8063. loginMessage2 = "@gre@Please wait 1 minute and try again.";
  8064. return;
  8065. }
  8066. if(k == 17)
  8067. {
  8068. loginMessage1 = "@gre@You are standing in a members-only area.";
  8069. loginMessage2 = "@gre@To play on this world move to a free area first";
  8070. return;
  8071. }
  8072. if(k == 20)
  8073. {
  8074. loginMessage1 = "@gre@Invalid loginserver requested";
  8075. loginMessage2 = "@gre@Please try using a different world.";
  8076. return;
  8077. }
  8078. if(k == 21)
  8079. {
  8080. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  8081. {
  8082. loginMessage1 = "@gre@You have only just left another world";
  8083. loginMessage2 = "@gre@Your profile will be transferred in: " + k1 + " seconds";
  8084. drawLoginScreen(true);
  8085. try
  8086. {
  8087. Thread.sleep(1000L);
  8088. }
  8089. catch(Exception _ex) { }
  8090. }
  8091.  
  8092. login(s, s1, flag);
  8093. return;
  8094. }
  8095. if(k == -1)
  8096. {
  8097. if(i1 == 0)
  8098. {
  8099. if(loginFailures < 2)
  8100. {
  8101. try
  8102. {
  8103. Thread.sleep(2000L);
  8104. }
  8105. catch(Exception _ex) { }
  8106. loginFailures++;
  8107. login(s, s1, flag);
  8108. return;
  8109. } else
  8110. {
  8111. loginMessage1 = "@gre@No response from login server";
  8112. loginMessage2 = "@gre@Please wait 1 minute and try again.";
  8113. return;
  8114. }
  8115. } else
  8116. {
  8117. loginMessage1 = "@gre@Too many failed attempts.";
  8118. loginMessage2 = "@gre@You won't be able to log in, untill server restarts.";
  8119. return;
  8120. }
  8121. } else
  8122. {
  8123. System.out.println("response:" + k);
  8124. loginMessage1 = "@gre@Unexpected server response";
  8125. loginMessage2 = "@gre@Please try restarting client.";
  8126. return;
  8127. }
  8128. }
  8129. catch(IOException _ex)
  8130. {
  8131. loginMessage1 = "";
  8132. }
  8133. loginMessage2 = "@gre@Error connecting to server.";
  8134. }
  8135.  
  8136. 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) {
  8137. byte byte0 = 104;
  8138. byte byte1 = 104;
  8139. for(int l2 = 0; l2 < byte0; l2++) {
  8140. for(int i3 = 0; i3 < byte1; i3++) {
  8141. anIntArrayArray901[l2][i3] = 0;
  8142. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  8143. }
  8144. }
  8145. int j3 = j2;
  8146. int k3 = j1;
  8147. anIntArrayArray901[j2][j1] = 99;
  8148. anIntArrayArray825[j2][j1] = 0;
  8149. int l3 = 0;
  8150. int i4 = 0;
  8151. bigX[l3] = j2;
  8152. bigY[l3++] = j1;
  8153. boolean flag1 = false;
  8154. int j4 = bigX.length;
  8155. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  8156. while(i4 != l3)
  8157. {
  8158. j3 = bigX[i4];
  8159. k3 = bigY[i4];
  8160. i4 = (i4 + 1) % j4;
  8161. if(j3 == k2 && k3 == i2)
  8162. {
  8163. flag1 = true;
  8164. break;
  8165. }
  8166. if(i1 != 0)
  8167. {
  8168. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  8169. {
  8170. flag1 = true;
  8171. break;
  8172. }
  8173. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  8174. {
  8175. flag1 = true;
  8176. break;
  8177. }
  8178. }
  8179. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  8180. {
  8181. flag1 = true;
  8182. break;
  8183. }
  8184. int l4 = anIntArrayArray825[j3][k3] + 1;
  8185. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  8186. {
  8187. bigX[l3] = j3 - 1;
  8188. bigY[l3] = k3;
  8189. l3 = (l3 + 1) % j4;
  8190. anIntArrayArray901[j3 - 1][k3] = 2;
  8191. anIntArrayArray825[j3 - 1][k3] = l4;
  8192. }
  8193. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  8194. {
  8195. bigX[l3] = j3 + 1;
  8196. bigY[l3] = k3;
  8197. l3 = (l3 + 1) % j4;
  8198. anIntArrayArray901[j3 + 1][k3] = 8;
  8199. anIntArrayArray825[j3 + 1][k3] = l4;
  8200. }
  8201. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  8202. {
  8203. bigX[l3] = j3;
  8204. bigY[l3] = k3 - 1;
  8205. l3 = (l3 + 1) % j4;
  8206. anIntArrayArray901[j3][k3 - 1] = 1;
  8207. anIntArrayArray825[j3][k3 - 1] = l4;
  8208. }
  8209. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  8210. {
  8211. bigX[l3] = j3;
  8212. bigY[l3] = k3 + 1;
  8213. l3 = (l3 + 1) % j4;
  8214. anIntArrayArray901[j3][k3 + 1] = 4;
  8215. anIntArrayArray825[j3][k3 + 1] = l4;
  8216. }
  8217. 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)
  8218. {
  8219. bigX[l3] = j3 - 1;
  8220. bigY[l3] = k3 - 1;
  8221. l3 = (l3 + 1) % j4;
  8222. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  8223. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  8224. }
  8225. 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)
  8226. {
  8227. bigX[l3] = j3 + 1;
  8228. bigY[l3] = k3 - 1;
  8229. l3 = (l3 + 1) % j4;
  8230. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  8231. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  8232. }
  8233. 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)
  8234. {
  8235. bigX[l3] = j3 - 1;
  8236. bigY[l3] = k3 + 1;
  8237. l3 = (l3 + 1) % j4;
  8238. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  8239. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  8240. }
  8241. 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)
  8242. {
  8243. bigX[l3] = j3 + 1;
  8244. bigY[l3] = k3 + 1;
  8245. l3 = (l3 + 1) % j4;
  8246. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  8247. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  8248. }
  8249. }
  8250. anInt1264 = 0;
  8251. if(!flag1)
  8252. {
  8253. if(flag)
  8254. {
  8255. int i5 = 100;
  8256. for(int k5 = 1; k5 < 2; k5++)
  8257. {
  8258. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  8259. {
  8260. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  8261. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  8262. {
  8263. i5 = anIntArrayArray825[i6][l6];
  8264. j3 = i6;
  8265. k3 = l6;
  8266. anInt1264 = 1;
  8267. flag1 = true;
  8268. }
  8269.  
  8270. }
  8271.  
  8272. if(flag1)
  8273. break;
  8274. }
  8275.  
  8276. }
  8277. if(!flag1)
  8278. return false;
  8279. }
  8280. i4 = 0;
  8281. bigX[i4] = j3;
  8282. bigY[i4++] = k3;
  8283. int l5;
  8284. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  8285. {
  8286. if(j5 != l5)
  8287. {
  8288. l5 = j5;
  8289. bigX[i4] = j3;
  8290. bigY[i4++] = k3;
  8291. }
  8292. if((j5 & 2) != 0)
  8293. j3++;
  8294. else
  8295. if((j5 & 8) != 0)
  8296. j3--;
  8297. if((j5 & 1) != 0)
  8298. k3++;
  8299. else
  8300. if((j5 & 4) != 0)
  8301. k3--;
  8302. }
  8303. // if(cancelWalk) { return i4 > 0; }
  8304.  
  8305.  
  8306. if(i4 > 0)
  8307. {
  8308. int k4 = i4;
  8309. if(k4 > 25)
  8310. k4 = 25;
  8311. i4--;
  8312. int k6 = bigX[i4];
  8313. int i7 = bigY[i4];
  8314. anInt1288 += k4;
  8315. if(anInt1288 >= 92 || loginPackets[6] != 10)
  8316. {
  8317. stream.createFrame(36);
  8318. stream.writeDWord(0);
  8319. loginPackets[6] = 10;
  8320. anInt1288 = 0;
  8321. }
  8322. if(i == 0)
  8323. {
  8324. stream.createFrame(164);
  8325. stream.writeWordBigEndian(k4 + k4 + 3);
  8326. }
  8327. if(i == 1)
  8328. {
  8329. stream.createFrame(248);
  8330. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  8331. }
  8332. if(i == 2)
  8333. {
  8334. stream.createFrame(98);
  8335. stream.writeWordBigEndian(k4 + k4 + 3);
  8336. }
  8337. stream.method433(k6 + baseX);
  8338. destX = bigX[0];
  8339. destY = bigY[0];
  8340. for(int j7 = 1; j7 < k4; j7++)
  8341. {
  8342. i4--;
  8343. stream.writeWordBigEndian(bigX[i4] - k6);
  8344. stream.writeWordBigEndian(bigY[i4] - i7);
  8345. }
  8346.  
  8347. stream.method431(i7 + baseY);
  8348. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  8349. return true;
  8350. }
  8351. return i != 1;
  8352. }
  8353.  
  8354. private void method86(Stream stream)
  8355. {
  8356. for(int j = 0; j < anInt893; j++)
  8357. {
  8358. int k = anIntArray894[j];
  8359. NPC npc = npcArray[k];
  8360. int l = stream.readUnsignedByte();
  8361. if((l & 0x10) != 0)
  8362. {
  8363. int i1 = stream.method434();
  8364. if(i1 == 65535)
  8365. i1 = -1;
  8366. int i2 = stream.readUnsignedByte();
  8367. if(i1 == npc.anim && i1 != -1)
  8368. {
  8369. int l2 = Animation.anims[i1].anInt365;
  8370. if(l2 == 1)
  8371. {
  8372. npc.anInt1527 = 0;
  8373. npc.anInt1528 = 0;
  8374. npc.anInt1529 = i2;
  8375. npc.anInt1530 = 0;
  8376. }
  8377. if(l2 == 2)
  8378. npc.anInt1530 = 0;
  8379. } else
  8380. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  8381. {
  8382. npc.anim = i1;
  8383. npc.anInt1527 = 0;
  8384. npc.anInt1528 = 0;
  8385. npc.anInt1529 = i2;
  8386. npc.anInt1530 = 0;
  8387. npc.anInt1542 = npc.smallXYIndex;
  8388. }
  8389. }
  8390. if((l & 8) != 0)
  8391. {
  8392. int j1 = stream.method426();
  8393. int j2 = stream.method427();
  8394. npc.updateHitData(j2, j1, loopCycle);
  8395. npc.loopCycleStatus = loopCycle + 300;
  8396. npc.currentHealth = stream.method426();
  8397. npc.maxHealth = stream.readUnsignedByte();
  8398. }
  8399. if((l & 0x80) != 0)
  8400. {
  8401. npc.anInt1520 = stream.readUnsignedWord();
  8402. int k1 = stream.readDWord();
  8403. npc.anInt1524 = k1 >> 16;
  8404. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  8405. npc.anInt1521 = 0;
  8406. npc.anInt1522 = 0;
  8407. if(npc.anInt1523 > loopCycle)
  8408. npc.anInt1521 = -1;
  8409. if(npc.anInt1520 == 65535)
  8410. npc.anInt1520 = -1;
  8411. }
  8412. if((l & 0x20) != 0)
  8413. {
  8414. npc.interactingEntity = stream.readUnsignedWord();
  8415. if(npc.interactingEntity == 65535)
  8416. npc.interactingEntity = -1;
  8417. }
  8418. if((l & 1) != 0)
  8419. {
  8420. npc.textSpoken = stream.readString();
  8421. npc.textCycle = 100;
  8422. // entityMessage(npc);
  8423.  
  8424. }
  8425. if((l & 0x40) != 0)
  8426. {
  8427. int l1 = stream.method427();
  8428. int k2 = stream.method428();
  8429. npc.updateHitData(k2, l1, loopCycle);
  8430. npc.loopCycleStatus = loopCycle + 300;
  8431. npc.currentHealth = stream.method428();
  8432. npc.maxHealth = stream.method427();
  8433. }
  8434. if((l & 2) != 0)
  8435. {
  8436. npc.desc = EntityDef.forID(stream.method436());
  8437. npc.anInt1540 = npc.desc.aByte68;
  8438. npc.anInt1504 = npc.desc.anInt79;
  8439. npc.anInt1554 = npc.desc.anInt67;
  8440. npc.anInt1555 = npc.desc.anInt58;
  8441. npc.anInt1556 = npc.desc.anInt83;
  8442. npc.anInt1557 = npc.desc.anInt55;
  8443. npc.anInt1511 = npc.desc.anInt77;
  8444. }
  8445. if((l & 4) != 0)
  8446. {
  8447. npc.anInt1538 = stream.method434();
  8448. npc.anInt1539 = stream.method434();
  8449. }
  8450. }
  8451. }
  8452.  
  8453. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  8454. {
  8455. if(menuActionRow >= 400)
  8456. return;
  8457. if(entityDef.childrenIDs != null)
  8458. entityDef = entityDef.method161();
  8459. if(entityDef == null)
  8460. return;
  8461. if(!entityDef.aBoolean84)
  8462. return;
  8463. String s = entityDef.name;
  8464. if(entityDef.combatLevel != 0)
  8465. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  8466. if(itemSelected == 1)
  8467. {
  8468. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  8469. menuActionID[menuActionRow] = 582;
  8470. menuActionCmd1[menuActionRow] = i;
  8471. menuActionCmd2[menuActionRow] = k;
  8472. menuActionCmd3[menuActionRow] = j;
  8473. menuActionRow++;
  8474. return;
  8475. }
  8476. if(spellSelected == 1)
  8477. {
  8478. if((spellUsableOn & 2) == 2)
  8479. {
  8480. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  8481. menuActionID[menuActionRow] = 413;
  8482. menuActionCmd1[menuActionRow] = i;
  8483. menuActionCmd2[menuActionRow] = k;
  8484. menuActionCmd3[menuActionRow] = j;
  8485. menuActionRow++;
  8486. }
  8487. } else
  8488. {
  8489. if(entityDef.itemActions != null)
  8490. {
  8491. for(int l = 4; l >= 0; l--)
  8492. if(entityDef.itemActions[l] != null && !entityDef.itemActions[l].equalsIgnoreCase("attack"))
  8493. {
  8494. menuActionName[menuActionRow] = entityDef.itemActions[l] + " @yel@" + s;
  8495. if(l == 0)
  8496. menuActionID[menuActionRow] = 20;
  8497. if(l == 1)
  8498. menuActionID[menuActionRow] = 412;
  8499. if(l == 2)
  8500. menuActionID[menuActionRow] = 225;
  8501. if(l == 3)
  8502. menuActionID[menuActionRow] = 965;
  8503. if(l == 4)
  8504. menuActionID[menuActionRow] = 478;
  8505. menuActionCmd1[menuActionRow] = i;
  8506. menuActionCmd2[menuActionRow] = k;
  8507. menuActionCmd3[menuActionRow] = j;
  8508. menuActionRow++;
  8509. }
  8510.  
  8511. }
  8512. if(entityDef.itemActions != null)
  8513. {
  8514. for(int i1 = 4; i1 >= 0; i1--)
  8515. if(entityDef.itemActions[i1] != null && entityDef.itemActions[i1].equalsIgnoreCase("attack"))
  8516. {
  8517. char c = '\0';
  8518. if(entityDef.combatLevel > myPlayer.combatLevel)
  8519. c = '\u07D0';
  8520. menuActionName[menuActionRow] = entityDef.itemActions[i1] + " @yel@" + s;
  8521. if(i1 == 0)
  8522. menuActionID[menuActionRow] = 20 + c;
  8523. if(i1 == 1)
  8524. menuActionID[menuActionRow] = 412 + c;
  8525. if(i1 == 2)
  8526. menuActionID[menuActionRow] = 225 + c;
  8527. if(i1 == 3)
  8528. menuActionID[menuActionRow] = 965 + c;
  8529. if(i1 == 4)
  8530. menuActionID[menuActionRow] = 478 + c;
  8531. menuActionCmd1[menuActionRow] = i;
  8532. menuActionCmd2[menuActionRow] = k;
  8533. menuActionCmd3[menuActionRow] = j;
  8534. menuActionRow++;
  8535. }
  8536.  
  8537. }
  8538. if(idToggle == true) {
  8539. menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.interfaceType + "@gre@)";
  8540. } else {
  8541. menuActionName[menuActionRow] = "Examine @yel@" + s;
  8542. }
  8543. menuActionID[menuActionRow] = 1025;
  8544. menuActionCmd1[menuActionRow] = i;
  8545. menuActionCmd2[menuActionRow] = k;
  8546. menuActionCmd3[menuActionRow] = j;
  8547. menuActionRow++;
  8548. }
  8549. }
  8550.  
  8551. private void nullLoader()
  8552. {
  8553. aBoolean831 = false;
  8554.  
  8555. while (drawingFlames) {
  8556. aBoolean831 = false;
  8557. try {
  8558. Thread.sleep(50L);
  8559. } catch (Exception _ex) {
  8560. }
  8561. }
  8562. titleBox = null;
  8563. titleButton = null;
  8564. aBackgroundArray1152s = null;
  8565. anIntArray850 = null;
  8566. anIntArray851 = null;
  8567. anIntArray852 = null;
  8568. anIntArray853 = null;
  8569. anIntArray1190 = null;
  8570. anIntArray1191 = null;
  8571. anIntArray828 = null;
  8572. anIntArray829 = null;
  8573. //aClass30_Sub2_Sub1_Sub1_1201 = null;
  8574. //aClass30_Sub2_Sub1_Sub1_1202 = null;
  8575. }
  8576.  
  8577. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  8578. {
  8579. if(player == myPlayer)
  8580. return;
  8581. if(menuActionRow >= 400)
  8582. return;
  8583. String s;
  8584. if(player.skill == 0)
  8585. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  8586. else
  8587. s = player.name + " (skill-" + player.skill + ")";
  8588. if(itemSelected == 1)
  8589. {
  8590. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @whi@" + s;
  8591. menuActionID[menuActionRow] = 491;
  8592. menuActionCmd1[menuActionRow] = j;
  8593. menuActionCmd2[menuActionRow] = i;
  8594. menuActionCmd3[menuActionRow] = k;
  8595. menuActionRow++;
  8596. } else
  8597. if(spellSelected == 1)
  8598. {
  8599. if((spellUsableOn & 8) == 8)
  8600. {
  8601. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  8602. menuActionID[menuActionRow] = 365;
  8603. menuActionCmd1[menuActionRow] = j;
  8604. menuActionCmd2[menuActionRow] = i;
  8605. menuActionCmd3[menuActionRow] = k;
  8606. menuActionRow++;
  8607. }
  8608. } else
  8609. {
  8610. for(int l = 4; l >= 0; l--)
  8611. if(atPlayerActions[l] != null)
  8612. {
  8613. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  8614. char c = '\0';
  8615. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  8616. {
  8617. if(player.combatLevel > myPlayer.combatLevel)
  8618. c = '\u07D0';
  8619. if(myPlayer.team != 0 && player.team != 0)
  8620. if(myPlayer.team == player.team)
  8621. c = '\u07D0';
  8622. else
  8623. c = '\0';
  8624. } else
  8625. if(atPlayerArray[l])
  8626. c = '\u07D0';
  8627. if(l == 0)
  8628. menuActionID[menuActionRow] = 561 + c;
  8629. if(l == 1)
  8630. menuActionID[menuActionRow] = 779 + c;
  8631. if(l == 2)
  8632. menuActionID[menuActionRow] = 27 + c;
  8633. if(l == 3)
  8634. menuActionID[menuActionRow] = 577 + c;
  8635. if(l == 4)
  8636. menuActionID[menuActionRow] = 729 + c;
  8637. menuActionCmd1[menuActionRow] = j;
  8638. menuActionCmd2[menuActionRow] = i;
  8639. menuActionCmd3[menuActionRow] = k;
  8640. menuActionRow++;
  8641. }
  8642.  
  8643. }
  8644. for(int i1 = 0; i1 < menuActionRow; i1++)
  8645. if(menuActionID[i1] == 516)
  8646. {
  8647. menuActionName[i1] = "Walk here @whi@" + s;
  8648. return;
  8649. }
  8650.  
  8651. }
  8652.  
  8653. private void method89(Class30_Sub1 class30_sub1)
  8654. {
  8655. int i = 0;
  8656. int j = -1;
  8657. int k = 0;
  8658. int l = 0;
  8659. if(class30_sub1.anInt1296 == 0)
  8660. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8661. if(class30_sub1.anInt1296 == 1)
  8662. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8663. if(class30_sub1.anInt1296 == 2)
  8664. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8665. if(class30_sub1.anInt1296 == 3)
  8666. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8667. if(i != 0)
  8668. {
  8669. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  8670. j = i >> 14 & 0x7fff;
  8671. k = i1 & 0x1f;
  8672. l = i1 >> 6;
  8673. }
  8674. class30_sub1.anInt1299 = j;
  8675. class30_sub1.anInt1301 = k;
  8676. class30_sub1.anInt1300 = l;
  8677. }
  8678.  
  8679. private void method90()
  8680. {
  8681. for(int i = 0; i < anInt1062; i++)
  8682. if(anIntArray1250[i] <= 0)
  8683. {
  8684. boolean flag1 = false;
  8685. try
  8686. {
  8687. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  8688. {
  8689. if(!replayWave())
  8690. flag1 = true;
  8691. } else
  8692. {
  8693. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  8694. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  8695. {
  8696. anInt1257 = stream.currentOffset;
  8697. aLong1172 = System.currentTimeMillis();
  8698. if(saveWave(stream.buffer, stream.currentOffset))
  8699. {
  8700. anInt874 = anIntArray1207[i];
  8701. anInt1289 = anIntArray1241[i];
  8702. } else
  8703. {
  8704. flag1 = true;
  8705. }
  8706. }
  8707. }
  8708. }
  8709. catch(Exception exception) { }
  8710. if(!flag1 || anIntArray1250[i] == -5)
  8711. {
  8712. anInt1062--;
  8713. for(int j = i; j < anInt1062; j++)
  8714. {
  8715. anIntArray1207[j] = anIntArray1207[j + 1];
  8716. anIntArray1241[j] = anIntArray1241[j + 1];
  8717. anIntArray1250[j] = anIntArray1250[j + 1];
  8718. }
  8719.  
  8720. i--;
  8721. } else
  8722. {
  8723. anIntArray1250[i] = -5;
  8724. }
  8725. } else
  8726. {
  8727. anIntArray1250[i]--;
  8728. }
  8729.  
  8730. if(prevSong > 0)
  8731. {
  8732. prevSong -= 20;
  8733. if(prevSong < 0)
  8734. prevSong = 0;
  8735. if(prevSong == 0 && musicEnabled && !lowMem)
  8736. {
  8737. nextSong = currentSong;
  8738. songChanging = true;
  8739. onDemandFetcher.method558(2, nextSong);
  8740. }
  8741. }
  8742. }
  8743.  
  8744. public int tabby = 0;
  8745. void startUp()
  8746. {
  8747. drawLoadingText(20, "Starting up");
  8748. new CacheDownloader(this).downloadCache();
  8749. new CacheUpdater(this).updateCache();
  8750. setNewMaps();
  8751. if(signlink.sunjava)
  8752. super.minDelay = 5;
  8753. aBoolean993 = true;
  8754. String s = getDocumentBaseHost();
  8755. if(signlink.cache_dat != null) {
  8756. for(int i = 0; i < 5; i++)
  8757. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  8758. }
  8759. try {
  8760. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  8761. smallText = new RSFont(false, "p11_full", titleStreamLoader);
  8762. aTextDrawingArea_1271 = new RSFont(false, "p12_full", titleStreamLoader);
  8763. chatTextDrawingArea = new RSFont(false, "b12_full", titleStreamLoader);
  8764. RSFont aTextDrawingArea_1273 = new RSFont(true, "q8_full", titleStreamLoader);
  8765.  
  8766. newSmallFont = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  8767. newRegularFont = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  8768. newBoldFont = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  8769. newFancyFont = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  8770. //UserInterface.fonts = newFonts;
  8771. newSmallFont.unpackChatImages(chatImages);
  8772. newRegularFont.unpackChatImages(chatImages);
  8773. newBoldFont.unpackChatImages(chatImages);
  8774. newFancyFont.unpackChatImages(chatImages);
  8775.  
  8776. drawLogo();
  8777. loadTitleScreen();
  8778. NamedArchive archive = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  8779. NamedArchive streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  8780. NamedArchive mediaArchive = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  8781. NamedArchive streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  8782. NamedArchive streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  8783. NamedArchive streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  8784. byteGroundArray = new byte[4][104][104];
  8785. intGroundArray = new int[4][105][105];
  8786. worldController = new WorldController(intGroundArray);
  8787. for(int j = 0; j < 4; j++)
  8788. aClass11Array1230[j] = new Class11();
  8789. aSprite_1263 = new Sprite(512, 512);
  8790. NamedArchive streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  8791. drawLoadingText(60, "Connecting to update server");
  8792. onDemandFetcher = new OnDemandFetcher();
  8793. onDemandFetcher.start(streamLoader_6, this);
  8794. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  8795. preloadModels();
  8796. ModelDecompressor.loadModelDataFile();//loads custom cache
  8797. drawLoadingText(80, "Unpacking media");
  8798. /* Custom sprite unpacking */
  8799. loadExtraSprites();
  8800. compass = new Sprite(mediaArchive, "compass", 0);
  8801. mapArea = new Sprite("maparea");
  8802. multiOverlay = new Sprite(mediaArchive, "overlay_multiway", 0);
  8803.  
  8804. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HP 0.PNG", 1);
  8805. HPBarEmpty = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HP 1.PNG", 1);
  8806. /**/
  8807.  
  8808. mapBack = new Background(mediaArchive, "mapback", 0);
  8809. for(int c1 = 0; c1 <= 3; c1++)
  8810. chatButtons[c1] = new Sprite(mediaArchive, "chatbuttons", c1);
  8811.  
  8812. for(int j3 = 0; j3 <= 13; j3++)
  8813. sideIcons[j3] = new Sprite(mediaArchive, "sideicons", j3);
  8814.  
  8815. for(int j3 = 0; j3 <= 13; j3++)
  8816. sIcons483[j3] = new Sprite("Gameframe/SIcons/483/"+j3+"");
  8817.  
  8818. for(int j3 = 0; j3 <= 12; j3++)
  8819. sIcons459[j3] = new Sprite("Gameframe/SIcons/459/SIDEICONS "+j3+"");
  8820.  
  8821. tabHover = new Sprite("Gameframe/SIcons/562/tabhover");
  8822. /*if(tabby == 0){*/
  8823. tabClicked = new Sprite("Gameframe/SIcons/562/tabclicked1");
  8824. /*} else {
  8825. tabClicked = new Sprite("Gameframe/SIcons/562/tabclicked2"); //tab changer :((
  8826. }*/
  8827. for(int nSI = 0; nSI <= 14; nSI++)
  8828. newSideIcons[nSI] = new Sprite("Gameframe/SIcons/562/icon "+nSI);
  8829.  
  8830. for(int r1 = 0; r1 < 15; r1++)
  8831. redStones[r1] = new Sprite("redstones " + r1);
  8832. mapEdge = new Sprite(mediaArchive, "mapedge", 0);
  8833. mapEdge.method345();
  8834. try
  8835. {
  8836. for(int k3 = 0; k3 < 100; k3++)
  8837. mapScenes[k3] = new Background(mediaArchive, "mapscene", k3);
  8838. }
  8839. catch(Exception _ex) { }
  8840. try
  8841. {
  8842. for(int l3 = 0; l3 < 100; l3++)
  8843. mapFunctions[l3] = new Sprite(mediaArchive, "mapfunction", l3);
  8844. }
  8845. catch(Exception _ex) { }
  8846. try
  8847. {
  8848. for(int i4 = 0; i4 < 20; i4++)
  8849. hitMarks[i4] = new Sprite(mediaArchive, "hitmarks", i4);
  8850. }
  8851. catch(Exception _ex) { }
  8852. try
  8853. {
  8854. for(int h1 = 0; h1 < 6; h1++)
  8855. headIconsHint[h1] = new Sprite(mediaArchive, "headicons_hint", h1);
  8856. } catch(Exception _ex) { }
  8857. try {
  8858. for(int j4 = 0; j4 < 8; j4++)
  8859. headIcons[j4] = new Sprite(mediaArchive, "headicons_prayer", j4);
  8860. headIcons[8] = new Sprite(signlink.findcachedir() + "/Sprites/Pray1.png", 1);
  8861. headIcons[9] = new Sprite(signlink.findcachedir() + "/Sprites/Pray2.png", 1);
  8862. headIcons[10] = new Sprite(signlink.findcachedir() + "/Sprites/Pray3.png", 1);
  8863. headIcons[11] = new Sprite(signlink.findcachedir() + "/Sprites/Pray4.png", 1);
  8864. headIcons[7] = new Sprite(signlink.findcachedir() + "/Sprites/Pray5.png", 1);
  8865. for(int j45 = 0; j45 < 3; j45++)
  8866. skullIcons[j45] = new Sprite(mediaArchive, "headicons_pk", j45 );
  8867. }
  8868. catch(Exception _ex) { }
  8869. mapFlag = new Sprite(mediaArchive, "mapmarker", 0);
  8870. mapMarker = new Sprite(mediaArchive, "mapmarker", 1);
  8871. for(int k4 = 0; k4 < 8; k4++)
  8872. crosses[k4] = new Sprite(mediaArchive, "cross", k4);
  8873.  
  8874. mapDotItem = new Sprite(mediaArchive, "mapdots", 0);
  8875. mapDotNPC = new Sprite(mediaArchive, "mapdots", 1);
  8876. mapDotPlayer = new Sprite(mediaArchive, "mapdots", 2);
  8877. mapDotFriend = new Sprite(mediaArchive, "mapdots", 3);
  8878. mapDotTeam = new Sprite(mediaArchive, "mapdots", 4);
  8879. mapDotClan = new Sprite(mediaArchive, "mapdots", 5);
  8880.  
  8881. scrollBar1 = new Sprite(mediaArchive, "scrollbar", 0);
  8882. scrollBar2 = new Sprite(mediaArchive, "scrollbar", 1);
  8883. scrollBar3 = new Sprite("Gameframe/SCROLLBAR 0");
  8884. scrollBar4 = new Sprite("Gameframe/SCROLLBAR 1");
  8885.  
  8886. Sprite sprite = new Sprite(mediaArchive, "screenframe", 0);
  8887. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8888. sprite.method346(0, 0);
  8889. sprite = new Sprite(mediaArchive, "screenframe", 1);
  8890. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8891. sprite.method346(0, 0);
  8892. sprite = new Sprite(mediaArchive, "screenframe", 2);
  8893. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8894. sprite.method346(0, 0);
  8895. sprite = new Sprite(mediaArchive, "mapedge", 0);
  8896. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8897. sprite.method346(0, 0);
  8898.  
  8899. int i5 = (int)(Math.random() * 21D) - 10;
  8900. int j5 = (int)(Math.random() * 21D) - 10;
  8901. int k5 = (int)(Math.random() * 21D) - 10;
  8902. int l5 = (int)(Math.random() * 41D) - 20;
  8903. for(int i6 = 0; i6 < 100; i6++)
  8904. {
  8905. if(mapFunctions[i6] != null)
  8906. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  8907. if(mapScenes[i6] != null)
  8908. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  8909. }
  8910. drawLoadingText(83, "Unpacking textures");
  8911. Texture.method368(streamLoader_3);
  8912. Texture.method372(0.80000000000000004D);
  8913. Texture.method367();
  8914. drawLoadingText(86, "Unpacking config");
  8915. try {
  8916. Animation.unpackConfig(archive);
  8917. ObjectDef.unpackConfig(archive);
  8918. Flo.unpackConfig(archive);
  8919. ItemDef.unpackConfig(archive);
  8920. EntityDef.unpackConfig(archive);
  8921. IdentityKit.unpackConfig(archive);
  8922. SpotAnim.unpackConfig(archive);
  8923. Varp.unpackConfig(archive);
  8924. VarBit.unpackConfig(archive);
  8925. ItemDef.isMembers = true;
  8926. } catch(Exception e) {
  8927. e.printStackTrace();
  8928. }
  8929. drawLoadingText(95, "Unpacking interfaces");
  8930. RSFont aclass30_sub2_sub1_sub4s[] = {
  8931. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  8932. };
  8933. RSInterface.fonts = aclass30_sub2_sub1_sub4s;
  8934. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, mediaArchive);
  8935. drawLoadingText(100, "Preparing game engine");
  8936. for(int j6 = 0; j6 < 33; j6++)
  8937. {
  8938. int k6 = 999;
  8939. int i7 = 0;
  8940. for(int k7 = 0; k7 < 34; k7++)
  8941. {
  8942. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  8943. {
  8944. if(k6 == 999)
  8945. k6 = k7;
  8946. continue;
  8947. }
  8948. if(k6 == 999)
  8949. continue;
  8950. i7 = k7;
  8951. break;
  8952. }
  8953.  
  8954. anIntArray968[j6] = k6;
  8955. anIntArray1057[j6] = i7 - k6;
  8956. }
  8957. for (int l6 = 1; l6 < 153; l6++) {
  8958. int j7 = 999;
  8959. int l7 = 0;
  8960. for (int j8 = 24; j8 < 177; j8++) {
  8961. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34)) {
  8962. if (j7 == 999) {
  8963. j7 = j8;
  8964. }
  8965. continue;
  8966. }
  8967. if (j7 == 999) {
  8968. continue;
  8969. }
  8970. l7 = j8;
  8971. break;
  8972. }
  8973.  
  8974. anIntArray1052[l6 - 1] = j7 - 24;
  8975. anIntArray1229[l6 - 1] = l7 - j7;
  8976. }
  8977. Texture.method365(765, 503);
  8978. fullScreenTextureArray = Texture.anIntArray1472;
  8979. Texture.method365(516, 165);//519
  8980. anIntArray1180 = Texture.anIntArray1472;
  8981. Texture.method365(250, 335);
  8982. anIntArray1181 = Texture.anIntArray1472;
  8983. Texture.method365(512, 334);//512 334
  8984. anIntArray1182 = Texture.anIntArray1472;
  8985.  
  8986. int ai[] = new int[9];
  8987. for(int i8 = 0; i8 < 9; i8++)
  8988. {
  8989. int k8 = 128 + i8 * 32 + 15;
  8990. int l8 = 600 + k8 * 3;
  8991. int i9 = Texture.anIntArray1470[k8];
  8992. ai[i8] = l8 * i9 >> 16;
  8993. }
  8994.  
  8995. WorldController.method310(500, 800, 512, 334, ai);
  8996.  
  8997. Censor.loadConfig(streamLoader_4);
  8998. mouseDetection = new MouseDetection(this);
  8999. startRunnable(mouseDetection, 10);
  9000. Animable_Sub5.clientInstance = this;
  9001. ObjectDef.clientInstance = this;
  9002. EntityDef.clientInstance = this;
  9003. return;
  9004. }
  9005. catch(Exception exception)
  9006. {
  9007. exception.printStackTrace();
  9008. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  9009. }
  9010. loadingError = true;
  9011. }
  9012.  
  9013. /*private void method91(Stream stream, int i)
  9014. {
  9015. while(stream.bitPosition + 10 < i * 8)
  9016. {
  9017. int j = stream.readBits(11);
  9018. if(j == 2047)
  9019. break;
  9020. if(playerArray[j] == null)
  9021. {
  9022. playerArray[j] = new Player();
  9023. if(aStreamArray895s[j] != null)
  9024. playerArray[j].updatePlayer(aStreamArray895s[j]);
  9025. }
  9026. playerIndices[playerCount++] = j;
  9027. Player player = playerArray[j];
  9028. player.anInt1537 = loopCycle;
  9029. int k = stream.readBits(1);
  9030. if(k == 1)
  9031. anIntArray894[anInt893++] = j;
  9032. int l = stream.readBits(1);
  9033. int i1 = stream.readBits(5);
  9034. if(i1 > 15)
  9035. i1 -= 32;
  9036. int j1 = stream.readBits(5);
  9037. if(j1 > 15)
  9038. j1 -= 32;
  9039. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  9040. }
  9041. stream.finishBitAccess();
  9042. }*/
  9043. private void method91(Stream stream, int i)
  9044. {
  9045. while(stream.bitPosition + 10 < i * 8)
  9046. {
  9047. int j = stream.readBits(11);
  9048. if(j == 2047)
  9049. break;
  9050. if(playerArray[j] == null)
  9051. {
  9052. playerArray[j] = new Player();
  9053. if(aStreamArray895s[j] != null)
  9054. playerArray[j].updatePlayer(aStreamArray895s[j]);
  9055. }
  9056. playerIndices[playerCount++] = j;
  9057. Player player = playerArray[j];
  9058. player.anInt1537 = loopCycle;
  9059. int k = stream.readBits(1);
  9060. if(k == 1)
  9061. anIntArray894[anInt893++] = j;
  9062. int l = stream.readBits(1);
  9063. int i1 = stream.readBits(5);
  9064. if(i1 > 15)
  9065. i1 -= 32;
  9066. int j1 = stream.readBits(5);
  9067. if(j1 > 15)
  9068. j1 -= 32;
  9069. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  9070. }
  9071. stream.finishBitAccess();
  9072. }
  9073.  
  9074. private void processMainScreenClick() {
  9075. if(anInt1021 != 0)
  9076. return;
  9077. if(super.clickMode3 == 1) {
  9078. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  9079. int i = super.saveClickX - 25 - 530;//
  9080. int j = super.saveClickY - 8;
  9081. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  9082. i -= 73;
  9083. j -= 75;
  9084. int k = minimapInt1 + minimapInt2 & 0x7ff;
  9085. int i1 = Texture.anIntArray1470[k];
  9086. int j1 = Texture.anIntArray1471[k];
  9087. i1 = i1 * (minimapInt3 + 256) >> 8;
  9088. j1 = j1 * (minimapInt3 + 256) >> 8;
  9089. int k1 = j * i1 + i * j1 >> 11;
  9090. int l1 = j * j1 - i * i1 >> 11;
  9091. int i2 = myPlayer.x + k1 >> 7;
  9092. int j2 = myPlayer.y - l1 >> 7;
  9093. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  9094. if(flag1) {
  9095. stream.writeWordBigEndian(i);
  9096. stream.writeWordBigEndian(j);
  9097. stream.writeWord(minimapInt1);
  9098. stream.writeWordBigEndian(57);
  9099. stream.writeWordBigEndian(minimapInt2);
  9100. stream.writeWordBigEndian(minimapInt3);
  9101. stream.writeWordBigEndian(89);
  9102. stream.writeWord(myPlayer.x);
  9103. stream.writeWord(myPlayer.y);
  9104. stream.writeWordBigEndian(anInt1264);
  9105. stream.writeWordBigEndian(63);
  9106. }
  9107. }
  9108. } else {
  9109. int i = super.saveClickX - 25 - 545;//545
  9110. int j = super.saveClickY - 5 - 4;
  9111. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  9112. i -= 73;
  9113. j -= 75;
  9114. int k = minimapInt1 + minimapInt2 & 0x7ff;
  9115. int i1 = Texture.anIntArray1470[k];
  9116. int j1 = Texture.anIntArray1471[k];
  9117. i1 = i1 * (minimapInt3 + 256) >> 8;
  9118. j1 = j1 * (minimapInt3 + 256) >> 8;
  9119. int k1 = j * i1 + i * j1 >> 11;
  9120. int l1 = j * j1 - i * i1 >> 11;
  9121. int i2 = myPlayer.x + k1 >> 7;
  9122. int j2 = myPlayer.y - l1 >> 7;
  9123. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  9124. if(flag1) {
  9125. stream.writeWordBigEndian(i);
  9126. stream.writeWordBigEndian(j);
  9127. stream.writeWord(minimapInt1);
  9128. stream.writeWordBigEndian(57);
  9129. stream.writeWordBigEndian(minimapInt2);
  9130. stream.writeWordBigEndian(minimapInt3);
  9131. stream.writeWordBigEndian(89);
  9132. stream.writeWord(myPlayer.x);
  9133. stream.writeWord(myPlayer.y);
  9134. stream.writeWordBigEndian(anInt1264);
  9135. stream.writeWordBigEndian(63);
  9136. }
  9137. }
  9138. }
  9139. anInt1117++;
  9140. if(anInt1117 > 1151) {
  9141. anInt1117 = 0;
  9142. stream.createFrame(246);
  9143. stream.writeWordBigEndian(0);
  9144. int l = stream.currentOffset;
  9145. if((int)(Math.random() * 2D) == 0)
  9146. stream.writeWordBigEndian(101);
  9147. stream.writeWordBigEndian(197);
  9148. stream.writeWord((int)(Math.random() * 65536D));
  9149. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9150. stream.writeWordBigEndian(67);
  9151. stream.writeWord(14214);
  9152. if((int)(Math.random() * 2D) == 0)
  9153. stream.writeWord(29487);
  9154. stream.writeWord((int)(Math.random() * 65536D));
  9155. if((int)(Math.random() * 2D) == 0)
  9156. stream.writeWordBigEndian(220);
  9157. stream.writeWordBigEndian(180);
  9158. stream.writeBytes(stream.currentOffset - l);
  9159. }
  9160. }
  9161. }
  9162.  
  9163. private String interfaceIntToString(int j) {
  9164. if(j < 0x3b9ac9ff)
  9165. return String.valueOf(j);
  9166. else
  9167. return "*";
  9168. }
  9169.  
  9170. private void showErrorScreen()
  9171. {
  9172. Graphics g = getGameComponent().getGraphics();
  9173. g.setColor(Color.black);
  9174. g.fillRect(0, 0, 765, 503);
  9175. method4(1);
  9176. if(loadingError)
  9177. {
  9178. aBoolean831 = false;
  9179. g.setFont(new Font("Helvetica", 1, 16));
  9180. g.setColor(Color.yellow);
  9181. int k = 35;
  9182. g.drawString("Sorry, an error has occured whilst loading RuneScape.", 30, k);
  9183. k += 50;
  9184. g.setColor(Color.white);
  9185. g.drawString("To fix this try the following (in order):", 30, k);
  9186. k += 50;
  9187. g.setColor(Color.white);
  9188. g.setFont(new Font("Helvetica", 1, 12));
  9189. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  9190. k += 30;
  9191. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  9192. k += 30;
  9193. g.drawString("3: Try using a different game-world", 30, k);
  9194. k += 30;
  9195. g.drawString("4: Try rebooting your computer", 30, k);
  9196. k += 30;
  9197. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  9198. }
  9199. if(genericLoadingError)
  9200. {
  9201. aBoolean831 = false;
  9202. g.setFont(new Font("Helvetica", 1, 20));
  9203. g.setColor(Color.white);
  9204. g.drawString("Error - unable to load game!", 50, 50);
  9205. g.drawString("To play RuneScape make sure you play from", 50, 100);
  9206. g.drawString("http://www.RuneScape.com", 50, 150);
  9207. }
  9208. if(rsAlreadyLoaded)
  9209. {
  9210. aBoolean831 = false;
  9211. g.setColor(Color.yellow);
  9212. int l = 35;
  9213. g.drawString("Error a copy of RuneScape already appears to be loaded", 30, l);
  9214. l += 50;
  9215. g.setColor(Color.white);
  9216. g.drawString("To fix this try the following (in order):", 30, l);
  9217. l += 50;
  9218. g.setColor(Color.white);
  9219. g.setFont(new Font("Helvetica", 1, 12));
  9220. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  9221. l += 30;
  9222. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  9223. l += 30;
  9224. }
  9225. }
  9226.  
  9227. public URL getCodeBase() {
  9228.  
  9229.  
  9230. try {
  9231. return new URL(server +":" + (80 + portOff));
  9232. } catch(Exception _ex) {
  9233. }
  9234. return null;
  9235. }
  9236.  
  9237. private void method95() {
  9238. for(int j = 0; j < npcCount; j++) {
  9239. int k = npcIndices[j];
  9240. NPC npc = npcArray[k];
  9241. if(npc != null)
  9242. method96(npc);
  9243. }
  9244. }
  9245. private void method96(Entity entity)
  9246. {
  9247. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  9248. {
  9249. entity.anim = -1;
  9250. entity.anInt1520 = -1;
  9251. entity.anInt1547 = 0;
  9252. entity.anInt1548 = 0;
  9253. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9254. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9255. entity.method446();
  9256. }
  9257. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  9258. {
  9259. entity.anim = -1;
  9260. entity.anInt1520 = -1;
  9261. entity.anInt1547 = 0;
  9262. entity.anInt1548 = 0;
  9263. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9264. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9265. entity.method446();
  9266. }
  9267. if(entity.anInt1547 > loopCycle)
  9268. method97(entity);
  9269. else
  9270. if(entity.anInt1548 >= loopCycle)
  9271. method98(entity);
  9272. else
  9273. method99(entity);
  9274. method100(entity);
  9275. method101(entity);
  9276. }
  9277.  
  9278. private void method97(Entity entity)
  9279. {
  9280. int i = entity.anInt1547 - loopCycle;
  9281. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9282. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9283. entity.x += (j - entity.x) / i;
  9284. entity.y += (k - entity.y) / i;
  9285. entity.anInt1503 = 0;
  9286. if(entity.anInt1549 == 0)
  9287. entity.turnDirection = 1024;
  9288. if(entity.anInt1549 == 1)
  9289. entity.turnDirection = 1536;
  9290. if(entity.anInt1549 == 2)
  9291. entity.turnDirection = 0;
  9292. if(entity.anInt1549 == 3)
  9293. entity.turnDirection = 512;
  9294. }
  9295.  
  9296. private void method98(Entity entity)
  9297. {
  9298. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  9299. {
  9300. int i = entity.anInt1548 - entity.anInt1547;
  9301. int j = loopCycle - entity.anInt1547;
  9302. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9303. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9304. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  9305. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  9306. entity.x = (k * (i - j) + i1 * j) / i;
  9307. entity.y = (l * (i - j) + j1 * j) / i;
  9308. }
  9309. entity.anInt1503 = 0;
  9310. if(entity.anInt1549 == 0)
  9311. entity.turnDirection = 1024;
  9312. if(entity.anInt1549 == 1)
  9313. entity.turnDirection = 1536;
  9314. if(entity.anInt1549 == 2)
  9315. entity.turnDirection = 0;
  9316. if(entity.anInt1549 == 3)
  9317. entity.turnDirection = 512;
  9318. entity.anInt1552 = entity.turnDirection;
  9319. }
  9320.  
  9321. private void method99(Entity entity)
  9322. {
  9323. try
  9324. {
  9325. entity.anInt1517 = entity.anInt1511;
  9326. if(entity.smallXYIndex == 0)
  9327. {
  9328. entity.anInt1503 = 0;
  9329. return;
  9330. }
  9331. if(entity.anim != -1 && entity.anInt1529 == 0)
  9332. {
  9333. Animation animation = null;
  9334. try
  9335. {
  9336. animation = Animation.anims[entity.anim];
  9337. }
  9338. catch(Exception e)
  9339. {
  9340. return;
  9341. }
  9342. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  9343. {
  9344. entity.anInt1503++;
  9345. return;
  9346. }
  9347. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  9348. {
  9349. entity.anInt1503++;
  9350. return;
  9351. }
  9352. }
  9353. int i = entity.x;
  9354. int j = entity.y;
  9355. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  9356. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  9357. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  9358. {
  9359. entity.x = k;
  9360. entity.y = l;
  9361. return;
  9362. }
  9363. if(i < k)
  9364. {
  9365. if(j < l)
  9366. entity.turnDirection = 1280;
  9367. else
  9368. if(j > l)
  9369. entity.turnDirection = 1792;
  9370. else
  9371. entity.turnDirection = 1536;
  9372. } else
  9373. if(i > k)
  9374. {
  9375. if(j < l)
  9376. entity.turnDirection = 768;
  9377. else
  9378. if(j > l)
  9379. entity.turnDirection = 256;
  9380. else
  9381. entity.turnDirection = 512;
  9382. } else
  9383. if(j < l)
  9384. entity.turnDirection = 1024;
  9385. else
  9386. entity.turnDirection = 0;
  9387. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9388. if(i1 > 1024)
  9389. i1 -= 2048;
  9390. int j1 = entity.anInt1555;
  9391. if(i1 >= -256 && i1 <= 256)
  9392. j1 = entity.anInt1554;
  9393. else
  9394. if(i1 >= 256 && i1 < 768)
  9395. j1 = entity.anInt1557;
  9396. else
  9397. if(i1 >= -768 && i1 <= -256)
  9398. j1 = entity.anInt1556;
  9399. if(j1 == -1)
  9400. j1 = entity.anInt1554;
  9401. entity.anInt1517 = j1;
  9402. int k1 = 4;
  9403. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  9404. k1 = 2;
  9405. if(entity.smallXYIndex > 2)
  9406. k1 = 6;
  9407. if(entity.smallXYIndex > 3)
  9408. k1 = 8;
  9409. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  9410. {
  9411. k1 = 8;
  9412. entity.anInt1503--;
  9413. }
  9414. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  9415. k1 <<= 1;
  9416. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  9417. entity.anInt1517 = entity.anInt1505;
  9418. if(i < k)
  9419. {
  9420. entity.x += k1;
  9421. if(entity.x > k)
  9422. entity.x = k;
  9423. } else
  9424. if(i > k)
  9425. {
  9426. entity.x -= k1;
  9427. if(entity.x < k)
  9428. entity.x = k;
  9429. }
  9430. if(j < l)
  9431. {
  9432. entity.y += k1;
  9433. if(entity.y > l)
  9434. entity.y = l;
  9435. } else
  9436. if(j > l)
  9437. {
  9438. entity.y -= k1;
  9439. if(entity.y < l)
  9440. entity.y = l;
  9441. }
  9442. if(entity.x == k && entity.y == l)
  9443. {
  9444. entity.smallXYIndex--;
  9445. if(entity.anInt1542 > 0)
  9446. entity.anInt1542--;
  9447. }
  9448. }
  9449. catch(Exception e)
  9450. {
  9451. }
  9452. }
  9453.  
  9454. private void method100(Entity entity)
  9455. {
  9456. try
  9457. {
  9458. if(entity.anInt1504 == 0)
  9459. return;
  9460. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  9461. {
  9462. NPC npc = npcArray[entity.interactingEntity];
  9463. if(npc != null)
  9464. {
  9465. int i1 = entity.x - npc.x;
  9466. int k1 = entity.y - npc.y;
  9467. if(i1 != 0 || k1 != 0)
  9468. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  9469. }
  9470. }
  9471. if(entity.interactingEntity >= 32768)
  9472. {
  9473. int j = entity.interactingEntity - 32768;
  9474. if(j == unknownInt10)
  9475. j = myPlayerIndex;
  9476. Player player = null;
  9477. try
  9478. {
  9479. player = playerArray[j];
  9480. }
  9481. catch(Exception e)
  9482. {
  9483. }
  9484. if(player != null)
  9485. {
  9486. int l1 = entity.x - player.x;
  9487. int i2 = entity.y - player.y;
  9488. if(l1 != 0 || i2 != 0)
  9489. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  9490. }
  9491. }
  9492. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  9493. {
  9494. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  9495. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  9496. if(k != 0 || j1 != 0)
  9497. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  9498. entity.anInt1538 = 0;
  9499. entity.anInt1539 = 0;
  9500. }
  9501. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9502. if(l != 0)
  9503. {
  9504. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  9505. entity.anInt1552 = entity.turnDirection;
  9506. else
  9507. if(l > 1024)
  9508. entity.anInt1552 -= entity.anInt1504;
  9509. else
  9510. entity.anInt1552 += entity.anInt1504;
  9511. entity.anInt1552 &= 0x7ff;
  9512. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  9513. {
  9514. if(entity.anInt1512 != -1)
  9515. {
  9516. entity.anInt1517 = entity.anInt1512;
  9517. return;
  9518. }
  9519. entity.anInt1517 = entity.anInt1554;
  9520. }
  9521. }
  9522. }
  9523. catch(Exception e)
  9524. {
  9525. }
  9526. }
  9527.  
  9528. private void method101(Entity entity)
  9529. {
  9530. entity.aBoolean1541 = false;
  9531. if(entity.anInt1517 != -1)
  9532. {
  9533. Animation animation = null;
  9534. try
  9535. {
  9536. animation = Animation.anims[entity.anInt1517];
  9537. }
  9538. catch(Exception e)
  9539. {
  9540. return;
  9541. }
  9542. entity.anInt1519++;
  9543. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  9544. {
  9545. entity.anInt1519 = 0;
  9546. entity.anInt1518++;
  9547. }
  9548. if(entity.anInt1518 >= animation.anInt352)
  9549. {
  9550. entity.anInt1519 = 0;
  9551. entity.anInt1518 = 0;
  9552. }
  9553. }
  9554. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  9555. {
  9556. if(entity.anInt1521 < 0)
  9557. entity.anInt1521 = 0;
  9558. Animation animation_1 = null;
  9559. try
  9560. {
  9561. animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  9562. }
  9563. catch(Exception e)
  9564. {
  9565. return;
  9566. }
  9567. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  9568. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  9569.  
  9570. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  9571. entity.anInt1520 = -1;
  9572. }
  9573. if(entity.anim != -1 && entity.anInt1529 <= 1)
  9574. {
  9575. Animation animation_2 = null;
  9576. try
  9577. {
  9578. animation_2 = Animation.anims[entity.anim];
  9579. }
  9580. catch(Exception e)
  9581. {
  9582. return;
  9583. }
  9584. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  9585. {
  9586. entity.anInt1529 = 1;
  9587. return;
  9588. }
  9589. }
  9590. if(entity.anim != -1 && entity.anInt1529 == 0)
  9591. {
  9592. Animation animation_3 = null;
  9593. try
  9594. {
  9595. animation_3 = Animation.anims[entity.anim];
  9596. }
  9597. catch(Exception e)
  9598. {
  9599. return;
  9600. }
  9601. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  9602. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  9603.  
  9604. if(entity.anInt1527 >= animation_3.anInt352)
  9605. {
  9606. entity.anInt1527 -= animation_3.anInt356;
  9607. entity.anInt1530++;
  9608. if(entity.anInt1530 >= animation_3.anInt362)
  9609. entity.anim = -1;
  9610. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  9611. entity.anim = -1;
  9612. }
  9613. entity.aBoolean1541 = animation_3.aBoolean358;
  9614. }
  9615. if(entity.anInt1529 > 0)
  9616. entity.anInt1529--;
  9617. }
  9618.  
  9619. /*private void method96(Entity entity)
  9620. {
  9621. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  9622. {
  9623. entity.anim = -1;
  9624. entity.anInt1520 = -1;
  9625. entity.anInt1547 = 0;
  9626. entity.anInt1548 = 0;
  9627. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9628. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9629. entity.method446();
  9630. }
  9631. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  9632. {
  9633. entity.anim = -1;
  9634. entity.anInt1520 = -1;
  9635. entity.anInt1547 = 0;
  9636. entity.anInt1548 = 0;
  9637. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9638. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9639. entity.method446();
  9640. }
  9641. if(entity.anInt1547 > loopCycle)
  9642. method97(entity);
  9643. else
  9644. if(entity.anInt1548 >= loopCycle)
  9645. method98(entity);
  9646. else
  9647. method99(entity);
  9648. method100(entity);
  9649. method101(entity);
  9650. }
  9651.  
  9652. private void method97(Entity entity)
  9653. {
  9654. int i = entity.anInt1547 - loopCycle;
  9655. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9656. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9657. entity.x += (j - entity.x) / i;
  9658. entity.y += (k - entity.y) / i;
  9659. entity.anInt1503 = 0;
  9660. if(entity.anInt1549 == 0)
  9661. entity.turnDirection = 1024;
  9662. if(entity.anInt1549 == 1)
  9663. entity.turnDirection = 1536;
  9664. if(entity.anInt1549 == 2)
  9665. entity.turnDirection = 0;
  9666. if(entity.anInt1549 == 3)
  9667. entity.turnDirection = 512;
  9668. }
  9669.  
  9670. private void method98(Entity entity)
  9671. {
  9672. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  9673. {
  9674. int i = entity.anInt1548 - entity.anInt1547;
  9675. int j = loopCycle - entity.anInt1547;
  9676. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9677. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9678. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  9679. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  9680. entity.x = (k * (i - j) + i1 * j) / i;
  9681. entity.y = (l * (i - j) + j1 * j) / i;
  9682. }
  9683. entity.anInt1503 = 0;
  9684. if(entity.anInt1549 == 0)
  9685. entity.turnDirection = 1024;
  9686. if(entity.anInt1549 == 1)
  9687. entity.turnDirection = 1536;
  9688. if(entity.anInt1549 == 2)
  9689. entity.turnDirection = 0;
  9690. if(entity.anInt1549 == 3)
  9691. entity.turnDirection = 512;
  9692. entity.anInt1552 = entity.turnDirection;
  9693. }
  9694.  
  9695. private void method99(Entity entity)
  9696. {
  9697. entity.anInt1517 = entity.anInt1511;
  9698. if(entity.smallXYIndex == 0)
  9699. {
  9700. entity.anInt1503 = 0;
  9701. return;
  9702. }
  9703. if(entity.anim != -1 && entity.anInt1529 == 0)
  9704. {
  9705. Animation animation = Animation.anims[entity.anim];
  9706. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  9707. {
  9708. entity.anInt1503++;
  9709. return;
  9710. }
  9711. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  9712. {
  9713. entity.anInt1503++;
  9714. return;
  9715. }
  9716. }
  9717. int i = entity.x;
  9718. int j = entity.y;
  9719. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  9720. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  9721. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  9722. {
  9723. entity.x = k;
  9724. entity.y = l;
  9725. return;
  9726. }
  9727. if(i < k)
  9728. {
  9729. if(j < l)
  9730. entity.turnDirection = 1280;
  9731. else
  9732. if(j > l)
  9733. entity.turnDirection = 1792;
  9734. else
  9735. entity.turnDirection = 1536;
  9736. } else
  9737. if(i > k)
  9738. {
  9739. if(j < l)
  9740. entity.turnDirection = 768;
  9741. else
  9742. if(j > l)
  9743. entity.turnDirection = 256;
  9744. else
  9745. entity.turnDirection = 512;
  9746. } else
  9747. if(j < l)
  9748. entity.turnDirection = 1024;
  9749. else
  9750. entity.turnDirection = 0;
  9751. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9752. if(i1 > 1024)
  9753. i1 -= 2048;
  9754. int j1 = entity.anInt1555;
  9755. if(i1 >= -256 && i1 <= 256)
  9756. j1 = entity.anInt1554;
  9757. else
  9758. if(i1 >= 256 && i1 < 768)
  9759. j1 = entity.anInt1557;
  9760. else
  9761. if(i1 >= -768 && i1 <= -256)
  9762. j1 = entity.anInt1556;
  9763. if(j1 == -1)
  9764. j1 = entity.anInt1554;
  9765. entity.anInt1517 = j1;
  9766. int k1 = 4;
  9767. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  9768. k1 = 2;
  9769. if(entity.smallXYIndex > 2)
  9770. k1 = 6;
  9771. if(entity.smallXYIndex > 3)
  9772. k1 = 8;
  9773. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  9774. {
  9775. k1 = 8;
  9776. entity.anInt1503--;
  9777. }
  9778. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  9779. k1 <<= 1;
  9780. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  9781. entity.anInt1517 = entity.anInt1505;
  9782. if(i < k)
  9783. {
  9784. entity.x += k1;
  9785. if(entity.x > k)
  9786. entity.x = k;
  9787. } else
  9788. if(i > k)
  9789. {
  9790. entity.x -= k1;
  9791. if(entity.x < k)
  9792. entity.x = k;
  9793. }
  9794. if(j < l)
  9795. {
  9796. entity.y += k1;
  9797. if(entity.y > l)
  9798. entity.y = l;
  9799. } else
  9800. if(j > l)
  9801. {
  9802. entity.y -= k1;
  9803. if(entity.y < l)
  9804. entity.y = l;
  9805. }
  9806. if(entity.x == k && entity.y == l)
  9807. {
  9808. entity.smallXYIndex--;
  9809. if(entity.anInt1542 > 0)
  9810. entity.anInt1542--;
  9811. }
  9812. }
  9813.  
  9814. private void method100(Entity entity)
  9815. {
  9816. if(entity.anInt1504 == 0)
  9817. return;
  9818. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  9819. {
  9820. NPC npc = npcArray[entity.interactingEntity];
  9821. if(npc != null)
  9822. {
  9823. int i1 = entity.x - npc.x;
  9824. int k1 = entity.y - npc.y;
  9825. if(i1 != 0 || k1 != 0)
  9826. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  9827. }
  9828. }
  9829. if(entity.interactingEntity >= 32768)
  9830. {
  9831. int j = entity.interactingEntity - 32768;
  9832. if(j == unknownInt10)
  9833. j = myPlayerIndex;
  9834. Player player = playerArray[j];
  9835. if(player != null)
  9836. {
  9837. int l1 = entity.x - player.x;
  9838. int i2 = entity.y - player.y;
  9839. if(l1 != 0 || i2 != 0)
  9840. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  9841. }
  9842. }
  9843. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  9844. {
  9845. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  9846. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  9847. if(k != 0 || j1 != 0)
  9848. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  9849. entity.anInt1538 = 0;
  9850. entity.anInt1539 = 0;
  9851. }
  9852. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9853. if(l != 0)
  9854. {
  9855. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  9856. entity.anInt1552 = entity.turnDirection;
  9857. else
  9858. if(l > 1024)
  9859. entity.anInt1552 -= entity.anInt1504;
  9860. else
  9861. entity.anInt1552 += entity.anInt1504;
  9862. entity.anInt1552 &= 0x7ff;
  9863. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  9864. {
  9865. if(entity.anInt1512 != -1)
  9866. {
  9867. entity.anInt1517 = entity.anInt1512;
  9868. return;
  9869. }
  9870. entity.anInt1517 = entity.anInt1554;
  9871. }
  9872. }
  9873. }
  9874.  
  9875. private void method101(Entity entity)
  9876. {
  9877. entity.aBoolean1541 = false;
  9878. if(entity.anInt1517 != -1)
  9879. {
  9880. Animation animation = Animation.anims[entity.anInt1517];
  9881. entity.anInt1519++;
  9882. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  9883. {
  9884. entity.anInt1519 = 0;
  9885. entity.anInt1518++;
  9886. }
  9887. if(entity.anInt1518 >= animation.anInt352)
  9888. {
  9889. entity.anInt1519 = 0;
  9890. entity.anInt1518 = 0;
  9891. }
  9892. }
  9893. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  9894. {
  9895. if(entity.anInt1521 < 0)
  9896. entity.anInt1521 = 0;
  9897. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  9898. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)//huhhhhh
  9899. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  9900.  
  9901. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  9902. entity.anInt1520 = -1;
  9903. }
  9904. if(entity.anim != -1 && entity.anInt1529 <= 1)
  9905. {
  9906. Animation animation_2 = Animation.anims[entity.anim];
  9907. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  9908. {
  9909. entity.anInt1529 = 1;
  9910. return;
  9911. }
  9912. }
  9913. if(entity.anim != -1 && entity.anInt1529 == 0)
  9914. {
  9915. Animation animation_3 = Animation.anims[entity.anim];
  9916. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  9917. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  9918.  
  9919. if(entity.anInt1527 >= animation_3.anInt352)
  9920. {
  9921. entity.anInt1527 -= animation_3.anInt356;
  9922. entity.anInt1530++;
  9923. if(entity.anInt1530 >= animation_3.anInt362)
  9924. entity.anim = -1;
  9925. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  9926. entity.anim = -1;
  9927. }
  9928. entity.aBoolean1541 = animation_3.aBoolean358;
  9929. }
  9930. if(entity.anInt1529 > 0)
  9931. entity.anInt1529--;
  9932. }*/
  9933.  
  9934. private void drawGameScreen()
  9935. {
  9936. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  9937. if (loadingStage == 2) {
  9938. method119(anInt945, fullscreenInterfaceID);
  9939. if (openInterfaceID != -1) {
  9940. method119(anInt945, openInterfaceID);
  9941. }
  9942. anInt945 = 0;
  9943. resetAllImageProducers();
  9944. super.fullGameScreen.initDrawingArea();
  9945. Texture.anIntArray1472 = fullScreenTextureArray;
  9946. DrawingArea.setAllPixelsToZero();
  9947. welcomeScreenRaised = true;
  9948. if (openInterfaceID != -1) {
  9949. RSInterface class9_1 = RSInterface.interfaceCache[openInterfaceID];
  9950. if (class9_1.width == 512 && class9_1.height == 334 && class9_1.interfaceType == 0) {
  9951. class9_1.width = 765;
  9952. class9_1.height = 503;
  9953. }
  9954. drawInterface(0, 0, class9_1, 8);
  9955. }
  9956. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  9957. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.interfaceType == 0) {
  9958. rsInterface.width = 765;
  9959. rsInterface.height = 503;
  9960. }
  9961. drawInterface(0, 0, rsInterface, 8);
  9962.  
  9963. if (!menuOpen) {
  9964. processRightClick();
  9965. drawTooltip();
  9966. } else {
  9967. drawMenu(0, 0);
  9968. }
  9969. }
  9970. drawCount++;
  9971. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  9972. return;
  9973. } else {
  9974. if (drawCount != 0) {
  9975. resetImageProducers2();
  9976. }
  9977. }
  9978. if(welcomeScreenRaised) {
  9979. welcomeScreenRaised = false;
  9980. topFrame.drawGraphics(0, super.graphics, 0);
  9981. leftFrame.drawGraphics(4, super.graphics, 0);
  9982. //rightFrame.drawGraphics(4, super.graphics, 516);
  9983. //mapEdgeIP.drawGraphics(4, super.graphics, 516);//519
  9984. needDrawTabArea = true;
  9985. inputTaken = true;
  9986. tabAreaAltered = true;
  9987. aBoolean1233 = true;
  9988.  
  9989. if(loadingStage != 2) {
  9990. inGameScreen.drawGraphics(4, super.graphics, 4);
  9991. mapBackImage.drawGraphics(0, super.graphics, 516);//545
  9992.  
  9993. }
  9994. }
  9995. if(menuOpen)
  9996. needDrawTabArea = true;
  9997. if(menuOpen)
  9998. drawMenu(4,4);
  9999.  
  10000. if(invOverlayInterfaceID != -1)
  10001. {
  10002. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  10003. if(flag1)
  10004. needDrawTabArea = true;
  10005. }
  10006. if(atInventoryInterfaceType == 2)
  10007. needDrawTabArea = true;
  10008. if(activeInterfaceType == 2)
  10009. needDrawTabArea = true;
  10010. drawTabArea();
  10011. if(loadingStage == 2) {
  10012. method146();
  10013. }
  10014. if(backDialogID == -1)
  10015. {
  10016. if(is474 || is480 || is508 || is525 || is562) {
  10017. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  10018. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  10019. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  10020. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  10021. if(i < 0)
  10022. i = 0;
  10023. if(i > anInt1211 - 110)
  10024. i = anInt1211 - 110;
  10025. if(anInt1089 != i) {
  10026. anInt1089 = i;
  10027. inputTaken = true;
  10028. }
  10029. } else {
  10030. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 77;
  10031. if(super.mouseX > 448 && super.mouseX < 560 && super.mouseY > 332)
  10032. method65(463, 77, super.mouseX - 17, super.mouseY - 357, aClass9_1059, 0, false, anInt1211);
  10033. int i = anInt1211 - 77 - aClass9_1059.scrollPosition;
  10034. if(i < 0)
  10035. i = 0;
  10036. if(i > anInt1211 - 77)
  10037. i = anInt1211 - 77;
  10038. if(anInt1089 != i) {
  10039. anInt1089 = i;
  10040. inputTaken = true;
  10041. }
  10042. }
  10043. }
  10044. if(backDialogID != -1) {
  10045. boolean flag2 = method119(anInt945, backDialogID);
  10046. if(flag2)
  10047. inputTaken = true;
  10048. }
  10049. if(atInventoryInterfaceType == 3)
  10050. inputTaken = true;
  10051. if(activeInterfaceType == 3)
  10052. inputTaken = true;
  10053. if(aString844 != null)
  10054. inputTaken = true;
  10055. if(menuOpen && menuScreenArea == 2)
  10056. inputTaken = true;
  10057. if(inputTaken) {
  10058. drawChatArea();
  10059. inputTaken = false;
  10060. }
  10061. if(loadingStage == 2) {
  10062. drawMinimap();
  10063. mapBackImage.drawGraphics(0, super.graphics, 516);//545
  10064. }
  10065. if(anInt1054 != -1)
  10066. tabAreaAltered = true;
  10067. if(tabAreaAltered)
  10068. {
  10069. if(anInt1054 != -1 && anInt1054 == tabID)
  10070. {
  10071. anInt1054 = -1;
  10072. stream.createFrame(120);
  10073. stream.writeWordBigEndian(tabID);
  10074. }
  10075. tabAreaAltered = false;
  10076. aRSImageProducer_1125.initDrawingArea();
  10077. inGameScreen.initDrawingArea();
  10078. }
  10079. if(menuOpen){
  10080. drawMenu(516, 466);
  10081. }
  10082. anInt945 = 0;
  10083. }
  10084.  
  10085. private boolean buildFriendsListMenu(RSInterface class9)
  10086. {
  10087. int i = class9.contentType;
  10088. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  10089. {
  10090. if(i >= 801)
  10091. i -= 701;
  10092. else
  10093. if(i >= 701)
  10094. i -= 601;
  10095. else
  10096. if(i >= 101)
  10097. i -= 101;
  10098. else
  10099. i--;
  10100. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  10101. menuActionID[menuActionRow] = 792;
  10102. menuActionRow++;
  10103. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  10104. menuActionID[menuActionRow] = 639;
  10105. menuActionRow++;
  10106. return true;
  10107. }
  10108. if(i >= 401 && i <= 500)
  10109. {
  10110. menuActionName[menuActionRow] = "Remove @whi@" + class9.disabledMessage;
  10111. menuActionID[menuActionRow] = 322;
  10112. menuActionRow++;
  10113. return true;
  10114. } else
  10115. {
  10116. return false;
  10117. }
  10118. }
  10119.  
  10120. private void method104()
  10121. {
  10122. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  10123. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  10124. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  10125. class30_sub2_sub4_sub3.unlink();
  10126. else
  10127. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  10128. {
  10129. class30_sub2_sub4_sub3.method454(anInt945);
  10130. if(class30_sub2_sub4_sub3.aBoolean1567)
  10131. class30_sub2_sub4_sub3.unlink();
  10132. else
  10133. 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);
  10134. }
  10135.  
  10136. }
  10137.  
  10138. private void drawInterface(int j, int k, RSInterface class9, int l) {
  10139. if(class9.interfaceType != 0 || class9.children == null)
  10140. return;
  10141. if(class9.interfaceShown && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  10142. return;
  10143. int i1 = DrawingArea.topX;
  10144. int j1 = DrawingArea.topY;
  10145. int k1 = DrawingArea.bottomX;
  10146. int l1 = DrawingArea.bottomY;
  10147. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  10148. int i2 = class9.children.length;
  10149. for(int j2 = 0; j2 < i2; j2++) {
  10150. int k2 = class9.childX[j2] + k;
  10151. int l2 = (class9.childY[j2] + l) - j;
  10152. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  10153. k2 += class9_1.xOffset;
  10154. l2 += class9_1.yOffset;
  10155. if(class9_1.contentType > 0)
  10156. drawFriendsListOrWelcomeScreen(class9_1);
  10157. //here
  10158. int[] IDs = {
  10159. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  10160. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  10161. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  10162. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  10163. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  10164. /* Ancients */
  10165. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  10166. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  10167. };
  10168. for(int m5 = 0; m5 < IDs.length; m5++) {
  10169. if(class9_1.id == IDs[m5] + 1) {
  10170. if(m5 > 61)
  10171. drawBlackBox(k2 + 1, l2);
  10172. else
  10173. drawBlackBox(k2, l2 + 1);
  10174. }
  10175. }
  10176. int[] runeChildren = {
  10177. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  10178. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  10179. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  10180. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  10181. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  10182. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  10183. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  10184. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  10185. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  10186. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  10187. 15885, 18474, 18475, 18478
  10188. };
  10189. for(int r = 0; r < runeChildren.length; r++)
  10190. if(class9_1.id == runeChildren[r])
  10191. class9_1.modelZoom = 775;
  10192.  
  10193.  
  10194. if(class9_1.interfaceType == 0) {
  10195. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  10196. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  10197. if(class9_1.scrollPosition < 0)
  10198. class9_1.scrollPosition = 0;
  10199. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  10200. if(class9_1.scrollMax > class9_1.height)
  10201. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  10202. } else if(class9_1.interfaceType != 1)
  10203. if(class9_1.interfaceType == 2) {
  10204. int i3 = 0;
  10205. for(int l3 = 0; l3 < class9_1.height; l3++) {
  10206. for(int l4 = 0; l4 < class9_1.width; l4++) {
  10207. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  10208. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  10209. if(i3 < 20) {
  10210. k5 += class9_1.spritesX[i3];
  10211. j6 += class9_1.spritesY[i3];
  10212. }
  10213. if(class9_1.inventory[i3] > 0) {
  10214. int k6 = 0;
  10215. int j7 = 0;
  10216. int j9 = class9_1.inventory[i3] - 1;
  10217. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  10218. int l9 = 0;
  10219. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  10220. l9 = 0xffffff;
  10221. Sprite Sprite_2 = ItemDef.getSprite(j9, class9_1.inventoryValue[i3], l9);
  10222. if(Sprite_2 != null) {
  10223. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  10224. k6 = super.mouseX - anInt1087;
  10225. j7 = super.mouseY - anInt1088;
  10226. if(k6 < 5 && k6 > -5)
  10227. k6 = 0;
  10228. if(j7 < 5 && j7 > -5)
  10229. j7 = 0;
  10230. if(anInt989 < 5) {
  10231. k6 = 0;
  10232. j7 = 0;
  10233. }
  10234. Sprite_2.drawSprite1(k5 + k6, j6 + j7);
  10235. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  10236. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  10237. if(i10 > anInt945 * 10)
  10238. i10 = anInt945 * 10;
  10239. if(i10 > class9.scrollPosition)
  10240. i10 = class9.scrollPosition;
  10241. class9.scrollPosition -= i10;
  10242. anInt1088 += i10;
  10243. }
  10244. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  10245. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  10246. if(j10 > anInt945 * 10)
  10247. j10 = anInt945 * 10;
  10248. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  10249. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  10250. class9.scrollPosition += j10;
  10251. anInt1088 -= j10;
  10252. }
  10253. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  10254. Sprite_2.drawSprite1(k5, j6);
  10255. else
  10256. Sprite_2.drawSprite(k5, j6);
  10257. if(Sprite_2.maxWidth == 33 || class9_1.inventoryValue[i3] != 1)
  10258. {
  10259. int k10 = class9_1.inventoryValue[i3];
  10260. smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  10261. if(k10 >= 1)
  10262. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  10263. if(k10 >= 100000)
  10264. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  10265. if(k10 >= 10000000)
  10266. smallText.method385(0x00FF80, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  10267. }
  10268. }
  10269. }
  10270. } else if(class9_1.sprites != null && i3 < 20) {
  10271. Sprite Sprite_1 = class9_1.sprites[i3];
  10272. if(Sprite_1 != null)
  10273. Sprite_1.drawSprite(k5, j6);
  10274. }
  10275. i3++;
  10276. }
  10277. }
  10278. } else if(class9_1.interfaceType == 3) {
  10279. boolean flag = false;
  10280. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  10281. flag = true;
  10282. int j3;
  10283. if(interfaceIsSelected(class9_1)) {
  10284. j3 = class9_1.enabledColor;
  10285. if(flag && class9_1.enabledHoverColor != 0)
  10286. j3 = class9_1.enabledHoverColor;
  10287. } else {
  10288. j3 = class9_1.disabledColor;
  10289. if(flag && class9_1.disabledHoverColor != 0)
  10290. j3 = class9_1.disabledHoverColor;
  10291. }
  10292. if(class9_1.opacity == 0) {
  10293. if(class9_1.boxFilled)
  10294. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  10295. else
  10296. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  10297. } else if(class9_1.boxFilled)
  10298. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.opacity & 0xff), k2);
  10299. else
  10300. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.opacity & 0xff), j3, class9_1.width, k2);
  10301. } else if(class9_1.interfaceType == 4) {
  10302. RSFont textDrawingArea = class9_1.rsFonts;
  10303. String s = class9_1.disabledMessage;
  10304. boolean flag1 = false;
  10305. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  10306. flag1 = true;
  10307. int i4;
  10308. if(interfaceIsSelected(class9_1)) {
  10309. i4 = class9_1.enabledColor;
  10310. if(flag1 && class9_1.enabledHoverColor != 0)
  10311. i4 = class9_1.enabledHoverColor;
  10312. if(class9_1.enabledMessage.length() > 0)
  10313. s = class9_1.enabledMessage;
  10314. } else {
  10315. i4 = class9_1.disabledColor;
  10316. if(flag1 && class9_1.disabledHoverColor != 0)
  10317. i4 = class9_1.disabledHoverColor;
  10318. }
  10319. if(class9_1.atActionType == 6 && aBoolean1149) {
  10320. s = "Please wait...";
  10321. i4 = class9_1.disabledColor;
  10322. }
  10323. if(DrawingArea.width == 516) {//519
  10324. if(i4 == 0xffff00)
  10325. i4 = 255;
  10326. if(i4 == 49152)
  10327. i4 = 0xffffff;
  10328. }
  10329. //Magic interface
  10330. if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  10331. switch (i4) {
  10332. case 16773120: i4 = 0xFE981F; break;
  10333. case 7040819: i4 = 0xAF6A1A; break;
  10334. }
  10335. }
  10336. //Skill interface
  10337. int id = 4004; int id2 = 4005;
  10338. if(class9_1.parentID == 3917 && class9_1.id != id && class9_1.id != id+2 && class9_1.id != id+4 && class9_1.id != id+6
  10339. && 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
  10340. && 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
  10341. && class9_1.id != id+28 && class9_1.id != id+30 && class9_1.id != id+32 && class9_1.id != id+34 && class9_1.id != 13926
  10342. && 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
  10343. && 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
  10344. && 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
  10345. && class9_1.id != id2+28 && class9_1.id != id2+30 && class9_1.id != id2+32 && class9_1.id != id2+34 && class9_1.id != 13927
  10346. && class9_1.id != 4153 && class9_1.id != 12167 && class9_1.id != 4026) {
  10347. if(i4 == 16776960)
  10348. i4 = 0x0000;
  10349. class9_1.textShadowed = false;
  10350. }
  10351. /*if(class9_1.parentID == 3917) {
  10352. for(int i = 4004; i < 4040; i++) {
  10353. int[] moreData = {
  10354. 13926, 4152, 12166, 13927,
  10355. 4153, 12167, 4026
  10356. };
  10357. if(class9_1.id == i || class9_1.id == moreData[i]) {
  10358. return;
  10359. }
  10360. if(i4 == 16776960) {
  10361. i4 = 0x0000;
  10362. class9_1.textShadowed = false;
  10363. }
  10364. }
  10365. }*/
  10366. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  10367. {
  10368. if(s.indexOf("%") != -1)
  10369. {
  10370. do
  10371. {
  10372. int k7 = s.indexOf("%1");
  10373. if(k7 == -1)
  10374. break;
  10375. 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)
  10376. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  10377. else
  10378. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  10379. } while(true);
  10380. do
  10381. {
  10382. int l7 = s.indexOf("%2");
  10383. if(l7 == -1)
  10384. break;
  10385. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  10386. } while(true);
  10387. do
  10388. {
  10389. int i8 = s.indexOf("%3");
  10390. if(i8 == -1)
  10391. break;
  10392. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  10393. } while(true);
  10394. do
  10395. {
  10396. int j8 = s.indexOf("%4");
  10397. if(j8 == -1)
  10398. break;
  10399. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  10400. } while(true);
  10401. do
  10402. {
  10403. int k8 = s.indexOf("%5");
  10404. if(k8 == -1)
  10405. break;
  10406. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  10407. } while(true);
  10408. }
  10409. int l8 = s.indexOf("\\n");
  10410. String s1;
  10411. if(l8 != -1)
  10412. {
  10413. s1 = s.substring(0, l8);
  10414. s = s.substring(l8 + 2);
  10415. } else
  10416. {
  10417. s1 = s;
  10418. s = "";
  10419. }
  10420. if(class9_1.textCentered)
  10421. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadowed);
  10422. else
  10423. textDrawingArea.method389(class9_1.textShadowed, k2, i4, s1, l6);
  10424. }
  10425. } else if(class9_1.interfaceType == 5) {
  10426. //whats this?
  10427.  
  10428. Sprite sprite;
  10429. if(interfaceIsSelected(class9_1))
  10430. sprite = class9_1.enabledSprite;
  10431. else
  10432. sprite = class9_1.disabledSprite;
  10433. if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  10434. sprite.drawSprite2(k2, l2, 0xffffff);
  10435. } else {
  10436. if (sprite != null)
  10437. sprite.drawSprite(k2, l2);
  10438. }
  10439. if(sprite != null)
  10440. sprite.drawSprite(k2, l2);
  10441. } else if(class9_1.interfaceType == 6) {
  10442. int k3 = Texture.textureInt1;
  10443. int j4 = Texture.textureInt2;
  10444. Texture.textureInt1 = k2 + class9_1.width / 2;
  10445. Texture.textureInt2 = l2 + class9_1.height / 2;
  10446. int i5 = Texture.anIntArray1470[class9_1.modelRotationY] * class9_1.modelZoom >> 16;
  10447. int l5 = Texture.anIntArray1471[class9_1.modelRotationY] * class9_1.modelZoom >> 16;
  10448. boolean flag2 = interfaceIsSelected(class9_1);
  10449. int i7;
  10450. if(flag2)
  10451. i7 = class9_1.enabledAnimation;
  10452. else
  10453. i7 = class9_1.disabledAnimation;
  10454. Model model;
  10455. if(i7 == -1) {
  10456. model = class9_1.method209(-1, -1, flag2);
  10457. } else {
  10458. Animation animation = Animation.anims[i7];
  10459. model = class9_1.method209(animation.anIntArray354[class9_1.animationLength], animation.anIntArray353[class9_1.animationLength], flag2);
  10460. }
  10461. if(model != null)
  10462. model.method482(class9_1.modelRotationX, 0, class9_1.modelRotationY, 0, i5, l5);
  10463. Texture.textureInt1 = k3;
  10464. Texture.textureInt2 = j4;
  10465. } else if(class9_1.interfaceType == 7) {
  10466. RSFont textDrawingArea_1 = class9_1.rsFonts;
  10467. int k4 = 0;
  10468. for(int j5 = 0; j5 < class9_1.height; j5++) {
  10469. for(int i6 = 0; i6 < class9_1.width; i6++) {
  10470. if(class9_1.inventory[k4] > 0) {
  10471. ItemDef itemDef = ItemDef.forID(class9_1.inventory[k4] - 1);
  10472. String s2 = itemDef.name;
  10473. if(itemDef.stackable || class9_1.inventoryValue[k4] != 1)
  10474. s2 = s2 + " x" + intToKOrMilLongName(class9_1.inventoryValue[k4]);
  10475. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  10476. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  10477. if(class9_1.textCentered)
  10478. textDrawingArea_1.method382(class9_1.disabledColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadowed);
  10479. else
  10480. textDrawingArea_1.method389(class9_1.textShadowed, i9, class9_1.disabledColor, s2, k9);
  10481. }
  10482. k4++;
  10483. }
  10484. }
  10485. }
  10486. else if (class9_1.interfaceType == 8 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && anInt1501 == 100) {
  10487. int boxWidth = 0;
  10488. int boxHeight = 0;
  10489. RSFont textDrawingArea_2 = aTextDrawingArea_1271;
  10490. for (String s1 = class9_1.disabledMessage; s1.length() > 0;) {
  10491. int l7 = s1.indexOf("\\n");
  10492. String s4;
  10493. if (l7 != -1) {
  10494. s4 = s1.substring(0, l7);
  10495. s1 = s1.substring(l7 + 2);
  10496. } else {
  10497. s4 = s1;
  10498. s1 = "";
  10499. }
  10500. int j10 = textDrawingArea_2.getTextWidth(s4);
  10501. if (j10 > boxWidth) {
  10502. boxWidth = j10;
  10503. }
  10504. boxHeight += textDrawingArea_2.anInt1497 + 1;
  10505. }
  10506. boxWidth += 6;
  10507. boxHeight += 7;
  10508. int xPos = (l2 + class9_1.width) - 5 - boxWidth;
  10509. int yPos = k2 + class9_1.height + 5;
  10510. if (xPos < l2 + 5) {
  10511. xPos = l2 + 5;
  10512. }
  10513. if (xPos + boxWidth > j + class9.width) {
  10514. xPos = (j + class9.width) - boxWidth;
  10515. }
  10516. if (yPos + boxHeight > k + class9.height) {
  10517. yPos = (k + class9.height) - boxHeight;
  10518. }
  10519. DrawingArea.method336(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  10520. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  10521. String s2 = class9_1.disabledMessage;
  10522. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {//anInt1497
  10523. int l11 = s2.indexOf("\\n");
  10524. String s5;
  10525. if (l11 != -1) {
  10526. s5 = s2.substring(0, l11);
  10527. s2 = s2.substring(l11 + 2);
  10528. } else {
  10529. s5 = s2;
  10530. s2 = "";
  10531. }
  10532. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  10533. }
  10534. } else if (class9_1.interfaceType == 9) {
  10535. drawHoverBox(k2, l2, class9_1.disabledMessage);
  10536. }
  10537. }
  10538. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  10539. }
  10540.  
  10541. private void randomizeBackground(Background background) {
  10542. int j = 256;
  10543. for(int k = 0; k < anIntArray1190.length; k++)
  10544. anIntArray1190[k] = 0;
  10545.  
  10546. for(int l = 0; l < 5000; l++) {
  10547. int i1 = (int)(Math.random() * 128D * (double)j);
  10548. anIntArray1190[i1] = (int)(Math.random() * 256D);
  10549. }
  10550. for(int j1 = 0; j1 < 20; j1++) {
  10551. for(int k1 = 1; k1 < j - 1; k1++) {
  10552. for(int i2 = 1; i2 < 127; i2++) {
  10553. int k2 = i2 + (k1 << 7);
  10554. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  10555. }
  10556.  
  10557. }
  10558. int ai[] = anIntArray1190;
  10559. anIntArray1190 = anIntArray1191;
  10560. anIntArray1191 = ai;
  10561. }
  10562. if(background != null) {
  10563. int l1 = 0;
  10564. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  10565. for(int l2 = 0; l2 < background.anInt1452; l2++)
  10566. if(background.aByteArray1450[l1++] != 0) {
  10567. int i3 = l2 + 16 + background.anInt1454;
  10568. int j3 = j2 + 16 + background.anInt1455;
  10569. int k3 = i3 + (j3 << 7);
  10570. anIntArray1190[k3] = 0;
  10571. }
  10572. }
  10573. }
  10574. }
  10575.  
  10576. private void method107(int i, int j, Stream stream, Player player)
  10577. {
  10578. if((i & 0x400) != 0)
  10579. {
  10580. player.anInt1543 = stream.method428();
  10581. player.anInt1545 = stream.method428();
  10582. player.anInt1544 = stream.method428();
  10583. player.anInt1546 = stream.method428();
  10584. player.anInt1547 = stream.method436() + loopCycle;
  10585. player.anInt1548 = stream.method435() + loopCycle;
  10586. player.anInt1549 = stream.method428();
  10587. player.method446();
  10588. }
  10589. if((i & 0x100) != 0)
  10590. {
  10591. player.anInt1520 = stream.method434();
  10592. int k = stream.readDWord();
  10593. player.anInt1524 = k >> 16;
  10594. player.anInt1523 = loopCycle + (k & 0xffff);
  10595. player.anInt1521 = 0;
  10596. player.anInt1522 = 0;
  10597. if(player.anInt1523 > loopCycle)
  10598. player.anInt1521 = -1;
  10599. if(player.anInt1520 == 65535)
  10600. player.anInt1520 = -1;
  10601. }
  10602. if((i & 8) != 0)
  10603. {
  10604. int l = stream.method434();
  10605. if(l == 65535)
  10606. l = -1;
  10607. int i2 = stream.method427();
  10608. if(l == player.anim && l != -1)
  10609. {
  10610. int i3 = Animation.anims[l].anInt365;
  10611. if(i3 == 1)
  10612. {
  10613. player.anInt1527 = 0;
  10614. player.anInt1528 = 0;
  10615. player.anInt1529 = i2;
  10616. player.anInt1530 = 0;
  10617. }
  10618. if(i3 == 2)
  10619. player.anInt1530 = 0;
  10620. } else
  10621. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  10622. {
  10623. player.anim = l;
  10624. player.anInt1527 = 0;
  10625. player.anInt1528 = 0;
  10626. player.anInt1529 = i2;
  10627. player.anInt1530 = 0;
  10628. player.anInt1542 = player.smallXYIndex;
  10629. }
  10630. }
  10631. if((i & 4) != 0)
  10632. {
  10633. player.textSpoken = stream.readString();
  10634. if(player.textSpoken.charAt(0) == '~')
  10635. {
  10636. player.textSpoken = player.textSpoken.substring(1);
  10637. pushMessage(player.textSpoken, 2, player.name);
  10638. } else
  10639. if(player == myPlayer)
  10640. pushMessage(player.textSpoken, 2, player.name);
  10641. player.anInt1513 = 0;
  10642. player.anInt1531 = 0;
  10643. player.textCycle = 150;
  10644. }
  10645. if((i & 0x80) != 0)
  10646. {
  10647. //right fucking here
  10648. int i1 = stream.method434();
  10649. int j2 = stream.readUnsignedByte();
  10650. int j3 = stream.method427();
  10651. int k3 = stream.currentOffset;
  10652. if(player.name != null && player.visible)
  10653. {
  10654. long l3 = TextClass.longForName(player.name);
  10655. boolean flag = false;
  10656. if(j2 <= 1)
  10657. {
  10658. for(int i4 = 0; i4 < ignoreCount; i4++)
  10659. {
  10660. if(ignoreListAsLongs[i4] != l3)
  10661. continue;
  10662. flag = true;
  10663. break;
  10664. }
  10665.  
  10666. }
  10667. if(!flag && anInt1251 == 0)
  10668. try
  10669. {
  10670. aStream_834.currentOffset = 0;
  10671. stream.method442(j3, 0, aStream_834.buffer);
  10672. aStream_834.currentOffset = 0;
  10673. String s = TextInput.method525(j3, aStream_834);
  10674. //s = Censor.doCensor(s);
  10675. player.textSpoken = s;
  10676. player.anInt1513 = i1 >> 8;
  10677. player.privelage = j2;
  10678. player.anInt1531 = i1 & 0xff;
  10679. player.textCycle = 150;
  10680. //Other players see your icon
  10681. if(j2 == 4)
  10682. pushMessage(s, 1, "@cr3@" + player.name);
  10683. else if(j2 == 3)
  10684. pushMessage(s, 1, "@cr2@" + player.name);
  10685. else if(j2 == 2)
  10686. pushMessage(s, 1, "@cr1@" + player.name);
  10687. else if (j2 == 1)
  10688. pushMessage(s, 1, "@cr0@" + player.name);
  10689. else if (j2 == 5)
  10690. pushMessage(s, 1, "@cr4@" + player.name);
  10691.  
  10692. else
  10693. pushMessage(s, 2, player.name);
  10694. }
  10695. catch(Exception exception)
  10696. {
  10697. signlink.reporterror("cde2");
  10698. }
  10699. }
  10700. stream.currentOffset = k3 + j3;
  10701. }
  10702. if((i & 1) != 0)
  10703. {
  10704. player.interactingEntity = stream.method434();
  10705. if(player.interactingEntity == 65535)
  10706. player.interactingEntity = -1;
  10707. }
  10708. if((i & 0x10) != 0)
  10709. {
  10710. int j1 = stream.method427();
  10711. byte abyte0[] = new byte[j1];
  10712. Stream stream_1 = new Stream(abyte0);
  10713. stream.readBytes(j1, 0, abyte0);
  10714. aStreamArray895s[j] = stream_1;
  10715. player.updatePlayer(stream_1);
  10716. }
  10717. if((i & 2) != 0)
  10718. {
  10719. player.anInt1538 = stream.method436();
  10720. player.anInt1539 = stream.method434();
  10721. }
  10722. if((i & 0x20) != 0)
  10723. {
  10724. int k1 = stream.readUnsignedByte();
  10725. int k2 = stream.method426();
  10726. player.updateHitData(k2, k1, loopCycle);
  10727. player.loopCycleStatus = loopCycle + 300;
  10728. player.currentHealth = stream.method427();
  10729. player.maxHealth = stream.readUnsignedByte();
  10730. }
  10731. if((i & 0x200) != 0)
  10732. {
  10733. int l1 = stream.readUnsignedByte();
  10734. int l2 = stream.method428();
  10735. player.updateHitData(l2, l1, loopCycle);
  10736. player.loopCycleStatus = loopCycle + 300;
  10737. player.currentHealth = stream.readUnsignedByte();
  10738. player.maxHealth = stream.method427();
  10739. }
  10740. }
  10741.  
  10742. private void method108()
  10743. {
  10744. try
  10745. {
  10746. int j = myPlayer.x + anInt1278;
  10747. int k = myPlayer.y + anInt1131;
  10748. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  10749. {
  10750. anInt1014 = j;
  10751. anInt1015 = k;
  10752. }
  10753. if(anInt1014 != j)
  10754. anInt1014 += (j - anInt1014) / 16;
  10755. if(anInt1015 != k)
  10756. anInt1015 += (k - anInt1015) / 16;
  10757. if(super.keyArray[1] == 1)
  10758. anInt1186 += (-24 - anInt1186) / 2;
  10759. else
  10760. if(super.keyArray[2] == 1)
  10761. anInt1186 += (24 - anInt1186) / 2;
  10762. else
  10763. anInt1186 /= 2;
  10764. if(super.keyArray[3] == 1)
  10765. anInt1187 += (12 - anInt1187) / 2;
  10766. else
  10767. if(super.keyArray[4] == 1)
  10768. anInt1187 += (-12 - anInt1187) / 2;
  10769. else
  10770. anInt1187 /= 2;
  10771. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  10772. anInt1184 += anInt1187 / 2;
  10773. if(anInt1184 < 128)
  10774. anInt1184 = 128;
  10775. if(anInt1184 > 383)
  10776. anInt1184 = 383;
  10777. int l = anInt1014 >> 7;
  10778. int i1 = anInt1015 >> 7;
  10779. int j1 = method42(plane, anInt1015, anInt1014);
  10780. int k1 = 0;
  10781. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  10782. {
  10783. for(int l1 = l - 4; l1 <= l + 4; l1++)
  10784. {
  10785. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  10786. {
  10787. int l2 = plane;
  10788. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  10789. l2++;
  10790. int i3 = j1 - intGroundArray[l2][l1][k2];
  10791. if(i3 > k1)
  10792. k1 = i3;
  10793. }
  10794.  
  10795. }
  10796.  
  10797. }
  10798. anInt1005++;
  10799. if(anInt1005 > 1512)
  10800. {
  10801. anInt1005 = 0;
  10802. stream.createFrame(77);
  10803. stream.writeWordBigEndian(0);
  10804. int i2 = stream.currentOffset;
  10805. stream.writeWordBigEndian((int)(Math.random() * 256D));
  10806. stream.writeWordBigEndian(101);
  10807. stream.writeWordBigEndian(233);
  10808. stream.writeWord(45092);
  10809. if((int)(Math.random() * 2D) == 0)
  10810. stream.writeWord(35784);
  10811. stream.writeWordBigEndian((int)(Math.random() * 256D));
  10812. stream.writeWordBigEndian(64);
  10813. stream.writeWordBigEndian(38);
  10814. stream.writeWord((int)(Math.random() * 65536D));
  10815. stream.writeWord((int)(Math.random() * 65536D));
  10816. stream.writeBytes(stream.currentOffset - i2);
  10817. }
  10818. int j2 = k1 * 192;
  10819. if(j2 > 0x17f00)
  10820. j2 = 0x17f00;
  10821. if(j2 < 32768)
  10822. j2 = 32768;
  10823. if(j2 > anInt984)
  10824. {
  10825. anInt984 += (j2 - anInt984) / 24;
  10826. return;
  10827. }
  10828. if(j2 < anInt984)
  10829. {
  10830. anInt984 += (j2 - anInt984) / 80;
  10831. }
  10832. }
  10833. catch(Exception _ex)
  10834. {
  10835. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  10836. throw new RuntimeException("eek");
  10837. }
  10838. }
  10839.  
  10840. public void processDrawing()
  10841. {
  10842. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  10843. {
  10844. showErrorScreen();
  10845. return;
  10846. }
  10847. anInt1061++;
  10848. if(!loggedIn) {
  10849. drawLoginScreen(false);
  10850. }else{
  10851. drawGameScreen();
  10852. }
  10853. anInt1213 = 0;
  10854. }
  10855.  
  10856. private boolean isFriendOrSelf(String s)
  10857. {
  10858. if(s == null)
  10859. return false;
  10860. for(int i = 0; i < friendsCount; i++)
  10861. if(s.equalsIgnoreCase(friendsList[i]))
  10862. return true;
  10863. return s.equalsIgnoreCase(myPlayer.name);
  10864. }
  10865.  
  10866. private static String combatDiffColor(int i, int j)
  10867. {
  10868. int k = i - j;
  10869. if(k < -9)
  10870. return "@red@";
  10871. if(k < -6)
  10872. return "@or3@";
  10873. if(k < -3)
  10874. return "@or2@";
  10875. if(k < 0)
  10876. return "@or1@";
  10877. if(k > 9)
  10878. return "@gre@";
  10879. if(k > 6)
  10880. return "@gr3@";
  10881. if(k > 3)
  10882. return "@gr2@";
  10883. if(k > 0)
  10884. return "@gr1@";
  10885. else
  10886. return "@yel@";
  10887. }
  10888.  
  10889. private void setWaveVolume(int i)
  10890. {
  10891. signlink.wavevol = i;
  10892. }
  10893.  
  10894. private void draw3dScreen()
  10895. {
  10896. drawSplitPrivateChat();
  10897. if(crossType == 1)
  10898. {
  10899. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  10900. anInt1142++;
  10901. if(anInt1142 > 67)
  10902. {
  10903. anInt1142 = 0;
  10904. stream.createFrame(78);
  10905. }
  10906. }
  10907. if(crossType == 2)
  10908. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  10909. if(anInt1018 != -1)
  10910. {
  10911. method119(anInt945, anInt1018);
  10912. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  10913. }
  10914. if(openInterfaceID != -1)
  10915. {
  10916. method119(anInt945, openInterfaceID);
  10917. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  10918. }
  10919. method70();
  10920. if(!menuOpen)
  10921. {
  10922. processRightClick();
  10923. drawTooltip();
  10924. } else
  10925. drawMenu(4, 4);
  10926. if(anInt1055 == 1)
  10927. multiOverlay.drawSprite(472, 296);
  10928. if(fpsOn)
  10929. {
  10930. char c = '\u01FB';
  10931. int k = 20;
  10932. int i1 = 0xffff00;
  10933. if(super.fps < 15)
  10934. i1 = 0xff0000;
  10935. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  10936. k += 15;
  10937. Runtime runtime = Runtime.getRuntime();
  10938. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10939. i1 = 0xffff00;
  10940. if(j1 > 0x2000000 && lowMem)
  10941. i1 = 0xff0000;
  10942. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  10943. k += 15;
  10944. }
  10945. int i1 = 0xffff00;
  10946. int x = baseX + (myPlayer.x - 6 >> 7);
  10947. int y = baseY + (myPlayer.y - 6 >> 7);
  10948. if (clientData)
  10949. {
  10950. char c = '\u01FB';
  10951. int k = 20;
  10952. if(super.fps < 15)
  10953. i1 = 0xff0000;
  10954. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  10955. Runtime runtime = Runtime.getRuntime();
  10956. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10957. i1 = 0xffff00;
  10958. if(j1 > 0x2000000 && lowMem)
  10959. i1 = 0xff0000;
  10960. k += 15;
  10961. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  10962. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  10963. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  10964. }
  10965. if(anInt1104 != 0)
  10966. {
  10967. int j = anInt1104 / 50;
  10968. int l = j / 60;
  10969. j %= 60;
  10970. if(j < 10)
  10971. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  10972. else
  10973. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  10974. anInt849++;
  10975. if(anInt849 > 75)
  10976. {
  10977. anInt849 = 0;
  10978. stream.createFrame(148);
  10979. }
  10980. }
  10981. }
  10982.  
  10983. private void addIgnore(long l)
  10984. {
  10985. try
  10986. {
  10987. if(l == 0L)
  10988. return;
  10989. if(ignoreCount >= 100)
  10990. {
  10991. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  10992. return;
  10993. }
  10994. String s = TextClass.fixName(TextClass.nameForLong(l));
  10995. for(int j = 0; j < ignoreCount; j++)
  10996. if(ignoreListAsLongs[j] == l)
  10997. {
  10998. pushMessage(s + " is already on your ignore list", 0, "");
  10999. return;
  11000. }
  11001. for(int k = 0; k < friendsCount; k++)
  11002. if(friendsListAsLongs[k] == l)
  11003. {
  11004. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  11005. return;
  11006. }
  11007.  
  11008. ignoreListAsLongs[ignoreCount++] = l;
  11009. needDrawTabArea = true;
  11010. stream.createFrame(133);
  11011. stream.writeQWord(l);
  11012. return;
  11013. }
  11014. catch(RuntimeException runtimeexception)
  11015. {
  11016. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  11017. }
  11018. throw new RuntimeException();
  11019. }
  11020.  
  11021. private void method114()
  11022. {
  11023. for(int i = -1; i < playerCount; i++)
  11024. {
  11025. int j;
  11026. if(i == -1)
  11027. j = myPlayerIndex;
  11028. else
  11029. j = playerIndices[i];
  11030. Player player = playerArray[j];
  11031. if(player != null)
  11032. method96(player);
  11033. }
  11034.  
  11035. }
  11036.  
  11037. private void method115()
  11038. {
  11039. if(loadingStage == 2)
  11040. {
  11041. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  11042. {
  11043. if(class30_sub1.anInt1294 > 0)
  11044. class30_sub1.anInt1294--;
  11045. if(class30_sub1.anInt1294 == 0)
  11046. {
  11047. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  11048. {
  11049. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  11050. class30_sub1.unlink();
  11051. }
  11052. } else
  11053. {
  11054. if(class30_sub1.anInt1302 > 0)
  11055. class30_sub1.anInt1302--;
  11056. 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)))
  11057. {
  11058. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  11059. class30_sub1.anInt1302 = -1;
  11060. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  11061. class30_sub1.unlink();
  11062. else
  11063. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  11064. class30_sub1.unlink();
  11065. }
  11066. }
  11067. }
  11068.  
  11069. }
  11070. }
  11071.  
  11072.  
  11073. private void determineMenuSize() {
  11074. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  11075. for(int j = 0; j < menuActionRow; j++)
  11076. {
  11077. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  11078. if(k > i)
  11079. i = k;
  11080. }
  11081. i += 8;
  11082. int l = 15 * menuActionRow + 21;
  11083. if(super.saveClickX > 0 && super.saveClickY > 0 && super.saveClickX < 765 && super.saveClickY < 503) {
  11084. int i1 = super.saveClickX - i / 2;
  11085. if(i1 + i > 765){
  11086. i1 = 765 - i;
  11087. }
  11088. if(i1 < 0){
  11089. i1 = 0;
  11090. }
  11091. int l1 = super.saveClickY - 0;
  11092. if(l1 + l > 503){
  11093. l1 = 503 - l;
  11094. }
  11095. if(l1 < 0){
  11096. l1 = 0;
  11097. }
  11098. menuOpen = true;
  11099. menuOffsetX = i1;
  11100. menuOffsetY = l1;
  11101. menuWidth = i;
  11102. menuHeight = 15 * menuActionRow + 22;
  11103. }
  11104. }
  11105.  
  11106. /*private void method117(Stream stream)
  11107. {
  11108. stream.initBitAccess();
  11109. int j = stream.readBits(1);
  11110. if(j == 0)
  11111. return;
  11112. int k = stream.readBits(2);
  11113. if(k == 0)
  11114. {
  11115. anIntArray894[anInt893++] = myPlayerIndex;
  11116. return;
  11117. }
  11118. if(k == 1)
  11119. {
  11120. int l = stream.readBits(3);
  11121. myPlayer.moveInDir(false, l);
  11122. int k1 = stream.readBits(1);
  11123. if(k1 == 1)
  11124. anIntArray894[anInt893++] = myPlayerIndex;
  11125. return;
  11126. }
  11127. if(k == 2)
  11128. {
  11129. int i1 = stream.readBits(3);
  11130. myPlayer.moveInDir(true, i1);
  11131. int l1 = stream.readBits(3);
  11132. myPlayer.moveInDir(true, l1);
  11133. int j2 = stream.readBits(1);
  11134. if(j2 == 1)
  11135. anIntArray894[anInt893++] = myPlayerIndex;
  11136. return;
  11137. }
  11138. if(k == 3)
  11139. {
  11140. plane = stream.readBits(2);
  11141. int j1 = stream.readBits(1);
  11142. int i2 = stream.readBits(1);
  11143. if(i2 == 1)
  11144. anIntArray894[anInt893++] = myPlayerIndex;
  11145. int k2 = stream.readBits(7);
  11146. int l2 = stream.readBits(7);
  11147. myPlayer.setPos(l2, k2, j1 == 1);
  11148. }
  11149. }
  11150.  
  11151. private void nullLoader()
  11152. {
  11153. aBoolean831 = false;
  11154. while(drawingFlames)
  11155. {
  11156. aBoolean831 = false;
  11157. try
  11158. {
  11159. Thread.sleep(50L);
  11160. }
  11161. catch(Exception _ex) { }
  11162. }
  11163. titleBox = null;
  11164. titleBox1 = null;
  11165. titleButton = null;
  11166. aBackgroundArray1152s = null;
  11167. anIntArray850 = null;
  11168. anIntArray851 = null;
  11169. anIntArray852 = null;
  11170. anIntArray853 = null;
  11171. anIntArray1190 = null;
  11172. anIntArray1191 = null;
  11173. anIntArray828 = null;
  11174. anIntArray829 = null;
  11175. aSprite_1201 = null;
  11176. aSprite_1202 = null;
  11177. }*/
  11178. private void method117(Stream stream)
  11179. {
  11180. stream.initBitAccess();
  11181. int j = stream.readBits(1);
  11182. if(j == 0)
  11183. return;
  11184. int k = stream.readBits(2);
  11185. if(k == 0)
  11186. {
  11187. anIntArray894[anInt893++] = myPlayerIndex;
  11188. return;
  11189. }
  11190. if(k == 1)
  11191. {
  11192. int l = stream.readBits(3);
  11193. myPlayer.moveInDir(false, l);
  11194. int k1 = stream.readBits(1);
  11195. if(k1 == 1)
  11196. anIntArray894[anInt893++] = myPlayerIndex;
  11197. return;
  11198. }
  11199. if(k == 2)
  11200. {
  11201. int i1 = stream.readBits(3);
  11202. myPlayer.moveInDir(true, i1);
  11203. int l1 = stream.readBits(3);
  11204. myPlayer.moveInDir(true, l1);
  11205. int j2 = stream.readBits(1);
  11206. if(j2 == 1)
  11207. anIntArray894[anInt893++] = myPlayerIndex;
  11208. return;
  11209. }
  11210. if(k == 3)
  11211. {
  11212. plane = stream.readBits(2);
  11213. int j1 = stream.readBits(1);
  11214. int i2 = stream.readBits(1);
  11215. if(i2 == 1)
  11216. anIntArray894[anInt893++] = myPlayerIndex;
  11217. int k2 = stream.readBits(7);
  11218. int l2 = stream.readBits(7);
  11219. myPlayer.setPos(l2, k2, j1 == 1);
  11220. }
  11221. }
  11222.  
  11223. private boolean method119(int i, int j)
  11224. {
  11225. boolean flag1 = false;
  11226. RSInterface class9 = RSInterface.interfaceCache[j];
  11227. for(int k = 0; k < class9.children.length; k++)
  11228. {
  11229. if(class9.children[k] == -1)
  11230. break;
  11231. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  11232. if(class9_1.interfaceType == 1) //if(class9.anInt262 == 1)?
  11233. flag1 |= method119(i, class9_1.id);
  11234. if(class9_1.interfaceType == 6 && (class9_1.disabledAnimation != -1 || class9_1.enabledAnimation != -1))
  11235. {
  11236. boolean flag2 = interfaceIsSelected(class9_1);
  11237. int l;
  11238. if(flag2)
  11239. l = class9_1.enabledAnimation;
  11240. else
  11241. l = class9_1.disabledAnimation;
  11242. if(l != -1)
  11243. {
  11244. Animation animation = Animation.anims[l];
  11245. for(class9_1.animationDelay += i; class9_1.animationDelay > animation.method258(class9_1.animationLength);)
  11246. {
  11247. class9_1.animationDelay -= animation.method258(class9_1.animationLength) + 1;
  11248. class9_1.animationLength++;
  11249. if(class9_1.animationLength >= animation.anInt352)
  11250. {
  11251. class9_1.animationLength -= animation.anInt356;
  11252. if(class9_1.animationLength < 0 || class9_1.animationLength >= animation.anInt352)
  11253. class9_1.animationLength = 0;
  11254. }
  11255. flag1 = true;
  11256. }
  11257.  
  11258. }
  11259. }
  11260. }
  11261.  
  11262. return flag1;
  11263. }
  11264.  
  11265. private int method120()
  11266. {
  11267. int j = 3;
  11268. if(yCameraCurve < 310)
  11269. {
  11270. int k = xCameraPos >> 7;
  11271. int l = yCameraPos >> 7;
  11272. int i1 = myPlayer.x >> 7;
  11273. int j1 = myPlayer.y >> 7;
  11274. if((byteGroundArray[plane][k][l] & 4) != 0)
  11275. j = plane;
  11276. int k1;
  11277. if(i1 > k)
  11278. k1 = i1 - k;
  11279. else
  11280. k1 = k - i1;
  11281. int l1;
  11282. if(j1 > l)
  11283. l1 = j1 - l;
  11284. else
  11285. l1 = l - j1;
  11286. if(k1 > l1)
  11287. {
  11288. int i2 = (l1 * 0x10000) / k1;
  11289. int k2 = 32768;
  11290. while(k != i1)
  11291. {
  11292. if(k < i1)
  11293. k++;
  11294. else
  11295. if(k > i1)
  11296. k--;
  11297. if((byteGroundArray[plane][k][l] & 4) != 0)
  11298. j = plane;
  11299. k2 += i2;
  11300. if(k2 >= 0x10000)
  11301. {
  11302. k2 -= 0x10000;
  11303. if(l < j1)
  11304. l++;
  11305. else
  11306. if(l > j1)
  11307. l--;
  11308. if((byteGroundArray[plane][k][l] & 4) != 0)
  11309. j = plane;
  11310. }
  11311. }
  11312. } else
  11313. {
  11314. int j2 = (k1 * 0x10000) / l1;
  11315. int l2 = 32768;
  11316. while(l != j1)
  11317. {
  11318. if(l < j1)
  11319. l++;
  11320. else
  11321. if(l > j1)
  11322. l--;
  11323. if((byteGroundArray[plane][k][l] & 4) != 0)
  11324. j = plane;
  11325. l2 += j2;
  11326. if(l2 >= 0x10000)
  11327. {
  11328. l2 -= 0x10000;
  11329. if(k < i1)
  11330. k++;
  11331. else
  11332. if(k > i1)
  11333. k--;
  11334. if((byteGroundArray[plane][k][l] & 4) != 0)
  11335. j = plane;
  11336. }
  11337. }
  11338. }
  11339. }
  11340. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  11341. j = plane;
  11342. return j;
  11343. }
  11344.  
  11345. private int method121()
  11346. {
  11347. int j = method42(plane, yCameraPos, xCameraPos);
  11348. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  11349. return plane;
  11350. else
  11351. return 3;
  11352. }
  11353.  
  11354. private void delIgnore(long l)
  11355. {
  11356. try
  11357. {
  11358. if(l == 0L)
  11359. return;
  11360. for(int j = 0; j < ignoreCount; j++)
  11361. if(ignoreListAsLongs[j] == l)
  11362. {
  11363. ignoreCount--;
  11364. needDrawTabArea = true;
  11365. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  11366.  
  11367. stream.createFrame(74);
  11368. stream.writeQWord(l);
  11369. return;
  11370. }
  11371.  
  11372. return;
  11373. }
  11374. catch(RuntimeException runtimeexception)
  11375. {
  11376. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  11377. }
  11378. throw new RuntimeException();
  11379. }
  11380.  
  11381.  
  11382. private void chatJoin(long l) {
  11383. try {
  11384. if(l == 0L)
  11385. return;
  11386. stream.createFrame(60);
  11387. stream.writeQWord(l);
  11388. return;
  11389. }
  11390. catch(RuntimeException runtimeexception)
  11391. {
  11392. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  11393. }
  11394. throw new RuntimeException();
  11395.  
  11396. }
  11397.  
  11398. public String getParameter(String s)
  11399. {
  11400. if(signlink.mainapp != null)
  11401. return signlink.mainapp.getParameter(s);
  11402. else
  11403. return super.getParameter(s);
  11404. }
  11405.  
  11406. private void adjustVolume(boolean flag, int i)
  11407. {
  11408. signlink.midivol = i;
  11409. if(flag)
  11410. signlink.midi = "voladjust";
  11411. }
  11412.  
  11413. private int extractInterfaceValues(RSInterface class9, int j)
  11414. {
  11415. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  11416. return -2;
  11417. try
  11418. {
  11419. int ai[] = class9.valueIndexArray[j];
  11420. int k = 0;
  11421. int l = 0;
  11422. int i1 = 0;
  11423. do
  11424. {
  11425. int j1 = ai[l++];
  11426. int k1 = 0;
  11427. byte byte0 = 0;
  11428. if(j1 == 0)
  11429. return k;
  11430. if(j1 == 1)
  11431. k1 = currentStats[ai[l++]];
  11432. if(j1 == 2)
  11433. k1 = maxStats[ai[l++]];
  11434. if(j1 == 3)
  11435. k1 = currentExp[ai[l++]];
  11436. if(j1 == 4)
  11437. {
  11438. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  11439. int k2 = ai[l++];
  11440. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  11441. {
  11442. for(int j3 = 0; j3 < class9_1.inventory.length; j3++)
  11443. if(class9_1.inventory[j3] == k2 + 1)
  11444. k1 += class9_1.inventoryValue[j3];
  11445.  
  11446. }
  11447. }
  11448. if(j1 == 5)
  11449. k1 = variousSettings[ai[l++]];
  11450. if(j1 == 6)
  11451. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  11452. if(j1 == 7)
  11453. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  11454. if(j1 == 8)
  11455. k1 = myPlayer.combatLevel;
  11456. if(j1 == 9)
  11457. {
  11458. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  11459. if(Skills.skillEnabled[l1])
  11460. k1 += maxStats[l1];
  11461.  
  11462. }
  11463. if(j1 == 10)
  11464. {
  11465. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  11466. int l2 = ai[l++] + 1;
  11467. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  11468. {
  11469. for(int k3 = 0; k3 < class9_2.inventory.length; k3++)
  11470. {
  11471. if(class9_2.inventory[k3] != l2)
  11472. continue;
  11473. k1 = 0x3b9ac9ff;
  11474. break;
  11475. }
  11476.  
  11477. }
  11478. }
  11479. if(j1 == 11)
  11480. k1 = energy;
  11481. if(j1 == 12)
  11482. k1 = weight;
  11483. if(j1 == 13)
  11484. {
  11485. int i2 = variousSettings[ai[l++]];
  11486. int i3 = ai[l++];
  11487. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  11488. }
  11489. if(j1 == 14)
  11490. {
  11491. int j2 = ai[l++];
  11492. VarBit varBit = VarBit.cache[j2];
  11493. int l3 = varBit.anInt648;
  11494. int i4 = varBit.anInt649;
  11495. int j4 = varBit.anInt650;
  11496. int k4 = anIntArray1232[j4 - i4];
  11497. k1 = variousSettings[l3] >> i4 & k4;
  11498. }
  11499. if(j1 == 15)
  11500. byte0 = 1;
  11501. if(j1 == 16)
  11502. byte0 = 2;
  11503. if(j1 == 17)
  11504. byte0 = 3;
  11505. if(j1 == 18)
  11506. k1 = (myPlayer.x >> 7) + baseX;
  11507. if(j1 == 19)
  11508. k1 = (myPlayer.y >> 7) + baseY;
  11509. if(j1 == 20)
  11510. k1 = ai[l++];
  11511. if(byte0 == 0)
  11512. {
  11513. if(i1 == 0)
  11514. k += k1;
  11515. if(i1 == 1)
  11516. k -= k1;
  11517. if(i1 == 2 && k1 != 0)
  11518. k /= k1;
  11519. if(i1 == 3)
  11520. k *= k1;
  11521. i1 = 0;
  11522. } else
  11523. {
  11524. i1 = byte0;
  11525. }
  11526. } while(true);
  11527. }
  11528. catch(Exception _ex)
  11529. {
  11530. return -1;
  11531. }
  11532. }
  11533.  
  11534. private void drawTooltip() {
  11535. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  11536. return;
  11537. String s;
  11538. if(itemSelected == 1 && menuActionRow < 2)
  11539. s = "Use " + selectedItemName + " with...";
  11540. else if(spellSelected == 1 && menuActionRow < 2)
  11541. s = spellTooltip + "...";
  11542. else
  11543. s = menuActionName[menuActionRow - 1];
  11544. if(menuActionRow > 2)
  11545. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  11546. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  11547. }
  11548.  
  11549. private void drawMinimap() {
  11550. int compassX, compassY, MapY, MapX;
  11551. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  11552. compassX = 11;
  11553. compassY = 8;
  11554. MapY = 9;
  11555. MapX = 38;
  11556. } else if(is474) {
  11557. compassX = 30;
  11558. compassY = 4;
  11559. MapY = 9;
  11560. MapX = 50;
  11561. } else {
  11562. compassX = 30+5;
  11563. compassY = 4;
  11564. MapY = 9;
  11565. MapX = 50+6;
  11566. }
  11567. mapBackImage.initDrawingArea();
  11568. if (anInt1021 == 2) {
  11569. Black[getSpriteID()].drawSprite(0, 0);
  11570. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  11571. loadOrbs();
  11572. }
  11573. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, compassY, compassX-1, 33, 25);
  11574. if(menuOpen){
  11575. drawMenu(516, 0);
  11576. }
  11577. inGameScreen.initDrawingArea();
  11578. return;
  11579. }
  11580. int i = minimapInt1 + minimapInt2 & 0x7ff;
  11581. int j = 48 + myPlayer.x / 32;
  11582. int l2 = 464 - myPlayer.y / 32;
  11583.  
  11584. for(int j1 = 0; j1 < anIntArray1229.length; j1++){
  11585. anIntArray1229[j1] = 172;
  11586. anIntArray1052[j1] = -22;
  11587. }
  11588. aSprite_1263.method352(152, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, MapY, MapX, 146, j);
  11589. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, compassY, compassX-1, 33, 25);
  11590.  
  11591. for(int j5 = 0; j5 < anInt1071; j5++) {
  11592. try {
  11593. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  11594. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  11595. markMinimap(aSpriteArray1140[j5], k, i3, false);
  11596. } catch(Exception exception) {
  11597. }
  11598. }
  11599.  
  11600. for(int k5 = 0; k5 < 104; k5++) {
  11601. for(int l5 = 0; l5 < 104; l5++) {
  11602. NodeList class19 = groundArray[plane][k5][l5];
  11603. if(class19 != null) {
  11604. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  11605. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  11606. markMinimap(mapDotItem, l, j3, false);
  11607. }
  11608. }
  11609. }
  11610.  
  11611. for(int i6 = 0; i6 < npcCount; i6++) {
  11612. NPC npc = npcArray[npcIndices[i6]];
  11613. if(npc != null && npc.isVisible()) {
  11614. EntityDef entityDef = npc.desc;
  11615. if(entityDef.childrenIDs != null)
  11616. entityDef = entityDef.method161();
  11617. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  11618. int i1 = npc.x / 32 - myPlayer.x / 32;
  11619. int k3 = npc.y / 32 - myPlayer.y / 32;
  11620. markMinimap(mapDotNPC, i1, k3, false);
  11621. }
  11622. }
  11623. }
  11624. for(int j6 = 0; j6 < playerCount; j6++) {
  11625. Player player = playerArray[playerIndices[j6]];
  11626. if(player != null && player.isVisible()) {
  11627. int j1 = player.x / 32 - myPlayer.x / 32;
  11628. int l3 = player.y / 32 - myPlayer.y / 32;
  11629. boolean flag1 = false;
  11630. boolean flag3 = false;
  11631. for (int j3 = 0; j3 < clanList.length; j3++) {
  11632. if (clanList[j3] == null)
  11633. continue;
  11634. if (!clanList[j3].equalsIgnoreCase(player.name))
  11635. continue;
  11636. flag3 = true;
  11637. break;
  11638. }
  11639. long l6 = TextClass.longForName(player.name);
  11640. for(int k6 = 0; k6 < friendsCount; k6++) {
  11641. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  11642. continue;
  11643. flag1 = true;
  11644. break;
  11645. }
  11646. boolean flag2 = false;
  11647. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  11648. flag2 = true;
  11649. if(flag1)
  11650. markMinimap(mapDotFriend, j1, l3, false);
  11651. else if(flag3)
  11652. markMinimap(mapDotClan, j1, l3, false);
  11653. else if(flag2)
  11654. markMinimap(mapDotTeam, j1, l3, false);
  11655. else
  11656. markMinimap(mapDotPlayer, j1, l3, false);
  11657. }
  11658. }
  11659. if(anInt855 != 0 && loopCycle % 20 < 10) {
  11660. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  11661. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  11662. if(class30_sub2_sub4_sub1_sub1_1 != null) {
  11663. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  11664. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  11665. method81(mapMarker, i4, k1);
  11666. }
  11667. }
  11668. if(anInt855 == 2) {
  11669. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  11670. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  11671. method81(mapMarker, j4, l1);
  11672. }
  11673. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  11674. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  11675. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  11676. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  11677. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  11678. method81(mapMarker, k4, i2);
  11679. }
  11680. }
  11681. }
  11682. if(destX != 0) {
  11683. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  11684. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  11685. markMinimap(mapFlag, j2, l4, false);
  11686. }
  11687. CustomMapback[getSpriteID()].drawSprite(0, 0);
  11688. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  11689. loadOrbs();
  11690. DrawingArea.drawPixels(3, 84, 108, 0xffffff, 3);
  11691. } else {
  11692. DrawingArea.drawPixels(3, 84, 124, 0xffffff, 3);
  11693. }
  11694. if(menuOpen)
  11695. drawMenu(516, 0);
  11696. inGameScreen.initDrawingArea();
  11697. }
  11698.  
  11699. private void npcScreenPos(Entity entity, int i)
  11700. {
  11701. calcEntityScreenPos(entity.x, i, entity.y);
  11702. }
  11703.  
  11704. private void calcEntityScreenPos(int i, int j, int l) {
  11705. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  11706. spriteDrawX = -1;
  11707. spriteDrawY = -1;
  11708. return;
  11709. }
  11710. int i1 = method42(plane, l, i) - j;
  11711. i -= xCameraPos;
  11712. i1 -= zCameraPos;
  11713. l -= yCameraPos;
  11714. int j1 = Model.modelIntArray1[yCameraCurve];
  11715. int k1 = Model.modelIntArray2[yCameraCurve];
  11716. int l1 = Model.modelIntArray1[xCameraCurve];
  11717. int i2 = Model.modelIntArray2[xCameraCurve];
  11718. int j2 = l * l1 + i * i2 >> 16;
  11719. l = l * i2 - i * l1 >> 16;
  11720. i = j2;
  11721. j2 = i1 * k1 - l * j1 >> 16;
  11722. l = i1 * j1 + l * k1 >> 16;
  11723. i1 = j2;
  11724. if(l >= 50) {
  11725. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  11726. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  11727. } else {
  11728. spriteDrawX = -1;
  11729. spriteDrawY = -1;
  11730. }
  11731. }
  11732.  
  11733. private void buildSplitPrivateChatMenu()
  11734. {
  11735. if(splitPrivateChat == 0)
  11736. return;
  11737. int i = 0;
  11738. if(anInt1104 != 0)
  11739. i = 1;
  11740. for(int j = 0; j < 100; j++)
  11741. if(chatMessages[j] != null)
  11742. {
  11743. int k = chatTypes[j];
  11744. String s = chatNames[j];
  11745. boolean flag1 = false;
  11746. if(s != null && s.startsWith("@cr0@")) {
  11747. s = s.substring(5);
  11748. byte byte0 = 1;
  11749. }
  11750. if(s != null && s.startsWith("@cr1@")) {
  11751. s = s.substring(5);
  11752. boolean flag2 = true;
  11753. byte byte0 = 2;
  11754. }
  11755. if(s != null && s.startsWith("@cr2@")) {
  11756. s = s.substring(5);
  11757. byte byte0 = 3;
  11758. }
  11759. if(s != null && s.startsWith("@cr3@")) {
  11760. s = s.substring(5);
  11761. byte byte0 = 4;
  11762. }
  11763. if(s != null && s.startsWith("@cr4@")) {
  11764. s = s.substring(5);
  11765. byte byte0 = 5;
  11766. }
  11767. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  11768. {
  11769. int l = 329 - i * 13;
  11770. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  11771. {
  11772. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  11773. if(i1 > 450)
  11774. i1 = 450;
  11775. if(super.mouseX < 4 + i1)
  11776. {
  11777. if(myPrivilege >= 1)
  11778. {
  11779. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  11780. menuActionID[menuActionRow] = 2606;
  11781. menuActionRow++;
  11782. }
  11783. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  11784. menuActionID[menuActionRow] = 2042;
  11785. menuActionRow++;
  11786. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  11787. menuActionID[menuActionRow] = 2337;
  11788. menuActionRow++;
  11789. }
  11790. }
  11791. if(++i >= 5)
  11792. return;
  11793. }
  11794. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  11795. return;
  11796. }
  11797.  
  11798. }
  11799.  
  11800. private void method130(int j, int k, int l, int i1, int j1, int k1,
  11801. int l1, int i2, int j2)
  11802. {
  11803. Class30_Sub1 class30_sub1 = null;
  11804. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  11805. {
  11806. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  11807. continue;
  11808. class30_sub1 = class30_sub1_1;
  11809. break;
  11810. }
  11811.  
  11812. if(class30_sub1 == null)
  11813. {
  11814. class30_sub1 = new Class30_Sub1();
  11815. class30_sub1.anInt1295 = l1;
  11816. class30_sub1.anInt1296 = i1;
  11817. class30_sub1.anInt1297 = i2;
  11818. class30_sub1.anInt1298 = j1;
  11819. method89(class30_sub1);
  11820. aClass19_1179.insertHead(class30_sub1);
  11821. }
  11822. class30_sub1.anInt1291 = k;
  11823. class30_sub1.anInt1293 = k1;
  11824. class30_sub1.anInt1292 = l;
  11825. class30_sub1.anInt1302 = j2;
  11826. class30_sub1.anInt1294 = j;
  11827. }
  11828.  
  11829. private boolean interfaceIsSelected(RSInterface class9)
  11830. {
  11831. if(class9.valueCompareType == null)
  11832. return false;
  11833. for(int i = 0; i < class9.valueCompareType.length; i++)
  11834. {
  11835. int j = extractInterfaceValues(class9, i);
  11836. int k = class9.requiredValues[i];
  11837. if(class9.valueCompareType[i] == 2)
  11838. {
  11839. if(j >= k)
  11840. return false;
  11841. } else
  11842. if(class9.valueCompareType[i] == 3)
  11843. {
  11844. if(j <= k)
  11845. return false;
  11846. } else
  11847. if(class9.valueCompareType[i] == 4)
  11848. {
  11849. if(j == k)
  11850. return false;
  11851. } else
  11852. if(j != k)
  11853. return false;
  11854. }
  11855.  
  11856. return true;
  11857. }
  11858.  
  11859. private DataInputStream openJagGrabInputStream(String s)
  11860. throws IOException
  11861. {
  11862. // if(!aBoolean872)
  11863. // if(signlink.mainapp != null)
  11864. // return signlink.openurl(s);
  11865. // else
  11866. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  11867. if(aSocket832 != null)
  11868. {
  11869. try
  11870. {
  11871. aSocket832.close();
  11872. System.out.println("Here5");
  11873. }
  11874. catch(Exception _ex) { }
  11875. aSocket832 = null;
  11876. }
  11877. aSocket832 = openSocket(43594);//43595
  11878. aSocket832.setSoTimeout(10000);
  11879. java.io.InputStream inputstream = aSocket832.getInputStream();
  11880. OutputStream outputstream = aSocket832.getOutputStream();
  11881. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  11882. return new DataInputStream(inputstream);
  11883. }
  11884.  
  11885. private void doFlamesDrawing()
  11886. {
  11887. char c = '\u0100';
  11888. if(anInt1040 > 0)
  11889. {
  11890. for(int i = 0; i < 256; i++)
  11891. if(anInt1040 > 768)
  11892. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  11893. else
  11894. if(anInt1040 > 256)
  11895. anIntArray850[i] = anIntArray852[i];
  11896. else
  11897. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  11898.  
  11899. } else
  11900. if(anInt1041 > 0)
  11901. {
  11902. for(int j = 0; j < 256; j++)
  11903. if(anInt1041 > 768)
  11904. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  11905. else
  11906. if(anInt1041 > 256)
  11907. anIntArray850[j] = anIntArray853[j];
  11908. else
  11909. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  11910.  
  11911. } else
  11912. {
  11913. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  11914.  
  11915. }
  11916. System.arraycopy(aSprite_1201.myPixels, 0, leftSideFlame.anIntArray315, 0, 33920);
  11917.  
  11918. int i1 = 0;
  11919. int j1 = 1152;
  11920. for(int k1 = 1; k1 < c - 1; k1++)
  11921. {
  11922. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  11923. int j2 = 22 + l1;
  11924. if(j2 < 0)
  11925. j2 = 0;
  11926. i1 += j2;
  11927. for(int l2 = j2; l2 < 128; l2++)
  11928. {
  11929. int j3 = anIntArray828[i1++];
  11930. if(j3 != 0)
  11931. {
  11932. int l3 = j3;
  11933. int j4 = 256 - j3;
  11934. j3 = anIntArray850[j3];
  11935. int l4 = leftSideFlame.anIntArray315[j1];
  11936. leftSideFlame.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  11937. } else
  11938. {
  11939. j1++;
  11940. }
  11941. }
  11942.  
  11943. j1 += j2;
  11944. }
  11945.  
  11946. leftSideFlame.drawGraphics(0, super.graphics, 0);
  11947. System.arraycopy(aSprite_1202.myPixels, 0, rightSideFlame.anIntArray315, 0, 33920);
  11948.  
  11949. i1 = 0;
  11950. j1 = 1176;
  11951. for(int k2 = 1; k2 < c - 1; k2++)
  11952. {
  11953. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  11954. int k3 = 103 - i3;
  11955. j1 += i3;
  11956. for(int i4 = 0; i4 < k3; i4++)
  11957. {
  11958. int k4 = anIntArray828[i1++];
  11959. if(k4 != 0)
  11960. {
  11961. int i5 = k4;
  11962. int j5 = 256 - k4;
  11963. k4 = anIntArray850[k4];
  11964. int k5 = rightSideFlame.anIntArray315[j1];
  11965. rightSideFlame.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  11966. } else
  11967. {
  11968. j1++;
  11969. }
  11970. }
  11971.  
  11972. i1 += 128 - k3;
  11973. j1 += 128 - k3 - i3;
  11974. }
  11975.  
  11976. rightSideFlame.drawGraphics(0, super.graphics, 637);
  11977. }
  11978.  
  11979. /*private void method134(Stream stream)
  11980. {
  11981. int j = stream.readBits(8);
  11982. if(j < playerCount)
  11983. {
  11984. for(int k = j; k < playerCount; k++)
  11985. anIntArray840[anInt839++] = playerIndices[k];
  11986.  
  11987. }
  11988. if(j > playerCount)
  11989. {
  11990. signlink.reporterror(myUsername + " Too many players");
  11991. throw new RuntimeException("eek");
  11992. }
  11993. playerCount = 0;
  11994. for(int l = 0; l < j; l++)
  11995. {
  11996. int i1 = playerIndices[l];
  11997. Player player = playerArray[i1];
  11998. int j1 = stream.readBits(1);
  11999. if(j1 == 0)
  12000. {
  12001. playerIndices[playerCount++] = i1;
  12002. player.anInt1537 = loopCycle;
  12003. } else
  12004. {
  12005. int k1 = stream.readBits(2);
  12006. if(k1 == 0)
  12007. {
  12008. playerIndices[playerCount++] = i1;
  12009. player.anInt1537 = loopCycle;
  12010. anIntArray894[anInt893++] = i1;
  12011. } else
  12012. if(k1 == 1)
  12013. {
  12014. playerIndices[playerCount++] = i1;
  12015. player.anInt1537 = loopCycle;
  12016. int l1 = stream.readBits(3);
  12017. player.moveInDir(false, l1);
  12018. int j2 = stream.readBits(1);
  12019. if(j2 == 1)
  12020. anIntArray894[anInt893++] = i1;
  12021. } else
  12022. if(k1 == 2)
  12023. {
  12024. playerIndices[playerCount++] = i1;
  12025. player.anInt1537 = loopCycle;
  12026. int i2 = stream.readBits(3);
  12027. player.moveInDir(true, i2);
  12028. int k2 = stream.readBits(3);
  12029. player.moveInDir(true, k2);
  12030. int l2 = stream.readBits(1);
  12031. if(l2 == 1)
  12032. anIntArray894[anInt893++] = i1;
  12033. } else
  12034. if(k1 == 3)
  12035. anIntArray840[anInt839++] = i1;
  12036. }
  12037. }
  12038. }*/
  12039.  
  12040. private void method134(Stream stream)
  12041. {
  12042. int j = stream.readBits(8);
  12043. if(j < playerCount)
  12044. {
  12045. for(int k = j; k < playerCount; k++)
  12046. anIntArray840[anInt839++] = playerIndices[k];
  12047.  
  12048. }
  12049. if(j > playerCount)
  12050. {
  12051. //signlink.reporterror(myUsername + " Too many players");
  12052. //throw new RuntimeException("eek");
  12053. }
  12054. playerCount = 0;
  12055. for(int l = 0; l < j; l++)
  12056. {
  12057. try{
  12058. int i1 = playerIndices[l];
  12059. Player player = playerArray[i1];
  12060. int j1 = stream.readBits(1);
  12061. if(j1 == 0)
  12062. {
  12063. playerIndices[playerCount++] = i1;
  12064. player.anInt1537 = loopCycle;
  12065. } else
  12066. {
  12067. int k1 = stream.readBits(2);
  12068. if(k1 == 0)
  12069. {
  12070. playerIndices[playerCount++] = i1;
  12071. player.anInt1537 = loopCycle;
  12072. anIntArray894[anInt893++] = i1;
  12073. } else
  12074. if(k1 == 1)
  12075. {
  12076. playerIndices[playerCount++] = i1;
  12077. player.anInt1537 = loopCycle;
  12078. int l1 = stream.readBits(3);
  12079. player.moveInDir(false, l1);
  12080. int j2 = stream.readBits(1);
  12081. if(j2 == 1)
  12082. anIntArray894[anInt893++] = i1;
  12083. } else
  12084. if(k1 == 2)
  12085. {
  12086. playerIndices[playerCount++] = i1;
  12087. player.anInt1537 = loopCycle;
  12088. int i2 = stream.readBits(3);
  12089. player.moveInDir(true, i2);
  12090. int k2 = stream.readBits(3);
  12091. player.moveInDir(true, k2);
  12092. int l2 = stream.readBits(1);
  12093. if(l2 == 1)
  12094. anIntArray894[anInt893++] = i1;
  12095. } else
  12096. if(k1 == 3)
  12097. anIntArray840[anInt839++] = i1;
  12098. }
  12099. } catch(Exception e) {}
  12100. }
  12101. }
  12102.  
  12103. private void drawLoginScreen(boolean flag) {
  12104. if (normalLogin == true) {
  12105. if(super.mouseX >= 600 && super.mouseX <= 645 + 16 && super.mouseY >= 400 && super.mouseY <= 412 + 16){
  12106. drawbutton("./.ss_474/Sprites/Interfaces/Bank/Change1",600,400);
  12107. }else{
  12108. drawbutton("./.ss_474/Sprites/Interfaces/Bank/Change2",600,400);
  12109. }
  12110. resetImageProducers();
  12111. loginScreenArea.initDrawingArea();
  12112. titleBox.drawBackground(0, 0);
  12113. char c = '\u0168';
  12114. char c1 = '\310';
  12115. if(loginScreenState == 0) {
  12116. int i = c1 / 2 + 80;
  12117. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  12118. i = c1 / 2 - 20;
  12119. chatTextDrawingArea.method382(0xffff00, c / 2, "@gre@Welcome to ProjectNero", i, true);
  12120. i += 30;
  12121. int l = c / 2 - 80;
  12122. int k1 = c1 / 2 + 20;
  12123. titleButton.drawBackground(l - 73, k1 - 20);
  12124. chatTextDrawingArea.method382(0xffffff, l, "New User", k1 + 5, true);
  12125. l = c / 2 + 80;
  12126. titleButton.drawBackground(l - 73, k1 - 20);
  12127. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5, true);
  12128. }
  12129. if(loginScreenState == 2) {
  12130. int j = c1 / 2 - 40;
  12131. if(loginMessage1.length() > 0) {
  12132. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  12133. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  12134. j += 30;
  12135. } else {
  12136. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  12137. j += 30;
  12138. }
  12139. chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + capitalize(myUsername) + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  12140. j += 15;
  12141. chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  12142. j += 15;
  12143. if(!flag) {
  12144. int i1 = c / 2 - 80;
  12145. int l1 = c1 / 2 + 50;
  12146. titleButton.drawBackground(i1 - 73, l1 - 20);
  12147. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
  12148. i1 = c / 2 + 80;
  12149. titleButton.drawBackground(i1 - 73, l1 - 20);
  12150. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  12151. }
  12152. }
  12153. if(loginScreenState == 3) {
  12154. chatTextDrawingArea.method382(0xffff00, c / 2, "@gre@Create a free account", c1 / 2 - 60, true);
  12155. int k = c1 / 2 - 35;
  12156. chatTextDrawingArea.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  12157. k += 15;
  12158. chatTextDrawingArea.method382(0xffffff, c / 2, "go Back", k, true);
  12159. k += 15;
  12160. chatTextDrawingArea.method382(0xffffff, c / 2, "and Enter username&password", k, true);
  12161. k += 15;
  12162. chatTextDrawingArea.method382(0xffffff, c / 2, "Have fun playing ProjectNero.", k, true);
  12163. k += 15;
  12164. int j1 = c / 2;
  12165. int i2 = c1 / 2 + 50;
  12166. titleButton.drawBackground(j1 - 73, i2 - 20);
  12167. chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  12168. }
  12169. loginScreenArea.drawGraphics(171, super.graphics, 202);
  12170. if(welcomeScreenRaised) {
  12171. welcomeScreenRaised = false;
  12172. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  12173. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  12174. gameLogo.drawGraphics(265, super.graphics, 0);
  12175. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  12176. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  12177. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  12178. }
  12179. } else if(normalLogin == false) {
  12180. resetImageProducers();
  12181. loginScreenArea.initDrawingArea();
  12182. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  12183. Sprite loginArea = new Sprite(abyte0, this);
  12184. loginArea.drawSprite(0, 0);
  12185.  
  12186. if(loginScreenState == 0) {
  12187. titleBox1.drawSprite(237-204, 138+25);
  12188. addLoginScreenHover(LOGIN, 8, 287-204, 182+25, 9);
  12189. if (super.saveClickX >= 361-204 && super.saveClickX <= 361-204+34 && super.saveClickY >= 360+15 && super.saveClickY <= 360+15+15) {
  12190. }
  12191. Sprite scrollLine = new Sprite("Login/Random/LINE");
  12192. scrollLine.drawSprite(297-204, 277+25);
  12193. scrollLine.drawSprite(297-204, 356+25);
  12194. smallText.method382(0xffffff, 332-204, "Standard Detail", 351+25, false);
  12195. smallText.method382(0xffffff, 428-204, "High Detail", 351+25, false);
  12196. if (super.saveClickX >= 306-204 && super.saveClickX <= 362-204 && super.saveClickY >= 303+25 && super.saveClickY <= 336+25) {
  12197. isClicked = 0;
  12198. }
  12199. if(super.saveClickX >= 402-204 && super.saveClickX <= 458-204 && super.saveClickY >= 302+25 && super.saveClickY <= 336+25) {
  12200. isClicked = 1;
  12201. }
  12202. if(isClicked != 0){
  12203. LOGIN[26].drawSprite(401-204, 303+25);
  12204. addLoginScreenHover(LOGIN, 25, 305-204, 303+25, 20);
  12205. LOGIN[22].drawSprite(446-204, 326+25);
  12206. } else if(isClicked == 0) {
  12207. LOGIN[20].drawSprite(305-204, 303+25);
  12208. addLoginScreenHover(LOGIN, 21, 401-204, 303+25, 27);
  12209. LOGIN[22].drawSprite(350-204, 326+25);
  12210. }
  12211. loginScreenArea.drawGraphics(0, super.graphics, 0);
  12212. }
  12213. if(loginScreenState == 1) {
  12214. titleBox1.drawSprite(237-204, 138+25);
  12215. LOGIN[0].drawSprite(333-204, 182+25);
  12216. LOGIN[1].drawSprite(344-204, 253+32);
  12217. LOGIN[2].drawSprite(346-204, 308+40);
  12218. LOGIN[5].drawSprite(290-204, 267+25);
  12219. LOGIN[5].drawSprite(290-204, 329+25);
  12220. addLoginScreenHover(LOGIN, 3, 358-204, 380+25, 4);
  12221. addLoginScreenHover(LOGIN, 6, 338-204, 415+25, 7);
  12222. smallText.method382(0xffffff, 380-204, "World 1", 212+25, false);
  12223. smallText.method382(0xffe1be, 380-204, myUsername, 238+25, false);
  12224. smallText.method382(0xffe1bef, 380-204, myPassword, 237+25, false);
  12225. chatTextDrawingArea.method389(true, 311-204, 0x461e00, capitalize(myUsername) + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "|" : ""), 288+25);
  12226. chatTextDrawingArea.method389(true, 311-204, 0x461e00, TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "|" : ""), 349+25);
  12227. loginScreenArea.drawGraphics(0, super.graphics, 0);
  12228. }
  12229. }
  12230. }
  12231.  
  12232. private void drawFlames()
  12233. {
  12234. if(normalLogin == true) {
  12235. try
  12236. {
  12237. long l = System.currentTimeMillis();
  12238. int i = 0;
  12239. int j = 20;
  12240. while(aBoolean831)
  12241. {
  12242. anInt1208++;
  12243. if(normalLogin == true) {
  12244. calcFlamesPosition();
  12245. calcFlamesPosition();
  12246. }
  12247. doFlamesDrawing();
  12248. if(++i > 10)
  12249. {
  12250. long l1 = System.currentTimeMillis();
  12251. int k = (int)(l1 - l) / 10 - j;
  12252. j = 40 - k;
  12253. if(j < 5)
  12254. j = 5;
  12255. i = 0;
  12256. l = l1;
  12257. }
  12258. try
  12259. {
  12260. Thread.sleep(j);
  12261. }
  12262. catch(Exception _ex) { }
  12263. }
  12264. } catch(Exception _ex) { }
  12265. drawingFlames = false;
  12266. } else if(normalLogin == false) {
  12267.  
  12268. }
  12269. }
  12270.  
  12271. public void raiseWelcomeScreen()
  12272. {
  12273. welcomeScreenRaised = true;
  12274. }
  12275.  
  12276. private void method137(Stream stream, int j)
  12277. {
  12278. if(j == 84)
  12279. {
  12280. int k = stream.readUnsignedByte();
  12281. int j3 = anInt1268 + (k >> 4 & 7);
  12282. int i6 = anInt1269 + (k & 7);
  12283. int l8 = stream.readUnsignedWord();
  12284. int k11 = stream.readUnsignedWord();
  12285. int l13 = stream.readUnsignedWord();
  12286. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  12287. {
  12288. NodeList class19_1 = groundArray[plane][j3][i6];
  12289. if(class19_1 != null)
  12290. {
  12291. 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())
  12292. {
  12293. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  12294. continue;
  12295. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  12296. break;
  12297. }
  12298.  
  12299. spawnGroundItem(j3, i6);
  12300. }
  12301. }
  12302. return;
  12303. }
  12304. if(j == 105)
  12305. {
  12306. int l = stream.readUnsignedByte();
  12307. int k3 = anInt1268 + (l >> 4 & 7);
  12308. int j6 = anInt1269 + (l & 7);
  12309. int i9 = stream.readUnsignedWord();
  12310. int l11 = stream.readUnsignedByte();
  12311. int i14 = l11 >> 4 & 0xf;
  12312. int i16 = l11 & 7;
  12313. 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)
  12314. {
  12315. anIntArray1207[anInt1062] = i9;
  12316. anIntArray1241[anInt1062] = i16;
  12317. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  12318. anInt1062++;
  12319. }
  12320. }
  12321. if(j == 215)
  12322. {
  12323. int i1 = stream.method435();
  12324. int l3 = stream.method428();
  12325. int k6 = anInt1268 + (l3 >> 4 & 7);
  12326. int j9 = anInt1269 + (l3 & 7);
  12327. int i12 = stream.method435();
  12328. int j14 = stream.readUnsignedWord();
  12329. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  12330. {
  12331. Item class30_sub2_sub4_sub2_2 = new Item();
  12332. class30_sub2_sub4_sub2_2.ID = i1;
  12333. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  12334. if(groundArray[plane][k6][j9] == null)
  12335. groundArray[plane][k6][j9] = new NodeList();
  12336. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  12337. spawnGroundItem(k6, j9);
  12338. }
  12339. return;
  12340. }
  12341. if(j == 156)
  12342. {
  12343. int j1 = stream.method426();
  12344. int i4 = anInt1268 + (j1 >> 4 & 7);
  12345. int l6 = anInt1269 + (j1 & 7);
  12346. int k9 = stream.readUnsignedWord();
  12347. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  12348. {
  12349. NodeList class19 = groundArray[plane][i4][l6];
  12350. if(class19 != null)
  12351. {
  12352. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  12353. {
  12354. if(item.ID != (k9 & 0x7fff))
  12355. continue;
  12356. item.unlink();
  12357. break;
  12358. }
  12359.  
  12360. if(class19.reverseGetFirst() == null)
  12361. groundArray[plane][i4][l6] = null;
  12362. spawnGroundItem(i4, l6);
  12363. }
  12364. }
  12365. return;
  12366. }
  12367. if(j == 160)
  12368. {
  12369. int k1 = stream.method428();
  12370. int j4 = anInt1268 + (k1 >> 4 & 7);
  12371. int i7 = anInt1269 + (k1 & 7);
  12372. int l9 = stream.method428();
  12373. int j12 = l9 >> 2;
  12374. int k14 = l9 & 3;
  12375. int j16 = anIntArray1177[j12];
  12376. int j17 = stream.method435();
  12377. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  12378. {
  12379. int j18 = intGroundArray[plane][j4][i7];
  12380. int i19 = intGroundArray[plane][j4 + 1][i7];
  12381. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  12382. int k20 = intGroundArray[plane][j4][i7 + 1];
  12383. if(j16 == 0)
  12384. {
  12385. Object1 class10 = worldController.method296(plane, j4, i7);
  12386. if(class10 != null)
  12387. {
  12388. int k21 = class10.uid >> 14 & 0x7fff;
  12389. if(j12 == 2)
  12390. {
  12391. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  12392. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  12393. } else
  12394. {
  12395. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  12396. }
  12397. }
  12398. }
  12399. if(j16 == 1)
  12400. {
  12401. Object2 class26 = worldController.method297(j4, i7, plane);
  12402. if(class26 != null)
  12403. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  12404. }
  12405. if(j16 == 2)
  12406. {
  12407. Object5 class28 = worldController.method298(j4, i7, plane);
  12408. if(j12 == 11)
  12409. j12 = 10;
  12410. if(class28 != null)
  12411. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  12412. }
  12413. if(j16 == 3)
  12414. {
  12415. Object3 class49 = worldController.method299(i7, j4, plane);
  12416. if(class49 != null)
  12417. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  12418. }
  12419. }
  12420. return;
  12421. }
  12422. if(j == 147)
  12423. {
  12424. int l1 = stream.method428();
  12425. int k4 = anInt1268 + (l1 >> 4 & 7);
  12426. int j7 = anInt1269 + (l1 & 7);
  12427. int i10 = stream.readUnsignedWord();
  12428. byte byte0 = stream.method430();
  12429. int l14 = stream.method434();
  12430. byte byte1 = stream.method429();
  12431. int k17 = stream.readUnsignedWord();
  12432. int k18 = stream.method428();
  12433. int j19 = k18 >> 2;
  12434. int i20 = k18 & 3;
  12435. int l20 = anIntArray1177[j19];
  12436. byte byte2 = stream.readSignedByte();
  12437. int l21 = stream.readUnsignedWord();
  12438. byte byte3 = stream.method429();
  12439. Player player;
  12440. if(i10 == unknownInt10)
  12441. player = myPlayer;
  12442. else
  12443. player = playerArray[i10];
  12444. if(player != null)
  12445. {
  12446. ObjectDef class46 = ObjectDef.forID(l21);
  12447. int i22 = intGroundArray[plane][k4][j7];
  12448. int j22 = intGroundArray[plane][k4 + 1][j7];
  12449. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  12450. int l22 = intGroundArray[plane][k4][j7 + 1];
  12451. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  12452. if(model != null)
  12453. {
  12454. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  12455. player.anInt1707 = l14 + loopCycle;
  12456. player.anInt1708 = k17 + loopCycle;
  12457. player.aModel_1714 = model;
  12458. int i23 = class46.anInt744;
  12459. int j23 = class46.anInt761;
  12460. if(i20 == 1 || i20 == 3)
  12461. {
  12462. i23 = class46.anInt761;
  12463. j23 = class46.anInt744;
  12464. }
  12465. player.anInt1711 = k4 * 128 + i23 * 64;
  12466. player.anInt1713 = j7 * 128 + j23 * 64;
  12467. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  12468. if(byte2 > byte0)
  12469. {
  12470. byte byte4 = byte2;
  12471. byte2 = byte0;
  12472. byte0 = byte4;
  12473. }
  12474. if(byte3 > byte1)
  12475. {
  12476. byte byte5 = byte3;
  12477. byte3 = byte1;
  12478. byte1 = byte5;
  12479. }
  12480. player.anInt1719 = k4 + byte2;
  12481. player.anInt1721 = k4 + byte0;
  12482. player.anInt1720 = j7 + byte3;
  12483. player.anInt1722 = j7 + byte1;
  12484. }
  12485. }
  12486. }
  12487. if(j == 151)
  12488. {
  12489. int i2 = stream.method426();
  12490. int l4 = anInt1268 + (i2 >> 4 & 7);
  12491. int k7 = anInt1269 + (i2 & 7);
  12492. int j10 = stream.method434();
  12493. int k12 = stream.method428();
  12494. int i15 = k12 >> 2;
  12495. int k16 = k12 & 3;
  12496. int l17 = anIntArray1177[i15];
  12497. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  12498. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  12499. return;
  12500. }
  12501. if(j == 4)
  12502. {
  12503. int j2 = stream.readUnsignedByte();
  12504. int i5 = anInt1268 + (j2 >> 4 & 7);
  12505. int l7 = anInt1269 + (j2 & 7);
  12506. int k10 = stream.readUnsignedWord();
  12507. int l12 = stream.readUnsignedByte();
  12508. int j15 = stream.readUnsignedWord();
  12509. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  12510. {
  12511. i5 = i5 * 128 + 64;
  12512. l7 = l7 * 128 + 64;
  12513. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  12514. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  12515. }
  12516. return;
  12517. }
  12518. if(j == 44)
  12519. {
  12520. int k2 = stream.method436();
  12521. int j5 = stream.readUnsignedWord();
  12522. int i8 = stream.readUnsignedByte();
  12523. int l10 = anInt1268 + (i8 >> 4 & 7);
  12524. int i13 = anInt1269 + (i8 & 7);
  12525. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  12526. {
  12527. Item class30_sub2_sub4_sub2_1 = new Item();
  12528. class30_sub2_sub4_sub2_1.ID = k2;
  12529. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  12530. if(groundArray[plane][l10][i13] == null)
  12531. groundArray[plane][l10][i13] = new NodeList();
  12532. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  12533. spawnGroundItem(l10, i13);
  12534. }
  12535. return;
  12536. }
  12537. if(j == 101)
  12538. {
  12539. int l2 = stream.method427();
  12540. int k5 = l2 >> 2;
  12541. int j8 = l2 & 3;
  12542. int i11 = anIntArray1177[k5];
  12543. int j13 = stream.readUnsignedByte();
  12544. int k15 = anInt1268 + (j13 >> 4 & 7);
  12545. int l16 = anInt1269 + (j13 & 7);
  12546. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  12547. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  12548. return;
  12549. }
  12550. if(j == 117)
  12551. {
  12552. int i3 = stream.readUnsignedByte();
  12553. int l5 = anInt1268 + (i3 >> 4 & 7);
  12554. int k8 = anInt1269 + (i3 & 7);
  12555. int j11 = l5 + stream.readSignedByte();
  12556. int k13 = k8 + stream.readSignedByte();
  12557. int l15 = stream.readSignedWord();
  12558. int i17 = stream.readUnsignedWord();
  12559. int i18 = stream.readUnsignedByte() * 4;
  12560. int l18 = stream.readUnsignedByte() * 4;
  12561. int k19 = stream.readUnsignedWord();
  12562. int j20 = stream.readUnsignedWord();
  12563. int i21 = stream.readUnsignedByte();
  12564. int j21 = stream.readUnsignedByte();
  12565. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  12566. {
  12567. l5 = l5 * 128 + 64;
  12568. k8 = k8 * 128 + 64;
  12569. j11 = j11 * 128 + 64;
  12570. k13 = k13 * 128 + 64;
  12571. 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);
  12572. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  12573. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  12574. }
  12575. }
  12576. }
  12577.  
  12578. private static void setLowMem()
  12579. {
  12580. WorldController.lowMem = true;
  12581. Texture.lowMem = true;
  12582. lowMem = true;
  12583. ObjectManager.lowMem = true;
  12584. ObjectDef.lowMem = true;
  12585. }
  12586.  
  12587. private void method139(Stream stream)
  12588. {
  12589. stream.initBitAccess();
  12590. int k = stream.readBits(8);
  12591. if(k < npcCount)
  12592. {
  12593. for(int l = k; l < npcCount; l++)
  12594. anIntArray840[anInt839++] = npcIndices[l];
  12595.  
  12596. }
  12597. if(k > npcCount)
  12598. {
  12599. signlink.reporterror(myUsername + " Too many npcs");
  12600. throw new RuntimeException("eek");
  12601. }
  12602. npcCount = 0;
  12603. for(int i1 = 0; i1 < k; i1++)
  12604. {
  12605. int j1 = npcIndices[i1];
  12606. NPC npc = npcArray[j1];
  12607. int k1 = stream.readBits(1);
  12608. if(k1 == 0)
  12609. {
  12610. npcIndices[npcCount++] = j1;
  12611. npc.anInt1537 = loopCycle;
  12612. } else
  12613. {
  12614. int l1 = stream.readBits(2);
  12615. if(l1 == 0)
  12616. {
  12617. npcIndices[npcCount++] = j1;
  12618. npc.anInt1537 = loopCycle;
  12619. anIntArray894[anInt893++] = j1;
  12620. } else
  12621. if(l1 == 1)
  12622. {
  12623. npcIndices[npcCount++] = j1;
  12624. npc.anInt1537 = loopCycle;
  12625. int i2 = stream.readBits(3);
  12626. npc.moveInDir(false, i2);
  12627. int k2 = stream.readBits(1);
  12628. if(k2 == 1)
  12629. anIntArray894[anInt893++] = j1;
  12630. } else
  12631. if(l1 == 2)
  12632. {
  12633. npcIndices[npcCount++] = j1;
  12634. npc.anInt1537 = loopCycle;
  12635. int j2 = stream.readBits(3);
  12636. npc.moveInDir(true, j2);
  12637. int l2 = stream.readBits(3);
  12638. npc.moveInDir(true, l2);
  12639. int i3 = stream.readBits(1);
  12640. if(i3 == 1)
  12641. anIntArray894[anInt893++] = j1;
  12642. } else
  12643. if(l1 == 3)
  12644. anIntArray840[anInt839++] = j1;
  12645. }
  12646. }
  12647.  
  12648. }
  12649.  
  12650. private void processLoginScreenInput() {
  12651. if((super.clickMode3 == 1 && super.saveClickX >= 600 && super.saveClickX <= 645 + 16 && super.saveClickY >= 400 && super.saveClickY <= 412 + 16) && is562 == true){
  12652. //System.exit(0);
  12653. is474 = true;
  12654. is525 = false;
  12655. is562 = false;
  12656. drawRedStones();
  12657. drawbutton("./.ss_474/Sprites/Interfaces/Bank/Change1",600,400);
  12658. loginMessage1 = "@gre@Your current gameframe is : 474";
  12659. } else if ((super.clickMode3 == 1 && super.saveClickX >= 600 && super.saveClickX <= 645 + 16 && super.saveClickY >= 400 && super.saveClickY <= 412 + 16) && is474 == true){
  12660. is474 = false;
  12661. is562 = false;
  12662. is525 = true;
  12663. drawRedStones();
  12664. loginMessage1 = "@gre@Your current gameframe is : 525";
  12665. drawbutton("./.ss_474/Sprites/Interfaces/Bank/Change2",600,400);
  12666. } else if ((super.clickMode3 == 1 && super.saveClickX >= 600 && super.saveClickX <= 645 + 16 && super.saveClickY >= 400 && super.saveClickY <= 412 + 16) && is525 == true){
  12667. is474 = false;
  12668. is562 = true;
  12669. is525 = false;
  12670. drawRedStones();
  12671. loginMessage1 = "@gre@Your current gameframe is : 562";
  12672. drawbutton("./.ss_474/Sprites/Interfaces/Bank/Change1",600,400);
  12673. }
  12674. //if(normalLogin == true) {
  12675. if(loginScreenState == 0) {
  12676. int i = super.myWidth / 2 - 80;
  12677. int l = super.myHeight / 2 + 20;
  12678. l += 20;
  12679. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
  12680. loginScreenState = 3;
  12681. loginScreenCursorPos = 0;
  12682. }
  12683. i = super.myWidth / 2 + 80;
  12684. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
  12685. if(is474){
  12686. loginMessage1 = "@gre@Your current gameframe is : 474";
  12687. } else if(is562){
  12688. loginMessage1 = "@gre@Your current gameframe is : 562";
  12689. } else {
  12690. loginMessage1 = "@gre@Your current gameframe is : 525";
  12691. }
  12692. loginMessage2 = "@gre@Enter your username & password.";
  12693. loginScreenState = 2;
  12694. loginScreenCursorPos = 0;
  12695. }
  12696. } else {
  12697. if(loginScreenState == 2) {
  12698. int j = super.myHeight / 2 - 40;
  12699. j += 30;
  12700. j += 25;
  12701. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  12702. loginScreenCursorPos = 0;
  12703. j += 15;
  12704. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  12705. loginScreenCursorPos = 1;
  12706. j += 15;
  12707. int i1 = super.myWidth / 2 - 80;
  12708. int k1 = super.myHeight / 2 + 50;
  12709. k1 += 20;
  12710. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20) {
  12711. loginFailures = 0;
  12712. login(capitalize(myUsername), myPassword, false);
  12713. if(loggedIn)
  12714. return;
  12715. }
  12716. i1 = super.myWidth / 2 + 80;
  12717. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20) {
  12718. loginScreenState = 0;
  12719. myUsername = "";
  12720. myPassword = "";
  12721. }
  12722. do {
  12723. int l1 = readChar(-796);
  12724. if(l1 == -1)
  12725. break;
  12726. boolean flag1 = false;
  12727. for(int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  12728. if(l1 != validUserPassChars.charAt(i2))
  12729. continue;
  12730. flag1 = true;
  12731. break;
  12732. } if(loginScreenCursorPos == 0) {
  12733. if(l1 == 8 && myUsername.length() > 0)
  12734. myUsername = myUsername.substring(0, myUsername.length() - 1);
  12735. if(l1 == 9 || l1 == 10 || l1 == 13)
  12736. loginScreenCursorPos = 1;
  12737. if(flag1)
  12738. myUsername += (char)l1;
  12739. if(myUsername.length() > 12)
  12740. myUsername = capitalize(myUsername.substring(0, 12));
  12741. } else if(loginScreenCursorPos == 1) {
  12742. if(l1 == 8 && myPassword.length() > 0)
  12743. myPassword = myPassword.substring(0, myPassword.length() - 1);
  12744. if(l1 == 9 || l1 == 10 || l1 == 13)
  12745. loginScreenCursorPos = 0;
  12746. if(flag1)
  12747. myPassword += (char)l1;
  12748. if(myPassword.length() > 20)
  12749. myPassword = myPassword.substring(0, 20);
  12750. }
  12751. } while(true);
  12752. return;
  12753. }
  12754. if(loginScreenState == 3) {
  12755. int k = super.myWidth / 2;
  12756. int j1 = super.myHeight / 2 + 50;
  12757. j1 += 20;
  12758. if(super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  12759. loginScreenState = 0;
  12760. }
  12761. }
  12762. //} else if(normalLogin == false) {
  12763.  
  12764. /** Custom Login Screen areas and crap */
  12765. //}
  12766. }
  12767.  
  12768. private void markMinimap(Sprite sprite, int i, int j, boolean flag) {
  12769. int k = minimapInt1 + minimapInt2 & 0x7ff;
  12770. int l = i * i + j * j;
  12771. if(flag)
  12772. return;
  12773. if(l > 6400)
  12774. return;
  12775. int i1 = Model.modelIntArray1[k];
  12776. int j1 = Model.modelIntArray2[k];
  12777. i1 = (i1 * 256) / (minimapInt3 + 256);
  12778. j1 = (j1 * 256) / (minimapInt3 + 256);
  12779. int k1 = j * i1 + i * j1 >> 16;
  12780. int l1 = j * j1 - i * i1 >> 16;
  12781. if(is480 == true || is508 == true || is525 == true || is562 == true) {
  12782. sprite.drawSprite(((106 + k1) - sprite.maxWidth / 2) + 4 , 89 - l1 - sprite.maxHeight / 2 - 4);
  12783. } else {
  12784. sprite.drawSprite(((122 + k1) - sprite.maxWidth / 2) + 4 , 89 - l1 - sprite.maxHeight / 2 - 4);
  12785. }
  12786. CustomMapback[getSpriteID()].drawSprite(0, 0);
  12787. }
  12788.  
  12789. public int runState = 1;
  12790. public boolean logHover = false;
  12791. public Sprite[] globe = new Sprite[3];
  12792. public Sprite[] ORBS = new Sprite[16];
  12793. public Sprite[] LOGOUT = new Sprite[5];
  12794.  
  12795. public static boolean globeState[] = {
  12796. false, false
  12797. };
  12798. public void drawGlobe(){
  12799. if(is508 == true || is525 == true || is562 == true) {
  12800. if(super.clickMode3 == 1){
  12801. if(super.saveClickX >= 522 && super.saveClickX <= 558 && super.saveClickY >= 124 && super.saveClickY < 161){
  12802. if(globeState[0]){
  12803. globeState[0] = false;
  12804. } else {
  12805. globeState[0] = true;
  12806. }
  12807. }
  12808. }
  12809. if(super.mouseX >= 522 && super.mouseX <= 558 && super.mouseY >= 124 && super.mouseY < 161){
  12810. globeState[1] = true;
  12811. } else {
  12812. globeState[1] = false;
  12813. }
  12814. } else {
  12815. }
  12816. }
  12817.  
  12818. public void drawLogout(){
  12819. if(is508 || is525 || is562) {
  12820. if(!logHover){
  12821. LOGOUT[0].drawSprite(226, 1);
  12822. } else {
  12823. LOGOUT[1].drawSprite(226, 1);
  12824. }
  12825. if(super.clickMode2 == 1 && super.mouseX >= 765-24 && super.mouseX <= 765 && super.mouseY >= 1 && super.mouseY <= 25){
  12826. LOGOUT[2].drawSprite(226, 1);
  12827. }
  12828. } else if(is480) {
  12829. if(tabID == 14) {
  12830. LOGOUT[4].drawSprite(226, 1);
  12831. } if(tabID != 14) {
  12832. LOGOUT[3].drawSprite(226, 1);
  12833. }
  12834. }
  12835. }
  12836.  
  12837. public void loadOrbs() {
  12838. drawLogout();
  12839. drawHP();
  12840. drawPrayer();
  12841. if(is508 == true) {
  12842. globe[0].drawSprite(10, 123);
  12843. } else if(is525 == true || is562 == true) {
  12844. drawGlobe();
  12845. if (globeState[0] && globeState[1]) {
  12846. globe[2].drawSprite(10, 123);
  12847. } else if (globeState[1]) {
  12848. globe[2].drawSprite(10, 123);
  12849. } else if (globeState[0]) {
  12850. globe[1].drawSprite(10, 123);
  12851. } else {
  12852. globe[1].drawSprite(10, 123);
  12853. }
  12854. }
  12855. }
  12856. public Sprite[] Black = new Sprite[4];
  12857.  
  12858. public void loadExtraSprites(){
  12859. for(int i = 1; i <= 15; i++) {
  12860. ORBS[i] = new Sprite("Gameframe/Orbs/ORBS "+i+"");
  12861. }
  12862. for(int i = 0; i <= 4;i++) {
  12863. LOGOUT[i] = new Sprite("Gameframe/Orbs/X "+i+"");
  12864. }
  12865. for (int j3 = 0; j3 <= 26; j3++) {
  12866. LOGIN[j3] = new Sprite("Login/Buttons/BUTTON "+j3+"");
  12867. }
  12868. for (int i = 0; i <= 2; i++) {
  12869. globe[i] = new Sprite("Gameframe/Globe "+i+"");
  12870. }
  12871. for(int i = 0; i <= 3; i++){
  12872. chatArea[i] = new Sprite("Gameframe/Gameframes/chatArea "+i+"");
  12873. }
  12874. for(int i = 0; i <= 3; i++){
  12875. tabArea[i] = new Sprite("Gameframe/Gameframes/tabArea "+i+"");
  12876. }
  12877. for(int i = 0; i <= 3; i++){
  12878. CustomMapback[i] = new Sprite("Gameframe/Gameframes/Mapback "+i+"");
  12879. }
  12880. for(int i = 0; i <= 7; i++){
  12881. modIcons[i] = new Sprite("Player/MODICONS "+i+"");
  12882. }
  12883. for(int i = 0; i <= 7; i++){
  12884. chatImages[i] = new Sprite("Player/MODICONS "+i+"");
  12885. }
  12886. for(int i = 0; i <= 3; i++){
  12887. Black[i] = new Sprite("Gameframe/Gameframes/Black "+i+"");
  12888. }
  12889. for(int i4 = 0; i4 < 3; i4++) {
  12890. hitMark[i4] = new Sprite("Player/Hits "+i4+"");
  12891. }
  12892. qc = new Sprite("Gameframe/Quickchat");
  12893. }
  12894.  
  12895. public boolean restOrb = false;
  12896. public boolean musicOrb = false;
  12897. public boolean prayClicked = false;
  12898. public boolean prayHover = false;
  12899. public boolean runClicked = false;
  12900. public boolean runHover = false;
  12901.  
  12902. private void rightClickChatButtons() {
  12903. if(is480 == true || is508 == true || is525 == true) {
  12904. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  12905. menuActionName[1] = "View All";
  12906. menuActionID[1] = 999;
  12907. menuActionRow = 2;
  12908. } else if(super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  12909. menuActionName[1] = "View Game";
  12910. menuActionID[1] = 998;
  12911. menuActionRow = 2;
  12912. } else if(super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  12913. menuActionName[1] = "Hide public";
  12914. menuActionID[1] = 997;
  12915. menuActionName[2] = "Off public";
  12916. menuActionID[2] = 996;
  12917. menuActionName[3] = "Friends public";
  12918. menuActionID[3] = 995;
  12919. menuActionName[4] = "On public";
  12920. menuActionID[4] = 994;
  12921. menuActionName[5] = "View public";
  12922. menuActionID[5] = 993;
  12923. menuActionRow = 6;
  12924. } else if(super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  12925. menuActionName[1] = "Off private";
  12926. menuActionID[1] = 992;
  12927. menuActionName[2] = "Friends private";
  12928. menuActionID[2] = 991;
  12929. menuActionName[3] = "On private";
  12930. menuActionID[3] = 990;
  12931. menuActionName[4] = "View private";
  12932. menuActionID[4] = 989;
  12933. menuActionRow = 5;
  12934. } else if(super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  12935. menuActionName[1] = "Off clan chat";
  12936. menuActionID[1] = 1003;
  12937. menuActionName[2] = "Friends clan chat";
  12938. menuActionID[2] = 1002;
  12939. menuActionName[3] = "On clan chat";
  12940. menuActionID[3] = 1001;
  12941. menuActionName[4] = "View clan chat";
  12942. menuActionID[4] = 1000;
  12943. menuActionRow = 5;
  12944. } else if(super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  12945. menuActionName[1] = "Off trade";
  12946. menuActionID[1] = 987;
  12947. menuActionName[2] = "Friends trade";
  12948. menuActionID[2] = 986;
  12949. menuActionName[3] = "On trade";
  12950. menuActionID[3] = 985;
  12951. menuActionName[4] = "View trade";
  12952. menuActionID[4] = 984;
  12953. menuActionRow = 5;
  12954. } else if(super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  12955. menuActionName[1] = "Off assist";
  12956. menuActionID[1] = -1;
  12957. menuActionName[2] = "Friends assist";
  12958. menuActionID[2] = -1;
  12959. menuActionName[3] = "On assist";
  12960. menuActionID[3] = -1;
  12961. menuActionName[4] = "View assist";
  12962. menuActionID[4] = -1;
  12963. menuActionRow = 5;
  12964. } else if(super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  12965. menuActionName[1] = "Report Abuse";
  12966. menuActionID[1] = 606;
  12967. menuActionRow = 2;
  12968. }
  12969. } else if(is474) {
  12970. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  12971. menuActionName[1] = "View All";
  12972. menuActionID[1] = 999;
  12973. menuActionRow = 2;
  12974. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  12975. menuActionName[1] = "View Game";
  12976. menuActionID[1] = 998;
  12977. menuActionRow = 2;
  12978. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  12979. menuActionName[1] = "Hide public";
  12980. menuActionID[1] = 997;
  12981. menuActionName[2] = "Off public";
  12982. menuActionID[2] = 996;
  12983. menuActionName[3] = "Friends public";
  12984. menuActionID[3] = 995;
  12985. menuActionName[4] = "On public";
  12986. menuActionID[4] = 994;
  12987. menuActionName[5] = "View public";
  12988. menuActionID[5] = 993;
  12989. menuActionRow = 6;
  12990. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  12991. menuActionName[1] = "Off private";
  12992. menuActionID[1] = 992;
  12993. menuActionName[2] = "Friends private";
  12994. menuActionID[2] = 991;
  12995. menuActionName[3] = "On private";
  12996. menuActionID[3] = 990;
  12997. menuActionName[4] = "View private";
  12998. menuActionID[4] = 989;
  12999. menuActionRow = 5;
  13000. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  13001. menuActionName[1] = "Off clan chat";
  13002. menuActionID[1] = 1003;
  13003. menuActionName[2] = "Friends clan chat";
  13004. menuActionID[2] = 1002;
  13005. menuActionName[3] = "On clan chat";
  13006. menuActionID[3] = 1001;
  13007. menuActionName[4] = "View clan chat";
  13008. menuActionID[4] = 1000;
  13009. menuActionRow = 5;
  13010. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  13011. menuActionName[1] = "Off trade";
  13012. menuActionID[1] = 987;
  13013. menuActionName[2] = "Friends trade";
  13014. menuActionID[2] = 986;
  13015. menuActionName[3] = "On trade";
  13016. menuActionID[3] = 985;
  13017. menuActionName[4] = "View trade";
  13018. menuActionID[4] = 984;
  13019. menuActionRow = 5;
  13020. } else if(super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  13021. menuActionName[1] = "Report Abuse";
  13022. menuActionID[1] = 606;
  13023. menuActionRow = 2;
  13024. }
  13025. } else {
  13026.  
  13027. }
  13028.  
  13029. }
  13030.  
  13031. public void determineTopTabs(){
  13032. if(is474 || is480 || is508 || is525) {
  13033. if(super.mouseX >= 522 && super.mouseX <= 559 && super.mouseY >= 168 && super.mouseY < 203) {
  13034. menuActionName[1] = "Combat Options";
  13035. menuActionID[1] = 1021;
  13036. menuActionRow = 2;
  13037. } else if(super.mouseX >= 560 && super.mouseX <= 592 && super.mouseY >= 168 && super.mouseY < 203) {
  13038. menuActionName[1] = "Stats";
  13039. menuActionID[1] = 1022;
  13040. menuActionRow = 2;
  13041. } else if(super.mouseX >= 593 && super.mouseX <= 625 && super.mouseY >= 168 && super.mouseY < 203) {
  13042. menuActionName[1] = "Quest List";
  13043. menuActionID[1] = 1023;
  13044. menuActionRow = 2;
  13045. } else if(super.mouseX >= 626 && super.mouseX <= 658 && super.mouseY >= 168 && super.mouseY < 203) {
  13046. menuActionName[1] = "Inventory";
  13047. menuActionID[1] = 1024;
  13048. menuActionRow = 2;
  13049. } else if(super.mouseX >= 659 && super.mouseX <= 691 && super.mouseY >= 168 && super.mouseY < 203) {
  13050. menuActionName[1] = "Worn Equipment";
  13051. menuActionID[1] = 1030;
  13052. menuActionRow = 2;
  13053. } else if(super.mouseX >= 692 && super.mouseX <= 724 && super.mouseY >= 168 && super.mouseY < 203) {
  13054. menuActionName[1] = "Prayer";
  13055. menuActionID[1] = 1026;
  13056. menuActionRow = 2;
  13057. } else if(super.mouseX >= 725 && super.mouseX <= 762 && super.mouseY >= 168 && super.mouseY < 203) {
  13058. menuActionName[1] = "Magic";
  13059. menuActionID[1] = 1027;
  13060. menuActionRow = 2;
  13061. }
  13062. }
  13063. }
  13064.  
  13065. public void determineBottomTabs(){
  13066. if(is480 || is508 || is525 || is562) {
  13067. if(super.mouseX >= 522 && super.mouseX <= 559 && super.mouseY >= 466 && super.mouseY < 503) {
  13068. menuActionName[1] = "Follower Details";
  13069. menuActionID[1] = 1502;
  13070. menuActionRow = 2;
  13071. } else if(super.mouseX >= 626 && super.mouseX <= 658 && super.mouseY >= 466 && super.mouseY < 503) {
  13072. menuActionName[1] = "Clan Chat";
  13073. menuActionID[1] = 1008;
  13074. menuActionRow = 2;
  13075. } else if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23) {
  13076. menuActionName[1] = "Logout";
  13077. menuActionID[1] = 1011;
  13078. menuActionRow = 2;
  13079. }
  13080. } else if(is474 && !is562) {
  13081. if(super.mouseX >= 522 && super.mouseX <= 559 && super.mouseY >= 466 && super.mouseY < 503) {
  13082. menuActionName[1] = "Clan Chat";
  13083. menuActionID[1] = 1008;
  13084. menuActionRow = 2;
  13085. } else if(super.mouseX >= 626 && super.mouseX <= 658 && super.mouseY >= 466 && super.mouseY < 503) {
  13086. menuActionName[1] = "Logout";
  13087. menuActionID[1] = 1011;
  13088. menuActionRow = 2;
  13089. }
  13090. }
  13091. if(is474 || is480 || is508 || is525) {
  13092. if(super.mouseX >= 560 && super.mouseX <= 592 && super.mouseY >= 466 && super.mouseY < 503) {
  13093. menuActionName[1] = "Friend List";
  13094. menuActionID[1] = 1009;
  13095. menuActionRow = 2;
  13096. } else if(super.mouseX >= 593 && super.mouseX <= 625 && super.mouseY >= 466 && super.mouseY < 503) {
  13097. menuActionName[1] = "Ignore List";
  13098. menuActionID[1] = 1010;
  13099. menuActionRow = 2;
  13100. } else if(super.mouseX >= 659 && super.mouseX <= 691 && super.mouseY >= 466 && super.mouseY < 503) {
  13101. menuActionName[1] = "Options";
  13102. menuActionID[1] = 1012;
  13103. menuActionRow = 2;
  13104. } else if(super.mouseX >= 692 && super.mouseX <= 724 && super.mouseY >= 466 && super.mouseY < 503) {
  13105. menuActionName[1] = "Emotes";
  13106. menuActionID[1] = 1013;
  13107. menuActionRow = 2;
  13108. } else if(super.mouseX >= 725 && super.mouseX <= 762 && super.mouseY >= 466 && super.mouseY < 503) {
  13109. menuActionName[1] = "Music Player";
  13110. menuActionID[1] = 1014;
  13111. menuActionRow = 2;
  13112. }
  13113. } else if(is562){
  13114. if(super.mouseX >= 521 && super.mouseX <= 550 && super.mouseY >= 169 && super.mouseY < 205) {
  13115. tabHPos = 0;
  13116. needDrawTabArea = true;
  13117. tabAreaAltered = true;
  13118. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 168 && super.mouseY < 205) {
  13119. tabHPos = 1;
  13120. needDrawTabArea = true;
  13121. tabAreaAltered = true;
  13122. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 168 && super.mouseY < 205) {
  13123. tabHPos = 2;
  13124. needDrawTabArea = true;
  13125. tabAreaAltered = true;
  13126. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 168 && super.mouseY < 203) {
  13127. tabHPos = 3;
  13128. needDrawTabArea = true;
  13129. tabAreaAltered = true;
  13130. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 168 && super.mouseY < 205) {
  13131. tabHPos = 4;
  13132. needDrawTabArea = true;
  13133. tabAreaAltered = true;
  13134. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 168 && super.mouseY < 205) {
  13135. tabHPos = 5;
  13136. needDrawTabArea = true;
  13137. tabAreaAltered = true;
  13138. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 169 && super.mouseY < 205) {
  13139. tabHPos = 6;
  13140. needDrawTabArea = true;
  13141. tabAreaAltered = true;
  13142. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 169 && super.mouseY < 205) {
  13143. tabHPos = 7;
  13144. needDrawTabArea = true;
  13145. tabAreaAltered = true;
  13146. } else if(super.mouseX >= 522 && super.mouseX <= 551 && super.mouseY >= 466 && super.mouseY < 503) {
  13147. tabHPos = 15;
  13148. needDrawTabArea = true;
  13149. tabAreaAltered = true;
  13150. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 466 && super.mouseY < 503) {
  13151. tabHPos = 8;
  13152. needDrawTabArea = true;
  13153. tabAreaAltered = true;
  13154. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 466 && super.mouseY < 503) {
  13155. tabHPos = 9;
  13156. needDrawTabArea = true;
  13157. tabAreaAltered = true;
  13158. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 466 && super.mouseY < 503) {
  13159. tabHPos = 10;
  13160. needDrawTabArea = true;
  13161. tabAreaAltered = true;
  13162. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 466 && super.mouseY < 503) {
  13163. tabHPos = 11;
  13164. needDrawTabArea = true;
  13165. tabAreaAltered = true;
  13166. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 466 && super.mouseY < 503) {
  13167. tabHPos = 12;
  13168. needDrawTabArea = true;
  13169. tabAreaAltered = true;
  13170. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 466 && super.mouseY < 502) {
  13171. tabHPos = 13;
  13172. needDrawTabArea = true;
  13173. tabAreaAltered = true;
  13174. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 466 && super.mouseY < 502) {
  13175. tabHPos = 14;
  13176. needDrawTabArea = true;
  13177. tabAreaAltered = true;
  13178. } else {
  13179. tabHPos = -1;
  13180. needDrawTabArea = true;
  13181. tabAreaAltered = true;
  13182. }
  13183. if(super.clickMode3 == 1) {
  13184. if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1) {
  13185. needDrawTabArea = true;
  13186. tabID = 0;
  13187. tabAreaAltered = true;
  13188. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1) {
  13189. needDrawTabArea = true;
  13190. tabID = 1;
  13191. tabAreaAltered = true;
  13192. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1) {
  13193. needDrawTabArea = true;
  13194. tabID = 2;
  13195. tabAreaAltered = true;
  13196. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[14] != -1) {
  13197. needDrawTabArea = true;
  13198. tabID = 14;
  13199. tabAreaAltered = true;
  13200. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[3] != -1) {
  13201. needDrawTabArea = true;
  13202. tabID = 3;
  13203. tabAreaAltered = true;
  13204. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1) {
  13205. needDrawTabArea = true;
  13206. tabID = 4;
  13207. tabAreaAltered = true;
  13208. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1) {
  13209. needDrawTabArea = true;
  13210. tabID = 5;
  13211. tabAreaAltered = true;
  13212. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1) {
  13213. needDrawTabArea = true;
  13214. tabID = 6;
  13215. tabAreaAltered = true;
  13216. } else if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[16] != -1) {
  13217. needDrawTabArea = true;
  13218. tabID = 16;
  13219. tabAreaAltered = true;
  13220. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1) {
  13221. needDrawTabArea = true;
  13222. tabID = 8;
  13223. tabAreaAltered = true;
  13224. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1) {
  13225. needDrawTabArea = true;
  13226. tabID = 9;
  13227. tabAreaAltered = true;
  13228. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1) {
  13229. needDrawTabArea = true;
  13230. tabID = 7;
  13231. tabAreaAltered = true;
  13232. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1) {
  13233. needDrawTabArea = true;
  13234. tabID = 11;
  13235. tabAreaAltered = true;
  13236. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1) {
  13237. needDrawTabArea = true;
  13238. tabID = 12;
  13239. tabAreaAltered = true;
  13240. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1) {
  13241. needDrawTabArea = true;
  13242. tabID = 13;
  13243. tabAreaAltered = true;
  13244. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[15] != -1) {
  13245. needDrawTabArea = true;
  13246. tabID = 15;
  13247. tabAreaAltered = true;
  13248. }
  13249. }
  13250.  
  13251. }
  13252. }
  13253.  
  13254. private void processMinimapActions() {
  13255. /*if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128){
  13256. if(!runClicked){
  13257. menuActionName[2] = "Toggle Run-Mode On";
  13258. } else if(runClicked){
  13259. menuActionName[2] = "Toggle Run-Mode Off";
  13260. }
  13261. menuActionID[2] = 1050;
  13262. menuActionRow = 2;
  13263. menuActionName[1] = "Rest";
  13264. menuActionID[1] = 1501;
  13265. menuActionRow = 3;
  13266. }*/
  13267. if(is508 == true || is525 == true || is562 == true) {
  13268. if(super.mouseX >= 527 && super.mouseX <= 560 && super.mouseY >= 126 && super.mouseY <= 159) {
  13269. menuActionName[1] = "Vote4Cash";
  13270. menuActionID[1] = 1005;
  13271. menuActionRow = 2;
  13272. }
  13273. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52 && super.mouseY < 87){
  13274. if(!prayClicked){
  13275. menuActionName[1] = "Toggle Quick-Prayers On";
  13276. } else if(prayClicked){
  13277. menuActionName[1] = "Toggle Quick-Prayers Off";
  13278. }
  13279. menuActionID[1] = 1500;
  13280. menuActionRow = 2;
  13281. }
  13282. } else if(is525 || is562) {
  13283. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52 && super.mouseY < 87){
  13284. if(!prayClicked){
  13285. menuActionName[1] = "Toggle Quick-Prayers On";
  13286. } else if(prayClicked){
  13287. menuActionName[1] = "Toggle Quick-Prayers Off";
  13288. }
  13289. menuActionID[1] = 1500;
  13290. menuActionRow = 2;
  13291. }
  13292. }
  13293. }
  13294.  
  13295. public int getOrbTextColor(int statusInt){
  13296. if(statusInt >= 75 && statusInt <= 100){
  13297. return 0x00FF00;
  13298. } else if(statusInt >= 50 && statusInt <= 74){
  13299. return 0xFFFF00;
  13300. } else if(statusInt >= 25 && statusInt <= 49){
  13301. return 0xFF981F;
  13302. } else {
  13303. return 0xFF0000;
  13304. }
  13305. }
  13306.  
  13307. public int getOrbFill(int statusInt){
  13308. if(statusInt <= 100 && statusInt >= 97) {
  13309. return 0;
  13310. } else if(statusInt <= 96 && statusInt >= 93) {
  13311. return 1;
  13312. } else if(statusInt <= 92 && statusInt >= 89) {
  13313. return 2;
  13314. } else if(statusInt <= 88 && statusInt >= 85) {
  13315. return 3;
  13316. } else if(statusInt <= 84 && statusInt >= 81) {
  13317. return 4;
  13318. } else if(statusInt <= 80 && statusInt >= 77) {
  13319. return 5;
  13320. } else if(statusInt <= 76 && statusInt >= 73) {
  13321. return 6;
  13322. } else if(statusInt <= 72 && statusInt >= 69) {
  13323. return 7;
  13324. } else if(statusInt <= 68 && statusInt >= 65) {
  13325. return 8;
  13326. } else if(statusInt <= 64 && statusInt >= 61) {
  13327. return 9;
  13328. } else if(statusInt <= 60 && statusInt >= 57) {
  13329. return 10;
  13330. } else if(statusInt <= 56 && statusInt >= 53) {
  13331. return 11;
  13332. } else if(statusInt <= 52 && statusInt >= 49) {
  13333. return 12;
  13334. } else if(statusInt <= 48 && statusInt >= 45) {
  13335. return 13;
  13336. } else if(statusInt <= 44 && statusInt >= 41) {
  13337. return 14;
  13338. } else if(statusInt <= 40 && statusInt >= 37) {
  13339. return 15;
  13340. } else if(statusInt <= 36 && statusInt >= 33) {
  13341. return 16;
  13342. } else if(statusInt <= 32 && statusInt >= 29) {
  13343. return 17;
  13344. } else if(statusInt <= 28 && statusInt >= 25) {
  13345. return 18;
  13346. } else if(statusInt <= 24 && statusInt >= 21) {
  13347. return 19;
  13348. } else if(statusInt <= 20 && statusInt >= 17) {
  13349. return 20;
  13350. } else if(statusInt <= 16 && statusInt >= 13) {
  13351. return 21;
  13352. } else if(statusInt <= 12 && statusInt >= 9) {
  13353. return 22;
  13354. } else if(statusInt <= 8 && statusInt >= 7) {
  13355. return 23;
  13356. } else if(statusInt <= 6 && statusInt >= 5) {
  13357. return 24;
  13358. } else if(statusInt <= 4 && statusInt >= 3) {
  13359. return 25;
  13360. } else if(statusInt <= 2 && statusInt >= 1) {
  13361. return 26;
  13362. } else if(statusInt <= 0) {
  13363. return 27;
  13364. }
  13365. return 0;
  13366. }
  13367.  
  13368. public void drawHP() {
  13369. int health;
  13370. String OrbDirectory = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  13371. String cHP = RSInterface.interfaceCache[4016].disabledMessage; cHP = cHP.replaceAll("%","");
  13372. int currentHP = Integer.parseInt(cHP);
  13373. String mHP = RSInterface.interfaceCache[4017].disabledMessage; mHP = mHP.replaceAll("%","");
  13374. int maxHP2 = Integer.parseInt(mHP);
  13375. health = (int)(((double)currentHP / (double)maxHP2) * 100D);
  13376. ORBS[0] = new Sprite(OrbDirectory+"ORBS 0.PNG", 27, getOrbFill(health));
  13377. if(is480){
  13378. ORBS[14].drawSprite(174, 14);
  13379. } else {
  13380. ORBS[1].drawSprite(174, 14);
  13381. }
  13382. ORBS[2].drawSprite(177, 17);
  13383. ORBS[0].drawSprite(177, 17);
  13384. if(health <= 20){
  13385. if(loopCycle % 20 < 10){
  13386. ORBS[3].drawSprite(183, 25);
  13387. }
  13388. } else {
  13389. ORBS[3].drawSprite(183, 25);
  13390. }
  13391. int Y = 40;
  13392. if(is480){
  13393. Y = 43;
  13394. }
  13395. smallText.method382(getOrbTextColor(health), 218, RSInterface.interfaceCache[4016].disabledMessage, Y, true);
  13396. }
  13397.  
  13398. public void drawPrayer() {
  13399. int prayer;
  13400. String OD = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  13401. String cPR = RSInterface.interfaceCache[4012].disabledMessage;
  13402. int currentPR = Integer.parseInt(cPR);
  13403. String mPR = RSInterface.interfaceCache[4013].disabledMessage;
  13404. int maxPR2 = Integer.parseInt(mPR);
  13405. prayer = (int)(((double)currentPR / (double)maxPR2) * 100D);
  13406. ORBS[0] = new Sprite(OD+"ORBS 0.PNG", 27, getOrbFill(prayer));
  13407. if(!prayClicked){
  13408. if(!is480){
  13409. if(prayHover){
  13410. ORBS[7].drawSprite(190, 53);
  13411. }else if(!prayHover){
  13412. ORBS[1].drawSprite(190, 53);
  13413. }
  13414. } else {
  13415. if(prayHover){
  13416. ORBS[15].drawSprite(190, 53);
  13417. } else {
  13418. ORBS[14].drawSprite(190, 53);
  13419. }
  13420. }
  13421. ORBS[4].drawSprite(193, 56);
  13422. } else if(prayClicked){
  13423. if(!is480){
  13424. if(prayHover){
  13425. ORBS[7].drawSprite(190, 53);
  13426. } else if(!prayHover){
  13427. ORBS[1].drawSprite(190, 53);
  13428. }
  13429. } else {
  13430. if(prayHover){
  13431. ORBS[15].drawSprite(190, 53);
  13432. } else {
  13433. ORBS[14].drawSprite(190, 53);
  13434. }
  13435. }
  13436. ORBS[5].drawSprite(193, 56);
  13437. }
  13438. ORBS[0].drawSprite(194, 56);
  13439. if(prayer <= 25) {
  13440. if(loopCycle % 20 < 10) {
  13441. ORBS[6].drawSprite(197, 60);
  13442. }
  13443. } else {
  13444. ORBS[6].drawSprite(197, 60);
  13445. }
  13446. int Y = 79;
  13447. if(is480){
  13448. Y = 82;
  13449. }
  13450. smallText.method382(getOrbTextColor(prayer), 234, RSInterface.interfaceCache[4012].disabledMessage, Y, true);
  13451. }
  13452.  
  13453. public void drawRunOrb(){
  13454. String OD = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  13455. ORBS[0] = new Sprite(OD+"ORBS 0.PNG", 27, getOrbFill(energy));
  13456. if(!runClicked){
  13457. if(!is480){
  13458. if(runHover){
  13459. ORBS[7].drawSprite(190, 92);
  13460. } else{
  13461. ORBS[0].drawSprite(190, 92);
  13462. }
  13463. } else {
  13464. if(runHover){
  13465. ORBS[15].drawSprite(190, 92);
  13466. } else{
  13467. ORBS[14].drawSprite(190, 92);
  13468. }
  13469. }
  13470. ORBS[10].drawSprite(193, 95);
  13471. if(energy != 100){
  13472. ORBS[0].drawSprite(193, 95);
  13473. }
  13474. ORBS[8].drawSprite(199, 100);
  13475. } else {
  13476. if(!is480){
  13477. if(runHover){
  13478. ORBS[7].drawSprite(190, 92);
  13479. } else {
  13480. ORBS[0].drawSprite(190, 92);
  13481. }
  13482. } else {
  13483. if(runHover){
  13484. ORBS[15].drawSprite(190, 92);
  13485. } else{
  13486. ORBS[14].drawSprite(190, 92);
  13487. }
  13488. }
  13489. ORBS[11].drawSprite(193, 95);
  13490. if(energy != 100){
  13491. ORBS[0].drawSprite(193, 95);
  13492. }
  13493. ORBS[9].drawSprite(199, 100);
  13494. }
  13495. int Y = 117;
  13496. if(is480){
  13497. Y = 120;
  13498. }
  13499. smallText.method382(getOrbTextColor(energy), 234, ""+energy, Y, true);
  13500. }
  13501.  
  13502. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  13503. )
  13504. {
  13505. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  13506. {
  13507. if(lowMem && j != plane)
  13508. return;
  13509. int i2 = 0;
  13510. if(j1 == 0)
  13511. i2 = worldController.method300(j, i1, i);
  13512. if(j1 == 1)
  13513. i2 = worldController.method301(j, i1, i);
  13514. if(j1 == 2)
  13515. i2 = worldController.method302(j, i1, i);
  13516. if(j1 == 3)
  13517. i2 = worldController.method303(j, i1, i);
  13518. if(i2 != 0)
  13519. {
  13520. int i3 = worldController.method304(j, i1, i, i2);
  13521. int j2 = i2 >> 14 & 0x7fff;
  13522. int k2 = i3 & 0x1f;
  13523. int l2 = i3 >> 6;
  13524. if(j1 == 0)
  13525. {
  13526. worldController.method291(i1, j, i, (byte)-119);
  13527. ObjectDef class46 = ObjectDef.forID(j2);
  13528. if(class46.aBoolean767)
  13529. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  13530. }
  13531. if(j1 == 1)
  13532. worldController.method292(i, j, i1);
  13533. if(j1 == 2)
  13534. {
  13535. worldController.method293(j, i1, i);
  13536. ObjectDef class46_1 = ObjectDef.forID(j2);
  13537. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  13538. return;
  13539. if(class46_1.aBoolean767)
  13540. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  13541. }
  13542. if(j1 == 3)
  13543. {
  13544. worldController.method294(j, i, i1);
  13545. ObjectDef class46_2 = ObjectDef.forID(j2);
  13546. if(class46_2.aBoolean767 && class46_2.hasActions)
  13547. aClass11Array1230[j].method218(i, i1);
  13548. }
  13549. }
  13550. if(k1 >= 0)
  13551. {
  13552. int j3 = j;
  13553. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  13554. j3++;
  13555. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  13556. }
  13557. }
  13558. }
  13559.  
  13560. /*private void updatePlayers(int i, Stream stream)
  13561. {
  13562. anInt839 = 0;
  13563. anInt893 = 0;
  13564. method117(stream);
  13565. method134(stream);
  13566. method91(stream, i);
  13567. method49(stream);
  13568. for(int k = 0; k < anInt839; k++)
  13569. {
  13570. int l = anIntArray840[k];
  13571. if(playerArray[l].anInt1537 != loopCycle)
  13572. playerArray[l] = null;
  13573. }
  13574.  
  13575. if(stream.currentOffset != i)
  13576. {
  13577. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  13578. throw new RuntimeException("eek");
  13579. }
  13580. for(int i1 = 0; i1 < playerCount; i1++)
  13581. if(playerArray[playerIndices[i1]] == null)
  13582. {
  13583. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  13584. throw new RuntimeException("eek");
  13585. }
  13586.  
  13587. }*/
  13588.  
  13589. private void updatePlayers(int i, Stream stream)
  13590. {
  13591. anInt839 = 0;
  13592. anInt893 = 0;
  13593. method117(stream);
  13594. method134(stream);
  13595. method91(stream, i);
  13596. method49(stream);
  13597. for(int k = 0; k < anInt839; k++)
  13598. {
  13599. int l = anIntArray840[k];
  13600. if(playerArray[l].anInt1537 != loopCycle)
  13601. playerArray[l] = null;
  13602. }
  13603.  
  13604. if(stream.currentOffset != i)
  13605. {
  13606. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  13607. throw new RuntimeException("eek");
  13608. }
  13609. for(int i1 = 0; i1 < playerCount; i1++)
  13610. if(playerArray[playerIndices[i1]] == null)
  13611. {
  13612. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  13613. throw new RuntimeException("eek");
  13614. }
  13615.  
  13616. }
  13617.  
  13618. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  13619. {
  13620. int l1 = 2048 - k & 0x7ff;
  13621. int i2 = 2048 - j1 & 0x7ff;
  13622. int j2 = 0;
  13623. int k2 = 0;
  13624. int l2 = j;
  13625. if(l1 != 0)
  13626. {
  13627. int i3 = Model.modelIntArray1[l1];
  13628. int k3 = Model.modelIntArray2[l1];
  13629. int i4 = k2 * k3 - l2 * i3 >> 16;
  13630. l2 = k2 * i3 + l2 * k3 >> 16;
  13631. k2 = i4;
  13632. }
  13633. if(i2 != 0)
  13634. {
  13635. /* xxx if(cameratoggle){
  13636. if(zoom == 0)
  13637. zoom = k2;
  13638. if(lftrit == 0)
  13639. lftrit = j2;
  13640. if(fwdbwd == 0)
  13641. fwdbwd = l2;
  13642. k2 = zoom;
  13643. j2 = lftrit;
  13644. l2 = fwdbwd;
  13645. }
  13646. */
  13647. int j3 = Model.modelIntArray1[i2];
  13648. int l3 = Model.modelIntArray2[i2];
  13649. int j4 = l2 * j3 + j2 * l3 >> 16;
  13650. l2 = l2 * l3 - j2 * j3 >> 16;
  13651. j2 = j4;
  13652. }
  13653. xCameraPos = l - j2;
  13654. zCameraPos = i1 - k2;
  13655. yCameraPos = k1 - l2;
  13656. yCameraCurve = k;
  13657. xCameraCurve = j1;
  13658. }
  13659.  
  13660. public void updateStrings(String str, int i) {
  13661. switch(i) {
  13662. case 1675: sendFrame126(str, 17508); break;//Stab
  13663. case 1676: sendFrame126(str, 17509); break;//Slash
  13664. case 1677: sendFrame126(str, 17510); break;//Cursh
  13665. case 1678: sendFrame126(str, 17511); break;//Magic
  13666. case 1679: sendFrame126(str, 17512); break;//Range
  13667. case 1680: sendFrame126(str, 17513); break;//Stab
  13668. case 1681: sendFrame126(str, 17514); break;//Slash
  13669. case 1682: sendFrame126(str, 17515); break;//Crush
  13670. case 1683: sendFrame126(str, 17516); break;//Magic
  13671. case 1684: sendFrame126(str, 17517); break;//Range
  13672. case 1686: sendFrame126(str, 17518); break;//Strength
  13673. case 1687: sendFrame126(str, 17519); break;//Prayer
  13674. }
  13675. }
  13676.  
  13677. public void sendFrame126(String str,int i) {
  13678. RSInterface.interfaceCache[i].disabledMessage = str;
  13679. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  13680. needDrawTabArea = true;
  13681. }
  13682.  
  13683. public void sendPacket185(int button,int toggle,int interfaceType) {
  13684. switch(interfaceType) {
  13685. case 135:
  13686. RSInterface class9 = RSInterface.interfaceCache[button];
  13687. boolean flag8 = true;
  13688. if(class9.contentType > 0)
  13689. flag8 = promptUserForInput(class9);
  13690. if(flag8) {
  13691. stream.createFrame(185);
  13692. stream.writeWord(button);
  13693. }
  13694. break;
  13695. case 646:
  13696. stream.createFrame(185);
  13697. stream.writeWord(button);
  13698. RSInterface class9_2 = RSInterface.interfaceCache[button];
  13699. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  13700. if(variousSettings[toggle] != class9_2.requiredValues[0]) {
  13701. variousSettings[toggle] = class9_2.requiredValues[0];
  13702. method33(toggle);
  13703. needDrawTabArea = true;
  13704. }
  13705. }
  13706. break;
  13707. case 169:
  13708. stream.createFrame(185);
  13709. stream.writeWord(button);
  13710. RSInterface class9_3 = RSInterface.interfaceCache[button];
  13711. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  13712. variousSettings[toggle] = 1 - variousSettings[toggle];
  13713. method33(toggle);
  13714. needDrawTabArea = true;
  13715. }
  13716. switch(button) {
  13717. case 19136:
  13718. System.out.println("toggle = "+toggle);
  13719. if(toggle == 0)
  13720. sendFrame36(173,toggle);
  13721. if(toggle == 1)
  13722. sendPacket185(153,173,646);
  13723. break;
  13724. }
  13725. break;
  13726. }
  13727. }
  13728.  
  13729. public void sendFrame36(int id,int state) {
  13730. anIntArray1045[id] = state;
  13731. if(variousSettings[id] != state) {
  13732. variousSettings[id] = state;
  13733. method33(id);
  13734. needDrawTabArea = true;
  13735. if(dialogID != -1)
  13736. inputTaken = true;
  13737. }
  13738. }
  13739.  
  13740. public void sendFrame219() {
  13741.  
  13742.  
  13743. if(invOverlayInterfaceID != -1) {
  13744. invOverlayInterfaceID = -1;
  13745. needDrawTabArea = true;
  13746. tabAreaAltered = true;
  13747. }
  13748. if(backDialogID != -1) {
  13749. backDialogID = -1;
  13750. inputTaken = true;
  13751. }
  13752. if(inputDialogState != 0) {
  13753. inputDialogState = 0;
  13754. inputTaken = true;
  13755. }
  13756. openInterfaceID = -1;
  13757. aBoolean1149 = false;
  13758. }
  13759.  
  13760. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  13761. if(backDialogID != -1) {
  13762. backDialogID = -1;
  13763. inputTaken = true;
  13764. }
  13765. if(inputDialogState != 0) {
  13766. inputDialogState = 0;
  13767. inputTaken = true;
  13768. }
  13769. openInterfaceID = interfaceID;
  13770. invOverlayInterfaceID = sideInterfaceID;
  13771. needDrawTabArea = true;
  13772. tabAreaAltered = true;
  13773. aBoolean1149 = false;
  13774. }
  13775.  
  13776. private boolean parsePacket() {
  13777.  
  13778.  
  13779. if(socketStream == null)
  13780. return false;
  13781. try {
  13782. int i = socketStream.available();
  13783. if(i == 0)
  13784. return false;
  13785. if(pktType == -1) {
  13786. socketStream.flushInputStream(inStream.buffer, 1);
  13787. pktType = inStream.buffer[0] & 0xff;
  13788. if(encryption != null)
  13789. pktType = pktType - encryption.getNextKey() & 0xff;
  13790. pktSize = SizeConstants.packetSizes[pktType];
  13791. i--;
  13792. }
  13793. if(pktSize == -1)
  13794. if(i > 0) {
  13795. socketStream.flushInputStream(inStream.buffer, 1);
  13796. pktSize = inStream.buffer[0] & 0xff;
  13797. i--;
  13798. } else {
  13799. return false;
  13800. }
  13801. if(pktSize == -2)
  13802. if(i > 1) {
  13803. socketStream.flushInputStream(inStream.buffer, 2);
  13804. inStream.currentOffset = 0;
  13805. pktSize = inStream.readUnsignedWord();
  13806. i -= 2;
  13807. } else {
  13808. return false;
  13809. }
  13810. if(i < pktSize)
  13811. return false;
  13812. inStream.currentOffset = 0;
  13813. socketStream.flushInputStream(inStream.buffer, pktSize);
  13814. anInt1009 = 0;
  13815. anInt843 = anInt842;
  13816. anInt842 = anInt841;
  13817. anInt841 = pktType;
  13818. switch(pktType) {
  13819. case 81:
  13820. /*updatePlayers(pktSize, inStream);
  13821. aBoolean1080 = false;
  13822. pktType = -1;
  13823. return true;*/
  13824. try {
  13825. updatePlayers(pktSize, inStream);
  13826. aBoolean1080 = false;
  13827. } catch(Exception e) {}
  13828. pktType = -1;
  13829. return true;
  13830.  
  13831. case 176:
  13832. daysSinceRecovChange = inStream.method427();
  13833. unreadMessages = inStream.method435();
  13834. membersInt = inStream.readUnsignedByte();
  13835. anInt1193 = inStream.method440();
  13836. daysSinceLastLogin = inStream.readUnsignedWord();
  13837. if(anInt1193 != 0 && openInterfaceID == -1) {
  13838. signlink.dnslookup(TextClass.method586(anInt1193));
  13839. clearTopInterfaces();
  13840. char c = '\u028A';
  13841. if(daysSinceRecovChange != 201 || membersInt == 1)
  13842. c = '\u028F';
  13843. reportAbuseInput = "";
  13844. canMute = false;
  13845. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  13846. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  13847. continue;
  13848. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  13849.  
  13850. }
  13851. }
  13852. pktType = -1;
  13853. return true;
  13854.  
  13855. case 64:
  13856. anInt1268 = inStream.method427();
  13857. anInt1269 = inStream.method428();
  13858. for(int j = anInt1268; j < anInt1268 + 8; j++) {
  13859. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  13860. if(groundArray[plane][j][l9] != null) {
  13861. groundArray[plane][j][l9] = null;
  13862. spawnGroundItem(j, l9);
  13863. }
  13864. }
  13865. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  13866. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  13867. class30_sub1.anInt1294 = 0;
  13868. pktType = -1;
  13869. return true;
  13870. case 174:
  13871. /*Empty Following Packet*/
  13872. followPlayer = 0;
  13873. followNPC = 0;
  13874. int l11 = inStream.readUnsignedWord();
  13875. int iq = inStream.readUnsignedByte();
  13876. followDistance = inStream.readUnsignedWord();
  13877. if (iq == 0)
  13878. {
  13879. followNPC = l11;
  13880. }
  13881. else if (iq == 1)
  13882. {
  13883. followPlayer = l11;
  13884. }
  13885. pktType = -1;
  13886. return true;
  13887. case 185:
  13888. int k = inStream.method436();
  13889. RSInterface.interfaceCache[k].disabledMediaType = 3;
  13890. if(myPlayer.desc == null)
  13891. 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];
  13892. else
  13893. RSInterface.interfaceCache[k].disabledMediaID = (int)(0x12345678L + myPlayer.desc.interfaceType);
  13894. pktType = -1;
  13895. return true;
  13896.  
  13897. /* Clan chat packet */
  13898. case 217:
  13899. try {
  13900. name = inStream.readString();
  13901. disabledMessage = inStream.readString();
  13902. clanname = inStream.readString();
  13903. rights = inStream.readUnsignedWord();
  13904. //disabledMessage = TextInput.processText(disabledMessage);
  13905. //disabledMessage = Censor.doCensor(disabledMessage);
  13906. System.out.println(clanname);
  13907. pushMessage(disabledMessage, 16, name);
  13908. } catch(Exception e) {
  13909. e.printStackTrace();
  13910. }
  13911. pktType = -1;
  13912. return true;
  13913.  
  13914. case 107:
  13915. aBoolean1160 = false;
  13916. for(int l = 0; l < 5; l++)
  13917. aBooleanArray876[l] = false;
  13918. pktType = -1;
  13919. return true;
  13920.  
  13921. case 72:
  13922. int i1 = inStream.method434();
  13923. RSInterface class9 = RSInterface.interfaceCache[i1];
  13924. for(int k15 = 0; k15 < class9.inventory.length; k15++) {
  13925. class9.inventory[k15] = -1;
  13926. class9.inventory[k15] = 0;
  13927. }
  13928. pktType = -1;
  13929. return true;
  13930.  
  13931. case 214:
  13932. ignoreCount = pktSize / 8;
  13933. for(int j1 = 0; j1 < ignoreCount; j1++)
  13934. ignoreListAsLongs[j1] = inStream.readQWord();
  13935. pktType = -1;
  13936. return true;
  13937.  
  13938. case 166:
  13939. aBoolean1160 = true;
  13940. anInt1098 = inStream.readUnsignedByte();
  13941. anInt1099 = inStream.readUnsignedByte();
  13942. anInt1100 = inStream.readUnsignedWord();
  13943. anInt1101 = inStream.readUnsignedByte();
  13944. anInt1102 = inStream.readUnsignedByte();
  13945. if(anInt1102 >= 100) {
  13946. xCameraPos = anInt1098 * 128 + 64;
  13947. yCameraPos = anInt1099 * 128 + 64;
  13948. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  13949. }
  13950. pktType = -1;
  13951. return true;
  13952.  
  13953. case 134:
  13954. needDrawTabArea = true;
  13955. int k1 = inStream.readUnsignedByte();
  13956. int i10 = inStream.method439();
  13957. int l15 = inStream.readUnsignedByte();
  13958. currentExp[k1] = i10;
  13959. currentStats[k1] = l15;
  13960. maxStats[k1] = 1;
  13961. for(int k20 = 0; k20 < 98; k20++)
  13962. if(i10 >= anIntArray1019[k20])
  13963. maxStats[k1] = k20 + 2;
  13964. pktType = -1;
  13965. return true;
  13966.  
  13967. case 71:
  13968. int l1 = inStream.readUnsignedWord();
  13969. int j10 = inStream.method426();
  13970. if(l1 == 65535)
  13971. l1 = -1;
  13972. tabInterfaceIDs[j10] = l1;
  13973. needDrawTabArea = true;
  13974. tabAreaAltered = true;
  13975. pktType = -1;
  13976. return true;
  13977.  
  13978. case 74:
  13979. int i2 = inStream.method434();
  13980. if(i2 == 65535)
  13981. i2 = -1;
  13982. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  13983. nextSong = i2;
  13984. songChanging = true;
  13985. onDemandFetcher.method558(2, nextSong);
  13986. }
  13987. currentSong = i2;
  13988. pktType = -1;
  13989. return true;
  13990.  
  13991. case 121:
  13992. int j2 = inStream.method436();
  13993. int k10 = inStream.method435();
  13994. if(musicEnabled && !lowMem) {
  13995. nextSong = j2;
  13996. songChanging = false;
  13997. onDemandFetcher.method558(2, nextSong);
  13998. prevSong = k10;
  13999. }
  14000. pktType = -1;
  14001. return true;
  14002.  
  14003. case 109:
  14004. resetLogout();
  14005. pktType = -1;
  14006. return false;
  14007.  
  14008. case 70:
  14009. int k2 = inStream.readSignedWord();
  14010. int l10 = inStream.method437();
  14011. int i16 = inStream.method434();
  14012. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  14013. class9_5.xOffset = k2;
  14014. class9_5.yOffset = l10;
  14015. pktType = -1;
  14016. return true;
  14017.  
  14018. case 73:
  14019. case 241:
  14020. int l2 = anInt1069;
  14021. int i11 = anInt1070;
  14022. if(pktType == 73) {
  14023. l2 = inStream.method435();
  14024. i11 = inStream.readUnsignedWord();
  14025. aBoolean1159 = false;
  14026. }
  14027. if(pktType == 241) {
  14028. i11 = inStream.method435();
  14029. inStream.initBitAccess();
  14030. for(int j16 = 0; j16 < 4; j16++) {
  14031. for(int l20 = 0; l20 < 13; l20++) {
  14032. for(int j23 = 0; j23 < 13; j23++) {
  14033. int i26 = inStream.readBits(1);
  14034. if(i26 == 1)
  14035. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  14036. else
  14037. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  14038. }
  14039. }
  14040. }
  14041. inStream.finishBitAccess();
  14042. l2 = inStream.readUnsignedWord();
  14043. aBoolean1159 = true;
  14044. }
  14045. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  14046. pktType = -1;
  14047. return true;
  14048. }
  14049. anInt1069 = l2;
  14050. anInt1070 = i11;
  14051. baseX = (anInt1069 - 6) * 8;
  14052. baseY = (anInt1070 - 6) * 8;
  14053. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  14054. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  14055. aBoolean1141 = true;
  14056. loadingStage = 1;
  14057. aLong824 = System.currentTimeMillis();
  14058. inGameScreen.initDrawingArea();
  14059. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  14060. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  14061. inGameScreen.drawGraphics(4, super.graphics, 4);
  14062. if(pktType == 73) {
  14063. int k16 = 0;
  14064. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  14065. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  14066. k16++;
  14067. }
  14068. aByteArrayArray1183 = new byte[k16][];
  14069. aByteArrayArray1247 = new byte[k16][];
  14070. anIntArray1234 = new int[k16];
  14071. anIntArray1235 = new int[k16];
  14072. anIntArray1236 = new int[k16];
  14073. k16 = 0;
  14074. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  14075. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  14076. anIntArray1234[k16] = (l23 << 8) + j26;
  14077. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  14078. anIntArray1235[k16] = -1;
  14079. anIntArray1236[k16] = -1;
  14080. k16++;
  14081. } else {
  14082. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  14083. if(k28 != -1)
  14084. onDemandFetcher.method558(3, k28);
  14085. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  14086. if(j30 != -1)
  14087. onDemandFetcher.method558(3, j30);
  14088. k16++;
  14089. }
  14090. }
  14091. }
  14092. }
  14093. if(pktType == 241) {
  14094. int l16 = 0;
  14095. int ai[] = new int[676];
  14096. for(int i24 = 0; i24 < 4; i24++) {
  14097. for(int k26 = 0; k26 < 13; k26++) {
  14098. for(int l28 = 0; l28 < 13; l28++) {
  14099. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  14100. if(k30 != -1) {
  14101. int k31 = k30 >> 14 & 0x3ff;
  14102. int i32 = k30 >> 3 & 0x7ff;
  14103. int k32 = (k31 / 8 << 8) + i32 / 8;
  14104. for(int j33 = 0; j33 < l16; j33++) {
  14105. if(ai[j33] != k32)
  14106. continue;
  14107. k32 = -1;
  14108.  
  14109. }
  14110. if(k32 != -1)
  14111. ai[l16++] = k32;
  14112. }
  14113. }
  14114. }
  14115. }
  14116. aByteArrayArray1183 = new byte[l16][];
  14117. aByteArrayArray1247 = new byte[l16][];
  14118. anIntArray1234 = new int[l16];
  14119. anIntArray1235 = new int[l16];
  14120. anIntArray1236 = new int[l16];
  14121. for(int l26 = 0; l26 < l16; l26++) {
  14122. int i29 = anIntArray1234[l26] = ai[l26];
  14123. int l30 = i29 >> 8 & 0xff;
  14124. int l31 = i29 & 0xff;
  14125. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  14126. if(j32 != -1)
  14127. onDemandFetcher.method558(3, j32);
  14128. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  14129. if(i33 != -1)
  14130. onDemandFetcher.method558(3, i33);
  14131. }
  14132. }
  14133. int i17 = baseX - anInt1036;
  14134. int j21 = baseY - anInt1037;
  14135. anInt1036 = baseX;
  14136. anInt1037 = baseY;
  14137. for(int j24 = 0; j24 < 16384; j24++) {
  14138. NPC npc = npcArray[j24];
  14139. if(npc != null) {
  14140. for(int j29 = 0; j29 < 10; j29++) {
  14141. npc.smallX[j29] -= i17;
  14142. npc.smallY[j29] -= j21;
  14143. }
  14144. npc.x -= i17 * 128;
  14145. npc.y -= j21 * 128;
  14146. }
  14147. }
  14148. for(int i27 = 0; i27 < maxPlayers; i27++) {
  14149. Player player = playerArray[i27];
  14150. if(player != null) {
  14151. for(int i31 = 0; i31 < 10; i31++) {
  14152. player.smallX[i31] -= i17;
  14153. player.smallY[i31] -= j21;
  14154. }
  14155. player.x -= i17 * 128;
  14156. player.y -= j21 * 128;
  14157. }
  14158. }
  14159. aBoolean1080 = true;
  14160. byte byte1 = 0;
  14161. byte byte2 = 104;
  14162. byte byte3 = 1;
  14163. if(i17 < 0) {
  14164. byte1 = 103;
  14165. byte2 = -1;
  14166. byte3 = -1;
  14167. }
  14168. byte byte4 = 0;
  14169. byte byte5 = 104;
  14170. byte byte6 = 1;
  14171. if(j21 < 0) {
  14172. byte4 = 103;
  14173. byte5 = -1;
  14174. byte6 = -1;
  14175. }
  14176. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  14177. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  14178. int i34 = k33 + i17;
  14179. int j34 = l33 + j21;
  14180. for(int k34 = 0; k34 < 4; k34++)
  14181. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  14182. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  14183. else
  14184. groundArray[k34][k33][l33] = null;
  14185. }
  14186. }
  14187. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  14188. class30_sub1_1.anInt1297 -= i17;
  14189. class30_sub1_1.anInt1298 -= j21;
  14190. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  14191. class30_sub1_1.unlink();
  14192. }
  14193. if(destX != 0) {
  14194. destX -= i17;
  14195. destY -= j21;
  14196. }
  14197. aBoolean1160 = false;
  14198. pktType = -1;
  14199. return true;
  14200.  
  14201. case 208:
  14202. int i3 = inStream.method437();
  14203. if(i3 >= 0)
  14204. method60(i3);
  14205. anInt1018 = i3;
  14206. pktType = -1;
  14207. return true;
  14208.  
  14209. case 99:
  14210. /*
  14211. * Black map, mape state 2, causes blackness
  14212. */
  14213. anInt1021 = inStream.readUnsignedByte();
  14214. pktType = -1;
  14215. return true;
  14216.  
  14217. case 75:
  14218. int j3 = inStream.method436();
  14219. int j11 = inStream.method436();
  14220. RSInterface.interfaceCache[j11].disabledMediaType = 2;
  14221. RSInterface.interfaceCache[j11].disabledMediaID = j3;
  14222. pktType = -1;
  14223. return true;
  14224.  
  14225. case 114:
  14226. anInt1104 = inStream.method434() * 30;
  14227. pktType = -1;
  14228. return true;
  14229.  
  14230. case 60:
  14231. anInt1269 = inStream.readUnsignedByte();
  14232. anInt1268 = inStream.method427();
  14233. while(inStream.currentOffset < pktSize) {
  14234. int k3 = inStream.readUnsignedByte();
  14235. method137(inStream, k3);
  14236. }
  14237. pktType = -1;
  14238. return true;
  14239.  
  14240. case 35:
  14241. int l3 = inStream.readUnsignedByte();
  14242. int k11 = inStream.readUnsignedByte();
  14243. int j17 = inStream.readUnsignedByte();
  14244. int k21 = inStream.readUnsignedByte();
  14245. aBooleanArray876[l3] = true;
  14246. anIntArray873[l3] = k11;
  14247. anIntArray1203[l3] = j17;
  14248. anIntArray928[l3] = k21;
  14249. anIntArray1030[l3] = 0;
  14250. pktType = -1;
  14251. return true;
  14252.  
  14253. /*case 174:
  14254. int i4 = inStream.readUnsignedWord();
  14255. int l11 = inStream.readUnsignedByte();
  14256. int k17 = inStream.readUnsignedWord();
  14257. if(aBoolean848 && !lowMem && anInt1062 < 50) {
  14258. anIntArray1207[anInt1062] = i4;
  14259. anIntArray1241[anInt1062] = l11;
  14260. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  14261. anInt1062++;
  14262. }
  14263. pktType = -1;
  14264. return true;*/
  14265.  
  14266. case 104:
  14267. int j4 = inStream.method427();
  14268. int i12 = inStream.method426();
  14269. String s6 = inStream.readString();
  14270. if(j4 >= 1 && j4 <= 5) {
  14271. if(s6.equalsIgnoreCase("null"))
  14272. s6 = null;
  14273. atPlayerActions[j4 - 1] = s6;
  14274. atPlayerArray[j4 - 1] = i12 == 0;
  14275. }
  14276. pktType = -1;
  14277. return true;
  14278.  
  14279. case 78:
  14280. destX = 0;
  14281. pktType = -1;
  14282. return true;
  14283.  
  14284. case 253:
  14285. String s = inStream.readString();
  14286. if(s.endsWith(":tradereq:")) {
  14287. String s3 = s.substring(0, s.indexOf(":"));
  14288. long l17 = TextClass.longForName(s3);
  14289. boolean flag2 = false;
  14290. for(int j27 = 0; j27 < ignoreCount; j27++) {
  14291. if(ignoreListAsLongs[j27] != l17)
  14292. continue;
  14293. flag2 = true;
  14294. }
  14295. if(!flag2 && anInt1251 == 0)
  14296. pushMessage("wishes to trade with you.", 4, s3);
  14297. } else if (s.endsWith(":clan:")) {
  14298. String s4 = s.substring(0, s.indexOf(":"));
  14299. long l18 = TextClass.longForName(s4);
  14300. pushMessage("Clan: ", 8, s4);
  14301. } else if(s.endsWith("#url#")) {
  14302. String text = s.substring(0, s.indexOf("-"));
  14303. s = s.substring(text.length()+1).trim();
  14304. String link = s.substring(0, s.indexOf("#"));
  14305. pushMessage(text, 9, link);
  14306.  
  14307. } else if(s.endsWith(":duelreq:")) {
  14308. String s4 = s.substring(0, s.indexOf(":"));
  14309. long l18 = TextClass.longForName(s4);
  14310. boolean flag3 = false;
  14311. for(int k27 = 0; k27 < ignoreCount; k27++) {
  14312. if(ignoreListAsLongs[k27] != l18)
  14313. continue;
  14314. flag3 = true;
  14315.  
  14316. }
  14317. if(!flag3 && anInt1251 == 0)
  14318. pushMessage("wishes to duel with you.", 8, s4);
  14319. } else if(s.endsWith(":chalreq:")) {
  14320. String s5 = s.substring(0, s.indexOf(":"));
  14321. long l19 = TextClass.longForName(s5);
  14322. boolean flag4 = false;
  14323. for(int l27 = 0; l27 < ignoreCount; l27++) {
  14324. if(ignoreListAsLongs[l27] != l19)
  14325. continue;
  14326. flag4 = true;
  14327.  
  14328. }
  14329. if(!flag4 && anInt1251 == 0) {
  14330. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  14331. pushMessage(s8, 8, s5);
  14332. }
  14333. } else {
  14334. pushMessage(s, 0, "");
  14335. }
  14336. pktType = -1;
  14337. return true;
  14338.  
  14339. case 1:
  14340. for(int k4 = 0; k4 < playerArray.length; k4++)
  14341. if(playerArray[k4] != null)
  14342. playerArray[k4].anim = -1;
  14343. for(int j12 = 0; j12 < npcArray.length; j12++)
  14344. if(npcArray[j12] != null)
  14345. npcArray[j12].anim = -1;
  14346. pktType = -1;
  14347. return true;
  14348.  
  14349. case 50:
  14350. long l4 = inStream.readQWord();
  14351. int i18 = inStream.readUnsignedByte();
  14352. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  14353. for(int k24 = 0; k24 < friendsCount; k24++) {
  14354. if(l4 != friendsListAsLongs[k24])
  14355. continue;
  14356. if(friendsNodeIDs[k24] != i18) {
  14357. friendsNodeIDs[k24] = i18;
  14358. needDrawTabArea = true;
  14359. if(i18 >= 2) {
  14360. pushMessage(s7 + " has logged in.", 5, "");
  14361. }
  14362. if(i18 <= 1) {
  14363. pushMessage(s7 + " has logged out.", 5, "");
  14364. }
  14365. }
  14366. s7 = null;
  14367.  
  14368. }
  14369. if(s7 != null && friendsCount < 200) {
  14370. friendsListAsLongs[friendsCount] = l4;
  14371. friendsList[friendsCount] = s7;
  14372. friendsNodeIDs[friendsCount] = i18;
  14373. friendsCount++;
  14374. needDrawTabArea = true;
  14375. }
  14376. for(boolean flag6 = false; !flag6;) {
  14377. flag6 = true;
  14378. for(int index = 0; index < friendsCount - 1; index++)
  14379. if(friendsNodeIDs[index] != nodeID && friendsNodeIDs[index + 1] == nodeID || friendsNodeIDs[index] == 0 && friendsNodeIDs[index + 1] != 0) {
  14380. int j31 = friendsNodeIDs[index];
  14381. friendsNodeIDs[index] = friendsNodeIDs[index + 1];
  14382. friendsNodeIDs[index + 1] = j31;
  14383. String s10 = friendsList[index];
  14384. friendsList[index] = friendsList[index + 1];
  14385. friendsList[index + 1] = s10;
  14386. long l32 = friendsListAsLongs[index];
  14387. friendsListAsLongs[index] = friendsListAsLongs[index + 1];
  14388. friendsListAsLongs[index + 1] = l32;
  14389. needDrawTabArea = true;
  14390. flag6 = false;
  14391. }
  14392. }//friends list sorting
  14393. pktType = -1;
  14394. return true;
  14395.  
  14396. case 110:
  14397. if(tabID == 12)
  14398. needDrawTabArea = true;
  14399. energy = inStream.readUnsignedByte();
  14400. pktType = -1;
  14401. return true;
  14402.  
  14403. case 254:
  14404. anInt855 = inStream.readUnsignedByte();
  14405. if(anInt855 == 1)
  14406. anInt1222 = inStream.readUnsignedWord();
  14407. if(anInt855 >= 2 && anInt855 <= 6) {
  14408. if(anInt855 == 2) {
  14409. anInt937 = 64;
  14410. anInt938 = 64;
  14411. }
  14412. if(anInt855 == 3) {
  14413. anInt937 = 0;
  14414. anInt938 = 64;
  14415. }
  14416. if(anInt855 == 4) {
  14417. anInt937 = 128;
  14418. anInt938 = 64;
  14419. }
  14420. if(anInt855 == 5) {
  14421. anInt937 = 64;
  14422. anInt938 = 0;
  14423. }
  14424. if(anInt855 == 6) {
  14425. anInt937 = 64;
  14426. anInt938 = 128;
  14427. }
  14428. anInt855 = 2;
  14429. anInt934 = inStream.readUnsignedWord();
  14430. anInt935 = inStream.readUnsignedWord();
  14431. anInt936 = inStream.readUnsignedByte();
  14432. }
  14433. if(anInt855 == 10)
  14434. anInt933 = inStream.readUnsignedWord();
  14435. pktType = -1;
  14436. return true;
  14437.  
  14438. case 248:
  14439. int i5 = inStream.method435();
  14440. int k12 = inStream.readUnsignedWord();
  14441. if(backDialogID != -1)
  14442. {
  14443. backDialogID = -1;
  14444. inputTaken = true;
  14445. }
  14446. if(inputDialogState != 0)
  14447. {
  14448. inputDialogState = 0;
  14449. inputTaken = true;
  14450. }
  14451. openInterfaceID = i5;
  14452. invOverlayInterfaceID = k12;
  14453. needDrawTabArea = true;
  14454. tabAreaAltered = true;
  14455. aBoolean1149 = false;
  14456. pktType = -1;
  14457. return true;
  14458.  
  14459. case 79:
  14460. int j5 = inStream.method434();
  14461. int l12 = inStream.method435();
  14462. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  14463. if(class9_3 != null && class9_3.interfaceType == 0) {
  14464. if(l12 < 0)
  14465. l12 = 0;
  14466. if(l12 > class9_3.scrollMax - class9_3.height)
  14467. l12 = class9_3.scrollMax - class9_3.height;
  14468. class9_3.scrollPosition = l12;
  14469. }
  14470. pktType = -1;
  14471. return true;
  14472.  
  14473. case 68:
  14474. for(int k5 = 0; k5 < variousSettings.length; k5++)
  14475. if(variousSettings[k5] != anIntArray1045[k5]) {
  14476. variousSettings[k5] = anIntArray1045[k5];
  14477. method33(k5);
  14478. needDrawTabArea = true;
  14479. }
  14480. pktType = -1;
  14481. return true;
  14482.  
  14483. case 196:
  14484. long l5 = inStream.readQWord();
  14485. int j18 = inStream.readDWord();
  14486. int l21 = inStream.readUnsignedByte();
  14487. boolean flag5 = false;
  14488. for(int i28 = 0; i28 < 100; i28++) {
  14489. if(anIntArray1240[i28] != j18)
  14490. continue;
  14491. flag5 = true;
  14492.  
  14493. }
  14494. if(l21 <= 1) {
  14495. for(int l29 = 0; l29 < ignoreCount; l29++) {
  14496. if(ignoreListAsLongs[l29] != l5)
  14497. continue;
  14498. flag5 = true;
  14499.  
  14500. }
  14501. }
  14502. if(!flag5 && anInt1251 == 0)
  14503. try {
  14504. anIntArray1240[anInt1169] = j18;
  14505. anInt1169 = (anInt1169 + 1) % 100;
  14506. String s9 = TextInput.method525(pktSize - 13, inStream);
  14507. //if(l21 != 3)
  14508. //s9 = Censor.doCensor(s9);
  14509. if(l21 == 4) {
  14510. pushMessage(s9, 7, "@cr3@" + TextClass.fixName(TextClass.nameForLong(l5)));
  14511. } else if(l21 == 3) {
  14512. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  14513. } else if(l21 == 2) {
  14514. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  14515. } else if(l21 == 5) {
  14516. pushMessage(s9, 7, "@cr4@" + TextClass.fixName(TextClass.nameForLong(l5)));
  14517. } else if(l21 == 1) {
  14518. pushMessage(s9, 7, "@cr0@" + TextClass.fixName(TextClass.nameForLong(l5)));
  14519. } else {
  14520. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  14521. }
  14522. } catch(Exception exception1) {
  14523. signlink.reporterror("cde1");
  14524. }
  14525. pktType = -1;
  14526. return true;
  14527.  
  14528. case 85:
  14529. anInt1269 = inStream.method427();
  14530. anInt1268 = inStream.method427();
  14531. pktType = -1;
  14532. return true;
  14533.  
  14534. case 24:
  14535. anInt1054 = inStream.method428();
  14536. if(anInt1054 == tabID) {
  14537. if(anInt1054 == 3)
  14538. tabID = 1;
  14539. else
  14540. tabID = 3;
  14541. needDrawTabArea = true;
  14542. }
  14543. pktType = -1;
  14544. return true;
  14545.  
  14546. case 246:
  14547. int i6 = inStream.method434();
  14548. int i13 = inStream.readUnsignedWord();
  14549. int k18 = inStream.readUnsignedWord();
  14550. if(k18 == 65535) {
  14551. RSInterface.interfaceCache[i6].disabledMediaType = 0;
  14552. pktType = -1;
  14553. return true;
  14554. } else {
  14555. ItemDef itemDef = ItemDef.forID(k18);
  14556. RSInterface.interfaceCache[i6].disabledMediaType = 4;
  14557. RSInterface.interfaceCache[i6].disabledMediaID = k18;
  14558. RSInterface.interfaceCache[i6].modelRotationY = itemDef.modelRotationY;
  14559. RSInterface.interfaceCache[i6].modelRotationX = itemDef.modelRotationX;
  14560. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  14561. pktType = -1;
  14562. return true;
  14563. }
  14564.  
  14565. case 171:
  14566. boolean flag1 = inStream.readUnsignedByte() == 1;
  14567. int j13 = inStream.readUnsignedWord();
  14568. RSInterface.interfaceCache[j13].interfaceShown = flag1;
  14569. pktType = -1;
  14570. return true;
  14571.  
  14572. case 142:
  14573. int j6 = inStream.method434();
  14574. method60(j6);
  14575. if(backDialogID != -1) {
  14576. backDialogID = -1;
  14577. inputTaken = true;
  14578. }
  14579. if(inputDialogState != 0) {
  14580. inputDialogState = 0;
  14581. inputTaken = true;
  14582. }
  14583. invOverlayInterfaceID = j6;
  14584. needDrawTabArea = true;
  14585. tabAreaAltered = true;
  14586. openInterfaceID = -1;
  14587. aBoolean1149 = false;
  14588. pktType = -1;
  14589. return true;
  14590.  
  14591. case 126:
  14592. String s1 = inStream.readString();
  14593. int k13 = inStream.method435();
  14594. RSInterface.interfaceCache[k13].disabledMessage = s1;
  14595. if(RSInterface.interfaceCache[k13].parentID == tabInterfaceIDs[tabID] || k13 >= 7562 && k13 <= 7586)
  14596. needDrawTabArea = true;
  14597. pktType = -1;
  14598. return true;
  14599.  
  14600. case 206:
  14601. publicChatMode = inStream.readUnsignedByte();
  14602. privateChatMode = inStream.readUnsignedByte();
  14603. tradeMode = inStream.readUnsignedByte();
  14604. aBoolean1233 = true;
  14605. inputTaken = true;
  14606. pktType = -1;
  14607. return true;
  14608.  
  14609. case 240:
  14610. if(tabID == 12)
  14611. needDrawTabArea = true;
  14612. weight = inStream.readSignedWord();
  14613. pktType = -1;
  14614. return true;
  14615.  
  14616. case 8:
  14617. int k6 = inStream.method436();
  14618. int l13 = inStream.readUnsignedWord();
  14619. RSInterface.interfaceCache[k6].disabledMediaType = 1;
  14620. RSInterface.interfaceCache[k6].disabledMediaID = l13;
  14621. pktType = -1;
  14622. return true;
  14623.  
  14624. case 122:
  14625. int l6 = inStream.method436();
  14626. int i14 = inStream.method436();
  14627. int i19 = i14 >> 10 & 0x1f;
  14628. int i22 = i14 >> 5 & 0x1f;
  14629. int l24 = i14 & 0x1f;
  14630. RSInterface.interfaceCache[l6].disabledColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  14631. pktType = -1;
  14632. return true;
  14633.  
  14634. case 53:
  14635. needDrawTabArea = true;
  14636. int i7 = inStream.readUnsignedWord();
  14637. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  14638. int j19 = inStream.readUnsignedWord();
  14639. for(int j22 = 0; j22 < j19; j22++) {
  14640. int i25 = inStream.readUnsignedByte();
  14641. if(i25 == 255)
  14642. i25 = inStream.method440();
  14643. class9_1.inventory[j22] = inStream.method436();
  14644. class9_1.inventoryValue[j22] = i25;
  14645. }
  14646. for(int j25 = j19; j25 < class9_1.inventory.length; j25++) {
  14647. class9_1.inventory[j25] = 0;
  14648. class9_1.inventoryValue[j25] = 0;
  14649. }
  14650. pktType = -1;
  14651. return true;
  14652.  
  14653. case 230:
  14654. int j7 = inStream.method435();
  14655. int j14 = inStream.readUnsignedWord();
  14656. int k19 = inStream.readUnsignedWord();
  14657. int k22 = inStream.method436();
  14658. RSInterface.interfaceCache[j14].modelRotationY = k19;
  14659. RSInterface.interfaceCache[j14].modelRotationX = k22;
  14660. RSInterface.interfaceCache[j14].modelZoom = j7;
  14661. pktType = -1;
  14662. return true;
  14663.  
  14664. case 221:
  14665. anInt900 = inStream.readUnsignedByte();
  14666. needDrawTabArea = true;
  14667. pktType = -1;
  14668. return true;
  14669.  
  14670. case 177:
  14671. aBoolean1160 = true;
  14672. anInt995 = inStream.readUnsignedByte();
  14673. anInt996 = inStream.readUnsignedByte();
  14674. anInt997 = inStream.readUnsignedWord();
  14675. anInt998 = inStream.readUnsignedByte();
  14676. anInt999 = inStream.readUnsignedByte();
  14677. if(anInt999 >= 100) {
  14678. int k7 = anInt995 * 128 + 64;
  14679. int k14 = anInt996 * 128 + 64;
  14680. int i20 = method42(plane, k14, k7) - anInt997;
  14681. int l22 = k7 - xCameraPos;
  14682. int k25 = i20 - zCameraPos;
  14683. int j28 = k14 - yCameraPos;
  14684. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  14685. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  14686. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  14687. if(yCameraCurve < 128)
  14688. yCameraCurve = 128;
  14689. if(yCameraCurve > 383)
  14690. yCameraCurve = 383;
  14691. }
  14692. pktType = -1;
  14693. return true;
  14694.  
  14695. case 249:
  14696. anInt1046 = inStream.method426();
  14697. unknownInt10 = inStream.method436();
  14698. pktType = -1;
  14699. return true;
  14700.  
  14701. case 65:
  14702. updateNPCs(inStream, pktSize);
  14703. pktType = -1;
  14704. return true;
  14705.  
  14706. case 27:
  14707. messagePromptRaised = false;
  14708. inputDialogState = 1;
  14709. amountOrNameInput = "";
  14710. inputTaken = true;
  14711. pktType = -1;
  14712. return true;
  14713.  
  14714. case 187:
  14715. messagePromptRaised = false;
  14716. inputDialogState = 2;
  14717. amountOrNameInput = "";
  14718. inputTaken = true;
  14719. pktType = -1;
  14720. return true;
  14721. case 97:
  14722. int l7 = inStream.readUnsignedWord();
  14723. method60(l7);
  14724. if (invOverlayInterfaceID != -1) {
  14725. invOverlayInterfaceID = -1;
  14726. needDrawTabArea = true;
  14727. tabAreaAltered = true;
  14728. }
  14729. if (backDialogID != -1) {
  14730. backDialogID = -1;
  14731. inputTaken = true;
  14732. }
  14733. if (inputDialogState != 0) {
  14734. inputDialogState = 0;
  14735. inputTaken = true;
  14736. }
  14737. //17511 = Question Type
  14738. //15819 = Christmas Type
  14739. //15812 = Security Type
  14740. //15801 = Item Scam Type
  14741. //15791 = Password Safety ?
  14742. //15774 = Good/Bad Password
  14743. //15767 = Drama Type ????
  14744. if (l7 == 15244) {
  14745. openInterfaceID = 15774;
  14746. fullscreenInterfaceID = 15244;
  14747. } else {
  14748. openInterfaceID = l7;
  14749. }
  14750. aBoolean1149 = false;
  14751. pktType = -1;
  14752. return true;
  14753. case 218:
  14754. int i8 = inStream.method438();
  14755. dialogID = i8;
  14756. inputTaken = true;
  14757. pktType = -1;
  14758. return true;
  14759.  
  14760. case 87:
  14761. int j8 = inStream.method434();
  14762. int l14 = inStream.method439();
  14763. anIntArray1045[j8] = l14;
  14764. if(variousSettings[j8] != l14) {
  14765. variousSettings[j8] = l14;
  14766. method33(j8);
  14767. needDrawTabArea = true;
  14768. if(dialogID != -1)
  14769. inputTaken = true;
  14770. }
  14771. pktType = -1;
  14772. return true;
  14773.  
  14774. case 36:
  14775. int k8 = inStream.method434();
  14776. byte byte0 = inStream.readSignedByte();
  14777. anIntArray1045[k8] = byte0;
  14778. if(variousSettings[k8] != byte0) {
  14779. variousSettings[k8] = byte0;
  14780. method33(k8);
  14781. needDrawTabArea = true;
  14782. if(dialogID != -1)
  14783. inputTaken = true;
  14784. }
  14785. pktType = -1;
  14786. return true;
  14787.  
  14788. case 61:
  14789. anInt1055 = inStream.readUnsignedByte();
  14790. pktType = -1;
  14791. return true;
  14792.  
  14793. case 200:
  14794. int l8 = inStream.readUnsignedWord();
  14795. int i15 = inStream.readSignedWord();
  14796. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  14797. class9_4.disabledAnimation = i15;
  14798. if(i15 == -1) {
  14799. class9_4.animationLength = 0;
  14800. class9_4.animationDelay = 0;
  14801. }
  14802. pktType = -1;
  14803. return true;
  14804.  
  14805. case 219:
  14806. if(invOverlayInterfaceID != -1) {
  14807. invOverlayInterfaceID = -1;
  14808. needDrawTabArea = true;
  14809. tabAreaAltered = true;
  14810. }
  14811. if(backDialogID != -1) {
  14812. backDialogID = -1;
  14813. inputTaken = true;
  14814. }
  14815. if(inputDialogState != 0) {
  14816. inputDialogState = 0;
  14817. inputTaken = true;
  14818. }
  14819. openInterfaceID = -1;
  14820. aBoolean1149 = false;
  14821. pktType = -1;
  14822. return true;
  14823.  
  14824. case 34:
  14825. needDrawTabArea = true;
  14826. int i9 = inStream.readUnsignedWord();
  14827. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  14828. while(inStream.currentOffset < pktSize) {
  14829. int j20 = inStream.method422();
  14830. int i23 = inStream.readUnsignedWord();
  14831. int l25 = inStream.readUnsignedByte();
  14832. if(l25 == 255)
  14833. l25 = inStream.readDWord();
  14834. if(j20 >= 0 && j20 < class9_2.inventory.length) {
  14835. class9_2.inventory[j20] = i23;
  14836. class9_2.inventoryValue[j20] = l25;
  14837. }
  14838. }
  14839. pktType = -1;
  14840. return true;
  14841.  
  14842. case 4:
  14843. case 44:
  14844. case 84:
  14845. case 101:
  14846. case 105:
  14847. case 117:
  14848. case 147:
  14849. case 151:
  14850. case 156:
  14851. case 160:
  14852. case 215:
  14853. method137(inStream, pktType);
  14854. pktType = -1;
  14855. return true;
  14856.  
  14857. case 106:
  14858. tabID = inStream.method427();
  14859. needDrawTabArea = true;
  14860. tabAreaAltered = true;
  14861. pktType = -1;
  14862. return true;
  14863.  
  14864. case 164:
  14865. int j9 = inStream.method434();
  14866. method60(j9);
  14867. if(invOverlayInterfaceID != -1)
  14868. {
  14869. invOverlayInterfaceID = -1;
  14870. needDrawTabArea = true;
  14871. tabAreaAltered = true;
  14872. }
  14873. backDialogID = j9;
  14874. inputTaken = true;
  14875. openInterfaceID = -1;
  14876. aBoolean1149 = false;
  14877. pktType = -1;
  14878. return true;
  14879.  
  14880. }
  14881. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  14882. //resetLogout();
  14883. } catch(IOException _ex) {
  14884. dropClient();
  14885. } catch(Exception exception) {
  14886. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  14887. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  14888. s2 = s2 + inStream.buffer[j15] + ",";
  14889. signlink.reporterror(s2);
  14890. //resetLogout();
  14891. }
  14892. pktType = -1;
  14893. return true;
  14894. }
  14895. public int[] loginPackets = new int[10];
  14896. private void method146() {
  14897.  
  14898.  
  14899. anInt1265++;
  14900. method47(true);
  14901. method26(true);
  14902. method47(false);
  14903. method26(false);
  14904. method55();
  14905. method104();
  14906. if(!aBoolean1160) {
  14907. int i = anInt1184;
  14908. if(anInt984 / 256 > i)
  14909. i = anInt984 / 256;
  14910. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  14911. i = anIntArray1203[4] + 128;
  14912. int k = minimapInt1 + anInt896 & 0x7ff;
  14913. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  14914. }
  14915. int j;
  14916. if(!aBoolean1160)
  14917. j = method120();
  14918. else
  14919. j = method121();
  14920. int l = xCameraPos;
  14921. int i1 = zCameraPos;
  14922. int j1 = yCameraPos;
  14923. int k1 = yCameraCurve;
  14924. int l1 = xCameraCurve;
  14925. for(int i2 = 0; i2 < 5; i2++)
  14926. if(aBooleanArray876[i2]) {
  14927. 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]);
  14928. if(i2 == 0)
  14929. xCameraPos += j2;
  14930. if(i2 == 1)
  14931. zCameraPos += j2;
  14932. if(i2 == 2)
  14933. yCameraPos += j2;
  14934. if(i2 == 3)
  14935. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  14936. if(i2 == 4) {
  14937. yCameraCurve += j2;
  14938. if(yCameraCurve < 128)
  14939. yCameraCurve = 128;
  14940. if(yCameraCurve > 383)
  14941. yCameraCurve = 383;
  14942. }
  14943. }
  14944. int k2 = Texture.anInt1481;
  14945. Model.aBoolean1684 = true;
  14946. Model.anInt1687 = 0;
  14947. Model.anInt1685 = super.mouseX - 4;
  14948. Model.anInt1686 = super.mouseY - 4;
  14949. DrawingArea.setAllPixelsToZero();
  14950. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  14951. worldController.clearObj5Cache();
  14952. updateEntities();
  14953. drawHeadIcon();
  14954. method37(k2);
  14955. draw3dScreen();
  14956. inGameScreen.drawGraphics(4, super.graphics, 4);
  14957. xCameraPos = l;
  14958. zCameraPos = i1;
  14959. yCameraPos = j1;
  14960. yCameraCurve = k1;
  14961. xCameraCurve = l1;
  14962. }
  14963.  
  14964. /* Packets that opens interfaces */
  14965. public void sendFrame97(int interfaceID) {
  14966. method60(interfaceID);
  14967. if (invOverlayInterfaceID != -1) {
  14968. invOverlayInterfaceID = -1;
  14969. needDrawTabArea = true;
  14970. tabAreaAltered = true;
  14971. }
  14972. if (backDialogID != -1) {
  14973. backDialogID = -1;
  14974. inputTaken = true;
  14975. }
  14976. if (inputDialogState != 0) {
  14977. inputDialogState = 0;
  14978. inputTaken = true;
  14979. }
  14980. openInterfaceID = interfaceID;
  14981. aBoolean1149 = false;
  14982. }
  14983. public void clearTopInterfaces() {
  14984.  
  14985. stream.createFrame(130);
  14986. if (invOverlayInterfaceID != -1) {
  14987. invOverlayInterfaceID = -1;
  14988. needDrawTabArea = true;
  14989. aBoolean1149 = false;
  14990. tabAreaAltered = true;
  14991. }
  14992. if (backDialogID != -1) {
  14993. backDialogID = -1;
  14994. inputTaken = true;
  14995. aBoolean1149 = false;
  14996. }
  14997. openInterfaceID = -1;
  14998. fullscreenInterfaceID = -1;
  14999. }
  15000.  
  15001. public client() {
  15002. tabHPos = -1;
  15003. fullscreenInterfaceID = -1;
  15004. chatRights = new int[500];
  15005. chatTypeView = 0;
  15006. clanChatMode = 0;
  15007. cButtonHPos = -1;
  15008. cButtonHCPos = -1;
  15009. cButtonCPos = 0;
  15010. //server = "theparadiseowns.no-ip.biz";
  15011. server = "127.0.0.1";
  15012. //server = "78.58.107.69"; //server ip?
  15013. anIntArrayArray825 = new int[104][104];
  15014. friendsNodeIDs = new int[200];
  15015. groundArray = new NodeList[4][104][104];
  15016. aBoolean831 = false;
  15017. aStream_834 = new Stream(new byte[5000]);
  15018. npcArray = new NPC[16384];
  15019. npcIndices = new int[16384];
  15020. anIntArray840 = new int[1000];
  15021. aStream_847 = Stream.create();
  15022. aBoolean848 = true;
  15023. openInterfaceID = -1;
  15024. currentExp = new int[Skills.skillsCount];
  15025. aBoolean872 = false;
  15026. anIntArray873 = new int[5];
  15027. anInt874 = -1;
  15028. aBooleanArray876 = new boolean[5];
  15029. drawFlames = false;
  15030. reportAbuseInput = "";
  15031. unknownInt10 = -1;
  15032. menuOpen = false;
  15033. inputString = "";
  15034. maxPlayers = 2048;
  15035. myPlayerIndex = 2047;
  15036. playerArray = new Player[maxPlayers];
  15037. playerIndices = new int[maxPlayers];
  15038. anIntArray894 = new int[maxPlayers];
  15039. aStreamArray895s = new Stream[maxPlayers];
  15040. anInt897 = 1;
  15041. anIntArrayArray901 = new int[104][104];
  15042. anInt902 = 0x766654;
  15043. aByteArray912 = new byte[16384];
  15044. currentStats = new int[Skills.skillsCount];
  15045. ignoreListAsLongs = new long[100];
  15046. loadingError = false;
  15047. anInt927 = 0x332d25;
  15048. anIntArray928 = new int[5];
  15049. anIntArrayArray929 = new int[104][104];
  15050. chatTypes = new int[500];
  15051. chatNames = new String[500];
  15052. chatMessages = new String[500];
  15053. chatButtons = new Sprite[4];
  15054. sideIcons = new Sprite[14];
  15055. newSideIcons = new Sprite[15];
  15056. sIcons483 = new Sprite[14];
  15057. sIcons459 = new Sprite[13];
  15058.  
  15059. redStones = new Sprite[16];
  15060. aBoolean954 = true;
  15061. friendsListAsLongs = new long[200];
  15062. currentSong = -1;
  15063. drawingFlames = false;
  15064. spriteDrawX = -1;
  15065. spriteDrawY = -1;
  15066. anIntArray968 = new int[33];
  15067. anIntArray969 = new int[256];
  15068. decompressors = new Decompressor[5];
  15069. variousSettings = new int[2000];
  15070. aBoolean972 = false;
  15071. anInt975 = 50;
  15072. anIntArray976 = new int[anInt975];
  15073. anIntArray977 = new int[anInt975];
  15074. anIntArray978 = new int[anInt975];
  15075. anIntArray979 = new int[anInt975];
  15076. anIntArray980 = new int[anInt975];
  15077. anIntArray981 = new int[anInt975];
  15078. anIntArray982 = new int[anInt975];
  15079. aStringArray983 = new String[anInt975];
  15080. anInt985 = -1;
  15081. hitMarks = new Sprite[20];
  15082. hitMark = new Sprite[4];
  15083. anIntArray990 = new int[5];
  15084. aBoolean994 = false;
  15085. anInt1002 = 0x23201b;
  15086. amountOrNameInput = "";
  15087. aClass19_1013 = new NodeList();
  15088. aBoolean1017 = false;
  15089. anInt1018 = -1;
  15090. anIntArray1030 = new int[5];
  15091. aBoolean1031 = false;
  15092. mapFunctions = new Sprite[100];
  15093. dialogID = -1;
  15094. maxStats = new int[Skills.skillsCount];
  15095. anIntArray1045 = new int[2000];
  15096. aBoolean1047 = true;
  15097. anIntArray1052 = new int[152];//map
  15098. anInt1054 = -1;
  15099. aClass19_1056 = new NodeList();
  15100. anIntArray1057 = new int[33];
  15101. aClass9_1059 = new RSInterface();
  15102. mapScenes = new Background[100];
  15103. barFillColor = 0x4d4233;
  15104. anIntArray1065 = new int[7];
  15105. anIntArray1072 = new int[1000];
  15106. anIntArray1073 = new int[1000];
  15107. aBoolean1080 = false;
  15108. friendsList = new String[200];
  15109. inStream = Stream.create();
  15110. expectedCRCs = new int[9];
  15111. menuActionCmd2 = new int[500];
  15112. menuActionCmd3 = new int[500];
  15113. menuActionID = new int[500];
  15114. menuActionCmd1 = new int[500];
  15115. headIcons = new Sprite[20];
  15116. skullIcons = new Sprite[20];
  15117. headIconsHint = new Sprite[20];
  15118. tabAreaAltered = false;
  15119. aString1121 = "";
  15120. atPlayerActions = new String[5];
  15121. atPlayerArray = new boolean[5];
  15122. anIntArrayArrayArray1129 = new int[4][13][13];
  15123. anInt1132 = 2;
  15124. aSpriteArray1140 = new Sprite[1000];
  15125. aBoolean1141 = false;
  15126. aBoolean1149 = false;
  15127. crosses = new Sprite[8];
  15128. musicEnabled = true;
  15129. needDrawTabArea = false;
  15130. loggedIn = false;
  15131. canMute = false;
  15132. aBoolean1159 = false;
  15133. aBoolean1160 = false;
  15134. anInt1171 = 1;
  15135. myUsername = "";
  15136. myPassword = "";
  15137. genericLoadingError = false;
  15138. reportAbuseInterfaceID = -1;
  15139. aClass19_1179 = new NodeList();
  15140. anInt1184 = 128;
  15141. invOverlayInterfaceID = -1;
  15142. stream = Stream.create();
  15143. menuActionName = new String[500];
  15144. anIntArray1203 = new int[5];
  15145. anIntArray1207 = new int[50];
  15146. anInt1210 = 2;
  15147. anInt1211 = 78;
  15148. promptInput = "";
  15149. //modIcons = new Background[2];
  15150. modIcons = new Sprite[8];
  15151. chatImages = new Sprite[8];
  15152. tabID = 3;
  15153. inputTaken = false;
  15154. songChanging = true;
  15155. anIntArray1229 = new int[152];//map
  15156. aClass11Array1230 = new Class11[4];
  15157. aBoolean1233 = false;
  15158. anIntArray1240 = new int[100];
  15159. anIntArray1241 = new int[50];
  15160. aBoolean1242 = false;
  15161. anIntArray1250 = new int[50];
  15162. rsAlreadyLoaded = false;
  15163. welcomeScreenRaised = true;
  15164. messagePromptRaised = false;
  15165. loginMessage1 = "";
  15166. loginMessage2 = "";
  15167. backDialogID = -1;
  15168. anInt1279 = 2;
  15169. bigX = new int[4000];
  15170. bigY = new int[4000];
  15171. anInt1289 = -1;
  15172. }
  15173.  
  15174. public int rights;
  15175. public String name;
  15176. public String disabledMessage;
  15177. public String clanname;
  15178. private final int[] chatRights;
  15179. public int chatTypeView;
  15180. public int clanChatMode;
  15181. public int duelMode;
  15182. /* Declare custom sprites */
  15183. //private Sprite chatArea;
  15184. private Sprite[] chatButtons;
  15185. //private Sprite tabArea;
  15186. private Sprite mapArea;
  15187. private Sprite tabHover;
  15188. private Sprite tabClicked;
  15189. private Sprite[] newSideIcons;
  15190. public boolean is562 = false;
  15191. //private Sprite CustomMapback;
  15192. public Sprite[] CustomMapback = new Sprite[4];
  15193. public Sprite[] chatArea = new Sprite[4];
  15194. public Sprite[] tabArea = new Sprite[4];
  15195. //public Sprite[] mapArea = new Sprite[3];
  15196. /**/
  15197. private RSImageProducer leftFrame;
  15198. private RSImageProducer topFrame;
  15199. private RSImageProducer rightFrame;
  15200. private int ignoreCount;
  15201. private long aLong824;
  15202. private int[][] anIntArrayArray825;
  15203. private int[] friendsNodeIDs;
  15204. private NodeList[][][] groundArray;
  15205. private int[] anIntArray828;
  15206. private int[] anIntArray829;
  15207. private volatile boolean aBoolean831;
  15208. private Socket aSocket832;
  15209. private int loginScreenState;
  15210. private Stream aStream_834;
  15211. private NPC[] npcArray;
  15212. private int npcCount;
  15213. private int[] npcIndices;
  15214. private int anInt839;
  15215. private int[] anIntArray840;
  15216. private int anInt841;
  15217. private int anInt842;
  15218. private int anInt843;
  15219. private String aString844;
  15220. private int privateChatMode;
  15221. private Stream aStream_847;
  15222. private boolean aBoolean848;
  15223. private static int anInt849;
  15224. private int[] anIntArray850;
  15225. private int[] anIntArray851;
  15226. private int[] anIntArray852;
  15227. private int[] anIntArray853;
  15228. private static int anInt854;
  15229. private int anInt855;
  15230. private int openInterfaceID;
  15231. private int xCameraPos;
  15232. private int zCameraPos;
  15233. private int yCameraPos;
  15234. private int yCameraCurve;
  15235. private int xCameraCurve;
  15236. public int myPrivilege;
  15237. private final int[] currentExp;
  15238. private Sprite[] redStones;
  15239. private Sprite mapFlag;
  15240. private Sprite mapMarker;
  15241. private boolean aBoolean872;
  15242. private final int[] anIntArray873;
  15243. private int anInt874;
  15244. private final boolean[] aBooleanArray876;
  15245. private int weight;
  15246. private MouseDetection mouseDetection;
  15247. private volatile boolean drawFlames;
  15248. private String reportAbuseInput;
  15249. private int unknownInt10;
  15250. private boolean menuOpen;
  15251. private int anInt886;
  15252. private String inputString;
  15253. private final int maxPlayers;
  15254. private final int myPlayerIndex;
  15255. private Player[] playerArray;
  15256. private int playerCount;
  15257. private int[] playerIndices;
  15258. private int anInt893;
  15259. private int[] anIntArray894;
  15260. private Stream[] aStreamArray895s;
  15261. private int anInt896;
  15262. private int anInt897;
  15263. private int friendsCount;
  15264. private int anInt900;
  15265. private int[][] anIntArrayArray901;
  15266. private final int anInt902;
  15267. private byte[] aByteArray912;
  15268. private int anInt913;
  15269. private int crossX;
  15270. private int crossY;
  15271. private int crossIndex;
  15272. private int crossType;
  15273. private int plane;
  15274. private final int[] currentStats;
  15275. private static int anInt924;
  15276. private final long[] ignoreListAsLongs;
  15277. private boolean loadingError;
  15278. private final int anInt927;
  15279. private final int[] anIntArray928;
  15280. private int[][] anIntArrayArray929;
  15281. private Sprite aSprite_931;
  15282. private Sprite aSprite_932;
  15283. private int anInt933;
  15284. private int anInt934;
  15285. private int anInt935;
  15286. private int anInt936;
  15287. private int anInt937;
  15288. private int anInt938;
  15289. private static int anInt940;
  15290. private final int[] chatTypes;
  15291. private final String[] chatNames;
  15292. private final String[] chatMessages;
  15293. private int anInt945;
  15294. private WorldController worldController;
  15295. private Sprite[] sideIcons;
  15296. private Sprite[] sIcons483;
  15297. private Sprite[] sIcons459;
  15298. private int menuScreenArea;
  15299. private int menuOffsetX;
  15300. private int menuOffsetY;
  15301. private int menuWidth;
  15302. private int menuHeight;
  15303. private long aLong953;
  15304. private boolean aBoolean954;
  15305. private long[] friendsListAsLongs;
  15306. private String[] clanList = new String[100];
  15307. private int currentSong;
  15308. private static int nodeID = 10;
  15309. static int portOff;
  15310. static boolean clientData;
  15311. private static boolean isMembers = true;
  15312. private static boolean lowMem;
  15313. private volatile boolean drawingFlames;
  15314. private int spriteDrawX;
  15315. private int spriteDrawY;
  15316. private final int[] anIntArray965 = {
  15317. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  15318. };
  15319. private Background titleBox;
  15320. public Sprite titleBox1;
  15321. private Background titleButton;
  15322. private final int[] anIntArray968;
  15323. private final int[] anIntArray969;
  15324. final Decompressor[] decompressors;
  15325. public int variousSettings[];
  15326. private boolean aBoolean972;
  15327. private final int anInt975;
  15328. private final int[] anIntArray976;
  15329. private final int[] anIntArray977;
  15330. private final int[] anIntArray978;
  15331. private final int[] anIntArray979;
  15332. private final int[] anIntArray980;
  15333. private final int[] anIntArray981;
  15334. private final int[] anIntArray982;
  15335. private final String[] aStringArray983;
  15336. private int anInt984;
  15337. private int anInt985;
  15338. private static int anInt986;
  15339. private Sprite[] hitMarks;
  15340. private Sprite[] hitMark;
  15341. private int anInt988;
  15342. private int anInt989;
  15343. private final int[] anIntArray990;
  15344. private static boolean aBoolean993;
  15345. private final boolean aBoolean994;
  15346. private int anInt995;
  15347. private int anInt996;
  15348. private int anInt997;
  15349. private int anInt998;
  15350. private int anInt999;
  15351. private ISAACRandomGen encryption;
  15352. private Sprite mapEdge;
  15353. private Sprite multiOverlay;
  15354. private final int anInt1002;
  15355. static final int[][] anIntArrayArray1003 = {
  15356. {
  15357. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  15358. 2983, 54193
  15359. }, {
  15360. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  15361. 56621, 4783, 1341, 16578, 35003, 25239
  15362. }, {
  15363. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  15364. 10153, 56621, 4783, 1341, 16578, 35003
  15365. }, {
  15366. 4626, 11146, 6439, 12, 4758, 10270
  15367. }, {
  15368. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  15369. }
  15370. };
  15371. private String amountOrNameInput;
  15372. private static int anInt1005;
  15373. private int daysSinceLastLogin;
  15374. private int pktSize;
  15375. private int pktType;
  15376. private int anInt1009;
  15377. private int anInt1010;
  15378. private int anInt1011;
  15379. private NodeList aClass19_1013;
  15380. private int anInt1014;
  15381. private int anInt1015;
  15382. private int anInt1016;
  15383. private boolean aBoolean1017;
  15384. private int anInt1018;
  15385. private static final int[] anIntArray1019;
  15386. private int anInt1021;
  15387. private int anInt1022;
  15388. private int loadingStage;
  15389. private Sprite scrollBar1;
  15390. private Sprite scrollBar2;
  15391. private Sprite scrollBar3;
  15392. private Sprite scrollBar4;
  15393. private int anInt1026;
  15394. private Background backBase1;
  15395. private Background backBase2;
  15396. private Background backHmid1;
  15397. private final int[] anIntArray1030;
  15398. private boolean aBoolean1031;
  15399. private Sprite[] mapFunctions;
  15400. private int baseX;
  15401. private int baseY;
  15402. private int anInt1036;
  15403. private int anInt1037;
  15404. private int loginFailures;
  15405. private int anInt1039;
  15406. private int anInt1040;
  15407. private int anInt1041;
  15408. private int dialogID;
  15409. private final int[] maxStats;
  15410. private final int[] anIntArray1045;
  15411. private int anInt1046;
  15412. private boolean aBoolean1047;
  15413. private int anInt1048;
  15414. private String aString1049;
  15415. private static int anInt1051;
  15416. private final int[] anIntArray1052;
  15417. private NamedArchive titleStreamLoader;
  15418. private int anInt1054;
  15419. private int anInt1055;
  15420. private NodeList aClass19_1056;
  15421. private final int[] anIntArray1057;
  15422. public final RSInterface aClass9_1059;
  15423. private Background[] mapScenes;
  15424. private static int anInt1061;
  15425. private int anInt1062;
  15426. private final int barFillColor;
  15427. private int friendsListAction;
  15428. private final int[] anIntArray1065;
  15429. private int mouseInvInterfaceIndex;
  15430. private int lastActiveInvInterface;
  15431. public OnDemandFetcher onDemandFetcher;
  15432. private int anInt1069;
  15433. private int anInt1070;
  15434. private int anInt1071;
  15435. private int[] anIntArray1072;
  15436. private int[] anIntArray1073;
  15437. private Sprite mapDotItem;
  15438. private Sprite mapDotNPC;
  15439. private Sprite mapDotPlayer;
  15440. private Sprite mapDotFriend;
  15441. private Sprite mapDotTeam;
  15442. private Sprite mapDotClan;
  15443. private int anInt1079;
  15444. private boolean aBoolean1080;
  15445. private String[] friendsList;
  15446. private Stream inStream;
  15447. private int anInt1084;
  15448. private int anInt1085;
  15449. private int activeInterfaceType;
  15450. private int anInt1087;
  15451. private int anInt1088;
  15452. public static int anInt1089;
  15453. private final int[] expectedCRCs;
  15454. public int[] menuActionCmd2;
  15455. public int[] menuActionCmd3;
  15456. public int[] menuActionID;
  15457. public int[] menuActionCmd1;
  15458. private Sprite[] headIcons;
  15459. private Sprite[] skullIcons;
  15460. private Sprite[] headIconsHint;
  15461. private static int anInt1097;
  15462. private int anInt1098;
  15463. private int anInt1099;
  15464. private int anInt1100;
  15465. private int anInt1101;
  15466. private int anInt1102;
  15467. private static boolean tabAreaAltered;
  15468. private int anInt1104;
  15469. private RSImageProducer aRSImageProducer_1107;
  15470. private RSImageProducer aRSImageProducer_1108;
  15471. private RSImageProducer loginScreenArea;
  15472. private RSImageProducer leftSideFlame;
  15473. private RSImageProducer rightSideFlame;
  15474. private RSImageProducer gameLogo;
  15475. private RSImageProducer aRSImageProducer_1113;
  15476. private RSImageProducer aRSImageProducer_1114;
  15477. private RSImageProducer aRSImageProducer_1115;
  15478. private static int anInt1117;
  15479. private int membersInt;
  15480. private String aString1121;
  15481. private Sprite compass;
  15482. private RSImageProducer aRSImageProducer_1123;
  15483. private RSImageProducer aRSImageProducer_1124;
  15484. private RSImageProducer aRSImageProducer_1125;
  15485. public static Player myPlayer;
  15486. private final String[] atPlayerActions;
  15487. private final boolean[] atPlayerArray;
  15488. private final int[][][] anIntArrayArrayArray1129;
  15489. private final int[] tabInterfaceIDs = {
  15490. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  15491. -1, -1, -1, -1, -1, -1, -1
  15492. };
  15493. private int anInt1131;
  15494. private int anInt1132;
  15495. public int menuActionRow;
  15496. private static int anInt1134;
  15497. private int spellSelected;
  15498. private int anInt1137;
  15499. private int spellUsableOn;
  15500. private String spellTooltip;
  15501. private Sprite[] aSpriteArray1140;
  15502. private boolean aBoolean1141;
  15503. private static int anInt1142;
  15504. public int energy;
  15505. private boolean aBoolean1149;
  15506. private Sprite[] crosses;
  15507. private boolean musicEnabled;
  15508. private Background[] aBackgroundArray1152s;
  15509. private static boolean needDrawTabArea;
  15510. private int unreadMessages;
  15511. private static int anInt1155;
  15512. private static boolean fpsOn;
  15513. public boolean loggedIn;
  15514. private boolean canMute;
  15515. private boolean aBoolean1159;
  15516. private boolean aBoolean1160;
  15517. static int loopCycle;
  15518. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  15519. private RSImageProducer inventoryBackImage;
  15520. private RSImageProducer mapEdgeIP;
  15521. private RSImageProducer mapBackImage;
  15522. private RSImageProducer inGameScreen;
  15523. private RSImageProducer chatBackImage;
  15524. private int daysSinceRecovChange;
  15525. private RSSocket socketStream;
  15526. private int anInt1169;
  15527. private int minimapInt3;
  15528. private int anInt1171;
  15529. private long aLong1172;
  15530. private String myUsername;
  15531. private String myPassword;
  15532. private static int anInt1175;
  15533. private boolean genericLoadingError;
  15534. private final int[] anIntArray1177 = {
  15535. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  15536. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  15537. 2, 2, 3
  15538. };
  15539. private int reportAbuseInterfaceID;
  15540. private NodeList aClass19_1179;
  15541. private int[] anIntArray1180;
  15542. private int[] anIntArray1181;
  15543. private int[] anIntArray1182;
  15544. private byte[][] aByteArrayArray1183;
  15545. private int anInt1184;
  15546. private int minimapInt1;
  15547. private int anInt1186;
  15548. private int anInt1187;
  15549. private static int anInt1188;
  15550. private int invOverlayInterfaceID;
  15551. private int[] anIntArray1190;
  15552. private int[] anIntArray1191;
  15553. public Stream stream;
  15554. private int anInt1193;
  15555. private int splitPrivateChat;
  15556. private Background mapBack;
  15557. public String[] menuActionName;
  15558. private Sprite aSprite_1201;
  15559. private Sprite aSprite_1202;
  15560. private final int[] anIntArray1203;
  15561. static final int[] anIntArray1204 = {
  15562. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  15563. 58654, 5027, 1457, 16565, 34991, 25486
  15564. };
  15565. private static boolean flagged;
  15566. private final int[] anIntArray1207;
  15567. private int anInt1208;
  15568. private int minimapInt2;
  15569. private int anInt1210;
  15570. private int anInt1211;
  15571. private String promptInput;
  15572. private int anInt1213;
  15573. private int[][][] intGroundArray;
  15574. private long aLong1215;
  15575. private int loginScreenCursorPos;
  15576. //private final Background[] modIcons;
  15577. public final Sprite[] modIcons;
  15578. private long aLong1220;
  15579. private static int tabID;
  15580. private int anInt1222;
  15581. public static boolean inputTaken;
  15582. public int inputDialogState;
  15583. private static int anInt1226;
  15584. private int nextSong;
  15585. private boolean songChanging;
  15586. private final int[] anIntArray1229;
  15587. private Class11[] aClass11Array1230;
  15588. public static int anIntArray1232[];
  15589. private boolean aBoolean1233;
  15590. private int[] anIntArray1234;
  15591. private int[] anIntArray1235;
  15592. private int[] anIntArray1236;
  15593. private int anInt1237;
  15594. private int anInt1238;
  15595. public final int anInt1239 = 100;
  15596. private final int[] anIntArray1240;
  15597. private final int[] anIntArray1241;
  15598. private boolean aBoolean1242;
  15599. private int atInventoryLoopCycle;
  15600. private int atInventoryInterface;
  15601. private int atInventoryIndex;
  15602. private int atInventoryInterfaceType;
  15603. private byte[][] aByteArrayArray1247;
  15604. private int tradeMode;
  15605. private int anInt1249;
  15606. private final int[] anIntArray1250;
  15607. private int anInt1251;
  15608. private final boolean rsAlreadyLoaded;
  15609. private int anInt1253;
  15610. private int anInt1254;
  15611. private boolean welcomeScreenRaised;
  15612. private boolean messagePromptRaised;
  15613. private int anInt1257;
  15614. private byte[][][] byteGroundArray;
  15615. private int prevSong;
  15616. private int destX;
  15617. private int destY;
  15618. private Sprite aSprite_1263;
  15619. private int anInt1264;
  15620. private int anInt1265;
  15621. private String loginMessage1;
  15622. private String loginMessage2;
  15623. private int anInt1268;
  15624. private int anInt1269;
  15625. public RSFont smallText;
  15626. private RSFont aTextDrawingArea_1271;
  15627. private RSFont chatTextDrawingArea;
  15628. private int anInt1275;
  15629. private int backDialogID;
  15630. private int anInt1278;
  15631. private int anInt1279;
  15632. private int[] bigX;
  15633. private int[] bigY;
  15634. private int itemSelected;
  15635. private int anInt1283;
  15636. private int anInt1284;
  15637. private int anInt1285;
  15638. private String selectedItemName;
  15639. private int publicChatMode;
  15640. private static int anInt1288;
  15641. private int anInt1289;
  15642. public static int anInt1290;
  15643. public static String server = "";
  15644.  
  15645. public int drawCount;
  15646. public int fullscreenInterfaceID;
  15647. public int anInt1044;//377
  15648. public int anInt1129;//377
  15649. public int anInt1315;//377
  15650. public int anInt1500;//377
  15651. public int anInt1501;//377
  15652. public int[] fullScreenTextureArray;
  15653. public void resetAllImageProducers() {
  15654. if (super.fullGameScreen != null) {
  15655. return;
  15656. }
  15657. chatBackImage = null;
  15658. mapBackImage = null;
  15659. inventoryBackImage = null;
  15660. inGameScreen = null;
  15661. aRSImageProducer_1124 = null;
  15662. aRSImageProducer_1125 = null;
  15663. aRSImageProducer_1107 = null;
  15664. aRSImageProducer_1108 = null;
  15665. loginScreenArea = null;
  15666. leftSideFlame = null;
  15667. rightSideFlame = null;
  15668. gameLogo = null;
  15669. aRSImageProducer_1113 = null;
  15670. aRSImageProducer_1114 = null;
  15671. aRSImageProducer_1115 = null;
  15672. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  15673. welcomeScreenRaised = true;
  15674. }
  15675. public boolean spriteChanged = false;
  15676. public int getSpriteID(){
  15677. spriteChanged = true;
  15678. if(is459)
  15679. return 3;
  15680. if(is480)
  15681. return 2;
  15682. if(is508 || is525)
  15683. return 1;
  15684. if(is562)
  15685. return 3;
  15686. if(is474)
  15687. return 0;
  15688. else
  15689. return 0;
  15690. }
  15691. public void launchURL(String url) {
  15692. String osName = System.getProperty("os.name");
  15693. try {
  15694. if (osName.startsWith("Mac OS")) {
  15695. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  15696. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  15697. openURL.invoke(null, new Object[] {url});
  15698. } else if (osName.startsWith("Windows"))
  15699. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  15700. else { //assume Unix or Linux
  15701. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  15702. String browser = null;
  15703. for (int count = 0; count < browsers.length && browser == null; count++)
  15704. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  15705. browser = browsers[count];
  15706. if (browser == null) {
  15707. throw new Exception("Could not find web browser");
  15708. } else
  15709. Runtime.getRuntime().exec(new String[] {browser, url});
  15710. }
  15711. } catch (Exception e) {
  15712. pushMessage("Failed to open URL.", 0, "");
  15713. }
  15714. }
  15715.  
  15716. static {
  15717. anIntArray1019 = new int[99];
  15718. int i = 0;
  15719. for(int j = 0; j < 99; j++) {
  15720. int l = j + 1;
  15721. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  15722. i += i1;
  15723. anIntArray1019[j] = i / 4;
  15724. }
  15725. anIntArray1232 = new int[32];
  15726. i = 2;
  15727. for(int k = 0; k < 32; k++) {
  15728. anIntArray1232[k] = i - 1;
  15729. i += i;
  15730. }
  15731. }
  15732. }
Advertisement
Add Comment
Please, Sign In to add comment