A RuneTek3 client (377) that is deobfuscated, converted to Kotlin, and includes QoL improvements.
0

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #8 from TheBlackParade/theblackparade

Renaming 95% of server -> client packets

+638 -564
+457 -456
src/main/java/com/jagex/runescape/Game.java
··· 52 52 import com.jagex.runescape.config.Configuration; 53 53 54 54 import static com.jagex.runescape.config.Configuration.*; 55 + import static com.jagex.runescape.config.IncomingPacketIds.*; 55 56 56 57 @SuppressWarnings("serial") 57 58 public class Game extends GameShell { ··· 411 412 private LinkedList aClass6_1210 = new LinkedList(); 412 413 private boolean cutsceneActive = false; 413 414 private boolean redrawChatMode = false; 414 - private int anInt1213 = -1; 415 + private int flashingSidebarId = -1; 415 416 public static int BITFIELD_MAX_VALUE[]; 416 417 private int anInt1215; 417 418 private int cameraX; ··· 879 880 880 881 } 881 882 882 - private void method19(String s) { 883 + private void openErrorWebPage(String s) { 883 884 System.out.println(s); 884 885 try { 885 886 // getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html")); ··· 1997 1998 thirdLastOpcode = secondLastOpcode; 1998 1999 secondLastOpcode = lastOpcode; 1999 2000 lastOpcode = opcode; 2000 - if (opcode == 166) { 2001 + if (opcode == UPDATE_INTERFACE_POSITION) { 2001 2002 int yOffset = buffer.getShortLE(); 2002 2003 int xOffset = buffer.getShortLE(); 2003 2004 int interfaceId = buffer.getUnsignedShortBE(); ··· 2007 2008 opcode = -1; 2008 2009 return true; 2009 2010 } 2010 - if (opcode == 186) { 2011 + if (opcode == UPDATE_INTERFACE_MODEL_DISPLAY) { 2011 2012 int rotationX = buffer.getUnsignedNegativeOffsetShortBE(); 2012 2013 int interfaceId = buffer.getUnsignedNegativeOffsetShortLE(); 2013 2014 int zoom = buffer.getUnsignedNegativeOffsetShortBE(); ··· 2018 2019 opcode = -1; 2019 2020 return true; 2020 2021 } 2021 - if (opcode == 216) { 2022 + if (opcode == SET_INTERFACE_MODEL_1) { 2022 2023 int j1 = buffer.getUnsignedNegativeOffsetShortLE(); 2023 2024 int interfaceId = buffer.getUnsignedNegativeOffsetShortLE(); 2024 2025 Widget.forId(interfaceId).modelType = 1; ··· 2026 2027 opcode = -1; 2027 2028 return true; 2028 2029 } 2029 - if (opcode == 26) { 2030 - int k1 = buffer.getUnsignedShortBE(); 2031 - int k11 = buffer.getUnsignedByte(); 2032 - int i17 = buffer.getUnsignedShortBE(); 2033 - if (i17 == 65535) { 2030 + if (opcode == PLAY_SOUND) { 2031 + int soundId = buffer.getUnsignedShortBE(); 2032 + int type = buffer.getUnsignedByte(); 2033 + int delay = buffer.getUnsignedShortBE(); 2034 + if (delay == 65535) { 2034 2035 if (currentSound < 50) { 2035 - sound[currentSound] = (short) k1; 2036 - soundType[currentSound] = k11; 2036 + sound[currentSound] = (short) soundId; 2037 + soundType[currentSound] = type; 2037 2038 soundDelay[currentSound] = 0; 2038 2039 currentSound++; 2039 2040 } 2040 2041 } else if (aBoolean1301 && !lowMemory && currentSound < 50) { 2041 - sound[currentSound] = k1; 2042 - soundType[currentSound] = k11; 2043 - soundDelay[currentSound] = i17 + SoundTrack.trackDelays[k1]; 2042 + sound[currentSound] = soundId; 2043 + soundType[currentSound] = type; 2044 + soundDelay[currentSound] = delay + SoundTrack.trackDelays[soundId]; 2044 2045 currentSound++; 2045 2046 } 2046 2047 opcode = -1; 2047 2048 return true; 2048 2049 } 2049 - if (opcode == 182) { // interface config/setting 2050 - int configId = buffer.getUnsignedNegativeOffsetShortBE(); 2051 - byte configValue = buffer.getPreNegativeOffsetByte(); 2052 - anIntArray1005[configId] = configValue; 2053 - if (widgetSettings[configId] != configValue) { 2054 - widgetSettings[configId] = configValue; 2055 - updateVarp(0, configId); 2050 + if (opcode == UPDATE_INTERFACE_SETTING_SMALL) { 2051 + int settingIndex = buffer.getUnsignedNegativeOffsetShortBE(); 2052 + byte settingValue = buffer.getPreNegativeOffsetByte(); 2053 + anIntArray1005[settingIndex] = settingValue; 2054 + if (widgetSettings[settingIndex] != settingValue) { 2055 + widgetSettings[settingIndex] = settingValue; 2056 + updateVarp(0, settingIndex); 2056 2057 redrawTabArea = true; 2057 2058 if (dialogueId != -1) 2058 2059 redrawChatbox = true; ··· 2060 2061 opcode = -1; 2061 2062 return true; 2062 2063 } 2063 - if (opcode == 13) { 2064 - for (int i2 = 0; i2 < players.length; i2++) 2065 - if (players[i2] != null) 2066 - players[i2].emoteAnimation = -1; 2064 + if (opcode == RESET_MOB_ANIMATIONS) { 2065 + for (int p = 0; p < players.length; p++) 2066 + if (players[p] != null) 2067 + players[p].emoteAnimation = -1; 2067 2068 2068 - for (int l11 = 0; l11 < npcs.length; l11++) 2069 - if (npcs[l11] != null) 2070 - npcs[l11].emoteAnimation = -1; 2069 + for (int n = 0; n < npcs.length; n++) 2070 + if (npcs[n] != null) 2071 + npcs[n].emoteAnimation = -1; 2071 2072 2072 2073 opcode = -1; 2073 2074 return true; 2074 2075 } 2075 - if (opcode == 156) { 2076 + if (opcode == SET_MINIMAP_STATE) { 2076 2077 minimapState = buffer.getUnsignedByte(); 2077 2078 opcode = -1; 2078 2079 return true; 2079 2080 } 2080 - if (opcode == 162) { 2081 - int j2 = buffer.getUnsignedNegativeOffsetShortBE(); 2081 + if (opcode == SET_INTERFACE_MODEL_2) { 2082 + int modelId = buffer.getUnsignedNegativeOffsetShortBE(); 2082 2083 int interfaceId = buffer.getUnsignedShortLE(); 2083 2084 Widget.forId(interfaceId).modelType = 2; 2084 - Widget.forId(interfaceId).modelId = j2; 2085 + Widget.forId(interfaceId).modelId = modelId; 2085 2086 opcode = -1; 2086 2087 return true; 2087 2088 } 2088 - if (opcode == 109) { 2089 - int k2 = buffer.getUnsignedShortBE(); 2090 - method112((byte) 36, k2); 2089 + if (opcode == SHOW_CHATBOX_INTERFACE) { 2090 + int interfaceId = buffer.getUnsignedShortBE(); 2091 + method112((byte) 36, interfaceId); 2091 2092 if (openInvOverLayId != -1) { 2092 2093 method44(openInvOverLayId); 2093 2094 openInvOverLayId = -1; ··· 2107 2108 method44(openInterfaceId); 2108 2109 openInterfaceId = -1; 2109 2110 } 2110 - if (backDialogueId != k2) { 2111 + if (backDialogueId != interfaceId) { 2111 2112 method44(backDialogueId); 2112 - backDialogueId = k2; 2113 + backDialogueId = interfaceId; 2113 2114 } 2114 2115 aBoolean1239 = false; 2115 2116 redrawChatbox = true; 2116 2117 opcode = -1; 2117 2118 return true; 2118 2119 } 2119 - if (opcode == 220) { 2120 + if (opcode == PLAY_SONG) { 2120 2121 int songID = buffer.getUnsignedNegativeOffsetShortLE(); 2121 2122 if (songID == 65535) 2122 2123 songID = -1; ··· 2129 2130 opcode = -1; 2130 2131 return true; 2131 2132 } 2132 - if (opcode == 249) { 2133 - int fileId = buffer.getUnsignedShortLE(); 2134 - int j12 = buffer.getMediumME(); 2133 + if (opcode == PLAY_TEMP_SONG) { 2134 + int temporarySong = buffer.getUnsignedShortLE(); 2135 + int previousSong = buffer.getMediumME(); 2135 2136 if (musicEnabled && !lowMemory) { 2136 - nextSong = fileId; 2137 + nextSong = temporarySong; 2137 2138 songChanging = false; 2138 - onDemandRequester.request(2, nextSong); // request something from cache!?! 2139 - previousSong = j12; 2139 + onDemandRequester.request(2, this.nextSong); 2140 + this.previousSong = previousSong; 2140 2141 } 2141 2142 opcode = -1; 2142 2143 return true; 2143 2144 } 2144 - if (opcode == 158) { 2145 - int j3 = buffer.getShortLE(); 2146 - if (j3 != dialogueId) { 2145 + if (opcode == SHOW_DIALOG) { 2146 + int interfaceId = buffer.getShortLE(); 2147 + if (interfaceId != dialogueId) { 2147 2148 method44(dialogueId); 2148 - dialogueId = j3; 2149 + dialogueId = interfaceId; 2149 2150 } 2150 2151 redrawChatbox = true; 2151 2152 opcode = -1; 2152 2153 return true; 2153 2154 } 2154 - if (opcode == 218) { // set interface colour(?) 2155 + if (opcode == UPDATE_INTERFACE_COLOR) { 2155 2156 int interfaceId = buffer.getUnsignedShortBE(); 2156 2157 int rgb = buffer.getUnsignedNegativeOffsetShortBE(); 2157 2158 int j17 = rgb >> 10 & 0x1f; ··· 2161 2162 opcode = -1; 2162 2163 return true; 2163 2164 } 2164 - if (opcode == 157) { // update player option 2165 + if (opcode == UPDATE_PLAYER_CONTEXT_OPTION) { 2165 2166 int slot = buffer.getUnsignedInvertedByte(); 2166 2167 String option = buffer.getString(); 2167 2168 int alwaysOnTop = buffer.getUnsignedByte(); ··· 2174 2175 opcode = -1; 2175 2176 return true; 2176 2177 } 2177 - if (opcode == 6) { 2178 + if (opcode == SET_CHAT_INPUT_TYPE_2) { 2178 2179 messagePromptRaised = false; 2179 2180 inputType = 2; 2180 2181 inputInputMessage = ""; ··· 2182 2183 opcode = -1; 2183 2184 return true; 2184 2185 } 2185 - if (opcode == 201) { 2186 + if (opcode == UPDATE_CHAT_SETTINGS) { 2186 2187 publicChatMode = buffer.getUnsignedByte(); 2187 2188 privateChatMode = buffer.getUnsignedByte(); 2188 2189 tradeMode = buffer.getUnsignedByte(); ··· 2191 2192 opcode = -1; 2192 2193 return true; 2193 2194 } 2194 - if (opcode == 199) { 2195 + if (opcode == SHOW_HINT_ICON) { 2195 2196 headIconDrawType = buffer.getUnsignedByte(); 2196 2197 if (headIconDrawType == 1) 2197 2198 anInt1226 = buffer.getUnsignedShortBE(); ··· 2226 2227 opcode = -1; 2227 2228 return true; 2228 2229 } 2229 - if (opcode == 167) { 2230 + if (opcode == MOVE_CUTSCENE_CAMERA) { 2230 2231 cutsceneActive = true; 2231 2232 anInt993 = buffer.getUnsignedByte(); 2232 2233 anInt994 = buffer.getUnsignedByte(); ··· 2251 2252 opcode = -1; 2252 2253 return true; 2253 2254 } 2254 - if (opcode == 5) { 2255 - logout(); // simulate a crash?? 2255 + if (opcode == SEND_LOGOUT) { 2256 + logout(); 2256 2257 opcode = -1; 2257 2258 return false; 2258 2259 } 2259 - if (opcode == 115) { 2260 - int j4 = buffer.getIntME2(); 2261 - int i13 = buffer.getUnsignedShortLE(); 2262 - anIntArray1005[i13] = j4; 2263 - if (widgetSettings[i13] != j4) { 2264 - widgetSettings[i13] = j4; 2265 - updateVarp(0, i13); 2260 + if (opcode == UPDATE_INTERFACE_SETTING_LARGE) { 2261 + int settingValue = buffer.getIntME2(); 2262 + int settingIndex = buffer.getUnsignedShortLE(); 2263 + anIntArray1005[settingIndex] = settingValue; 2264 + if (widgetSettings[settingIndex] != settingValue) { 2265 + widgetSettings[settingIndex] = settingValue; 2266 + updateVarp(0, settingIndex); 2266 2267 redrawTabArea = true; 2267 2268 if (dialogueId != -1) 2268 2269 redrawChatbox = true; ··· 2270 2271 opcode = -1; 2271 2272 return true; 2272 2273 } 2273 - if (opcode == 29) { // close open interfaces?? 2274 + if (opcode == CLOSE_ALL_INTERFACES) { 2274 2275 if (openInvOverLayId != -1) { 2275 2276 method44(openInvOverLayId); 2276 2277 openInvOverLayId = -1; ··· 2303 2304 opcode = -1; 2304 2305 return true; 2305 2306 } 2306 - if (opcode == 76) { // open welcome screen 2307 + if (opcode == SHOW_WELCOME_SCREEN) { // @TODO rename all these vars 2307 2308 anInt1083 = buffer.getUnsignedShortLE(); 2308 2309 anInt1075 = buffer.getUnsignedNegativeOffsetShortLE(); 2309 2310 buffer.getUnsignedShortBE(); ··· 2319 2320 opcode = -1; 2320 2321 return true; 2321 2322 } 2322 - if (opcode == 63) { // server message 2323 + if (opcode == CHATBOX_MESSAGE) { // server message 2323 2324 String message = buffer.getString(); 2324 2325 if (message.endsWith(":tradereq:")) { 2325 2326 String s3 = message.substring(0, message.indexOf(":")); ··· 2368 2369 opcode = -1; 2369 2370 return true; 2370 2371 } 2371 - if (opcode == 50) { 2372 - int k4 = buffer.getShortBE(); 2373 - if (k4 >= 0) 2374 - method112((byte) 36, k4); 2375 - if (k4 != walkableWidgetId) { 2372 + if (opcode == SHOW_WALKABLE_INTERFACE) { 2373 + int interfaceId = buffer.getShortBE(); 2374 + if (interfaceId >= 0) 2375 + method112((byte) 36, interfaceId); 2376 + if (interfaceId != walkableWidgetId) { 2376 2377 method44(walkableWidgetId); 2377 - walkableWidgetId = k4; 2378 + walkableWidgetId = interfaceId; 2378 2379 } 2379 2380 opcode = -1; 2380 2381 return true; 2381 2382 } 2382 - if (opcode == 82) { // make interface (in)visible maybe? 2383 - boolean flag = buffer.getUnsignedByte() == 1; 2383 + if (opcode == UPDATE_INTERFACE_HIDDEN_ON_HOVER_STATE) { 2384 + boolean hiddenUntilHovered = buffer.getUnsignedByte() == 1; 2384 2385 int interfaceId = buffer.getUnsignedShortBE(); 2385 - Widget.forId(interfaceId).hiddenUntilHovered = flag; 2386 + Widget.forId(interfaceId).hiddenUntilHovered = hiddenUntilHovered; 2386 2387 opcode = -1; 2387 2388 return true; 2388 2389 } 2389 - if (opcode == 174) { 2390 + if (opcode == UPDATE_CARRY_WEIGHT) { 2390 2391 if (currentTabId == 12) 2391 2392 redrawTabArea = true; 2392 2393 userWeight = buffer.getShortBE(); 2393 2394 opcode = -1; 2394 2395 return true; 2395 2396 } 2396 - if (opcode == 233) { 2397 + if (opcode == 233) { // ??? 2397 2398 anInt1319 = buffer.getUnsignedByte(); 2398 2399 opcode = -1; 2399 2400 return true; 2400 2401 } 2401 - if (opcode == 61) { 2402 + if (opcode == 61) { // ??? reset destination x? why? 2402 2403 destinationX = 0; 2403 2404 opcode = -1; 2404 2405 return true; 2405 2406 } 2406 - if (opcode == 128) { 2407 - int interfaceId = buffer.getUnsignedNegativeOffsetShortBE(); 2408 - int invOverlayId = buffer.getUnsignedNegativeOffsetShortLE(); 2407 + if (opcode == SHOW_SIDEBAR_AND_GAME_INTERFACE) { 2408 + int gameInterfaceId = buffer.getUnsignedNegativeOffsetShortBE(); 2409 + int sidebarInterfaceId = buffer.getUnsignedNegativeOffsetShortLE(); 2409 2410 if (backDialogueId != -1) { 2410 2411 method44(backDialogueId); 2411 2412 backDialogueId = -1; ··· 2420 2421 method44(anInt960); 2421 2422 anInt960 = -1; 2422 2423 } 2423 - if (openInterfaceId != interfaceId) { 2424 + if (openInterfaceId != gameInterfaceId) { 2424 2425 method44(openInterfaceId); 2425 - openInterfaceId = interfaceId; 2426 + openInterfaceId = gameInterfaceId; 2426 2427 } 2427 - if (openInvOverLayId != invOverlayId) { 2428 + if (openInvOverLayId != sidebarInterfaceId) { 2428 2429 method44(openInvOverLayId); 2429 - openInvOverLayId = invOverlayId; 2430 + openInvOverLayId = sidebarInterfaceId; 2430 2431 } 2431 2432 if (inputType != 0) { 2432 2433 inputType = 0; ··· 2438 2439 opcode = -1; 2439 2440 return true; 2440 2441 } 2441 - if (opcode == 67) { 2442 - int i5 = buffer.getUnsignedByte(); 2443 - int l13 = buffer.getUnsignedByte(); 2444 - int i18 = buffer.getUnsignedByte(); 2445 - int l22 = buffer.getUnsignedByte(); 2446 - customCameraActive[i5] = true; 2447 - cameraJitter[i5] = l13; 2448 - cameraAmplitude[i5] = i18; 2449 - cameraFrequency[i5] = l22; 2450 - quakeTimes[i5] = 0; 2442 + if (opcode == CAMERA_SHAKE) { 2443 + int slot = buffer.getUnsignedByte(); 2444 + int jitter = buffer.getUnsignedByte(); 2445 + int amplitude = buffer.getUnsignedByte(); 2446 + int frequency = buffer.getUnsignedByte(); 2447 + customCameraActive[slot] = true; 2448 + cameraJitter[slot] = jitter; 2449 + cameraAmplitude[slot] = amplitude; 2450 + cameraFrequency[slot] = frequency; 2451 + quakeTimes[slot] = 0; 2451 2452 opcode = -1; 2452 2453 return true; 2453 2454 } 2454 - if (opcode == 134) { // set items in interface 2455 + if (opcode == UPDATE_INTERFACE_ITEMS_BY_SLOT) { 2455 2456 redrawTabArea = true; 2456 2457 int interfaceId = buffer.getUnsignedShortBE(); 2457 - Widget inter = Widget.forId(interfaceId); 2458 + Widget widget = Widget.forId(interfaceId); 2458 2459 while (buffer.currentPosition < packetSize) { 2459 2460 int slot = buffer.getSmart(); 2460 2461 int id = buffer.getUnsignedShortBE(); 2461 2462 int amount = buffer.getUnsignedByte(); 2462 2463 if (amount == 255) 2463 2464 amount = buffer.getIntBE(); 2464 - if (slot >= 0 && slot < inter.items.length) { 2465 - inter.items[slot] = id; 2466 - inter.itemAmounts[slot] = amount; 2465 + if (slot >= 0 && slot < widget.items.length) { 2466 + widget.items[slot] = id; 2467 + widget.itemAmounts[slot] = amount; 2467 2468 } 2468 2469 } 2469 2470 opcode = -1; 2470 2471 return true; 2471 2472 } 2472 - if (opcode == 78) { // update friend status 2473 - long friend = buffer.getLongBE(); 2474 - int nodeId = buffer.getUnsignedByte(); 2475 - String friendName = TextUtils.formatName(TextUtils.longToName(friend)); 2473 + if (opcode == UPDATE_FRIEND) { // update friend status 2474 + long friendNameLong = buffer.getLongBE(); 2475 + int worldId = buffer.getUnsignedByte(); 2476 + String friendName = TextUtils.formatName(TextUtils.longToName(friendNameLong)); 2476 2477 for (int k25 = 0; k25 < friendsCount; k25++) { 2477 - if (friend != friends[k25]) 2478 + if (friendNameLong != friends[k25]) 2478 2479 continue; 2479 - if (friendWorlds[k25] != nodeId) { 2480 - friendWorlds[k25] = nodeId; 2480 + if (friendWorlds[k25] != worldId) { 2481 + friendWorlds[k25] = worldId; 2481 2482 redrawTabArea = true; 2482 - if (nodeId > 0) 2483 + if (worldId > 0) 2483 2484 addChatMessage("", friendName + " has logged in.", 5); 2484 - if (nodeId == 0) 2485 + if (worldId == 0) 2485 2486 addChatMessage("", friendName + " has logged out.", 5); 2486 2487 } 2487 2488 friendName = null; ··· 2489 2490 } 2490 2491 2491 2492 if (friendName != null && friendsCount < 200) { 2492 - friends[friendsCount] = friend; 2493 + friends[friendsCount] = friendNameLong; 2493 2494 friendUsernames[friendsCount] = friendName; 2494 - friendWorlds[friendsCount] = nodeId; 2495 + friendWorlds[friendsCount] = worldId; 2495 2496 friendsCount++; 2496 2497 redrawTabArea = true; 2497 2498 } 2498 2499 for (boolean flag5 = false; !flag5; ) { 2499 2500 flag5 = true; 2500 - for (int j30 = 0; j30 < friendsCount - 1; j30++) 2501 - if (friendWorlds[j30] != world && friendWorlds[j30 + 1] == world 2502 - || friendWorlds[j30] == 0 && friendWorlds[j30 + 1] != 0) { 2503 - int l31 = friendWorlds[j30]; 2504 - friendWorlds[j30] = friendWorlds[j30 + 1]; 2505 - friendWorlds[j30 + 1] = l31; 2506 - String s10 = friendUsernames[j30]; 2507 - friendUsernames[j30] = friendUsernames[j30 + 1]; 2508 - friendUsernames[j30 + 1] = s10; 2509 - long l33 = friends[j30]; 2510 - friends[j30] = friends[j30 + 1]; 2511 - friends[j30 + 1] = l33; 2501 + // Reordering the list 2502 + for (int i = 0; i < friendsCount - 1; i++) 2503 + if (friendWorlds[i] != world && friendWorlds[i + 1] == world 2504 + || friendWorlds[i] == 0 && friendWorlds[i + 1] != 0) { 2505 + int world = friendWorlds[i]; 2506 + friendWorlds[i] = friendWorlds[i + 1]; 2507 + friendWorlds[i + 1] = world; 2508 + String name = friendUsernames[i]; 2509 + friendUsernames[i] = friendUsernames[i + 1]; 2510 + friendUsernames[i + 1] = name; 2511 + long friend = friends[i]; 2512 + friends[i] = friends[i + 1]; 2513 + friends[i + 1] = friend; 2512 2514 redrawTabArea = true; 2513 2515 flag5 = false; 2514 2516 } ··· 2518 2520 opcode = -1; 2519 2521 return true; 2520 2522 } 2521 - if (opcode == 58) { // enter amount interface 2523 + if (opcode == 58) { // ??? enter amount interface? 2522 2524 messagePromptRaised = false; 2523 2525 inputType = 1; 2524 2526 inputInputMessage = ""; ··· 2526 2528 opcode = -1; 2527 2529 return true; 2528 2530 } 2529 - if (opcode == 252) { 2531 + if (opcode == SET_OPEN_SIDEBAR) { 2530 2532 currentTabId = buffer.getUnsignedInvertedByte(); 2531 2533 redrawTabArea = true; 2532 2534 drawTabIcons = true; 2533 2535 opcode = -1; 2534 2536 return true; 2535 2537 } 2536 - if (opcode == 40) { 2538 + if (opcode == CLEAR_GROUND_ITEMS_AND_LANDSCAPE_OBJECTS) { 2537 2539 placementY = buffer.getUnsignedPreNegativeOffsetByte(); 2538 2540 placementX = buffer.getUnsignedInvertedByte(); 2539 - for (int k5 = placementX; k5 < placementX + 8; k5++) { 2540 - for (int i14 = placementY; i14 < placementY + 8; i14++) 2541 - if (groundItems[plane][k5][i14] != null) { 2542 - groundItems[plane][k5][i14] = null; 2543 - processGroundItems(k5, i14); 2541 + for (int x = placementX; x < placementX + 8; x++) { 2542 + for (int y = placementY; y < placementY + 8; y++) 2543 + if (groundItems[plane][x][y] != null) { 2544 + groundItems[plane][x][y] = null; 2545 + processGroundItems(x, y); 2544 2546 } 2545 2547 2546 2548 } ··· 2555 2557 opcode = -1; 2556 2558 return true; 2557 2559 } 2558 - if (opcode == 255) { // show player in an interface *maybe*? 2560 + if (opcode == SET_INTERFACE_PLAYER_HEAD) { 2559 2561 int interfaceId = buffer.getUnsignedNegativeOffsetShortLE(); 2560 2562 Widget.forId(interfaceId).modelType = 3; 2561 2563 if (localPlayer.npcDefinition == null) // maybe that is the appear as npc thing? ··· 2567 2569 opcode = -1; 2568 2570 return true; 2569 2571 } 2570 - if (opcode == 135) { // private message (?) 2571 - long l6 = buffer.getLongBE(); 2572 - int i19 = buffer.getIntBE(); 2573 - int j23 = buffer.getUnsignedByte(); 2572 + if (opcode == PRIVATE_MESSAGE_RECEIVED) { 2573 + long fromPlayerIndex = buffer.getLongBE(); 2574 + int chatId = buffer.getIntBE(); 2575 + int fromPlayerRights = buffer.getUnsignedByte(); 2574 2576 boolean flag4 = false; 2575 2577 for (int k28 = 0; k28 < 100; k28++) { 2576 - if (anIntArray1258[k28] != i19) 2578 + if (anIntArray1258[k28] != chatId) 2577 2579 continue; 2578 2580 flag4 = true; 2579 2581 break; 2580 2582 } 2581 2583 2582 - if (j23 <= 1) { 2584 + if (fromPlayerRights <= 1) { 2583 2585 for (int k30 = 0; k30 < ignoresCount; k30++) { 2584 - if (ignores[k30] != l6) 2586 + if (ignores[k30] != fromPlayerIndex) 2585 2587 continue; 2586 2588 flag4 = true; 2587 2589 break; ··· 2590 2592 } 2591 2593 if (!flag4 && !inTutorialIsland) 2592 2594 try { 2593 - anIntArray1258[anInt1152] = i19; 2595 + anIntArray1258[anInt1152] = chatId; 2594 2596 anInt1152 = (anInt1152 + 1) % 100; 2595 2597 String s9 = ChatEncoder.get(packetSize - 13, buffer); 2596 - if (j23 != 3) 2598 + if (fromPlayerRights != 3) 2597 2599 s9 = ChatCensor.censorString(s9); 2598 - if (j23 == 2 || j23 == 3) 2599 - addChatMessage("@cr2@" + TextUtils.formatName(TextUtils.longToName(l6)), 2600 + if (fromPlayerRights == 2 || fromPlayerRights == 3) 2601 + addChatMessage("@cr2@" + TextUtils.formatName(TextUtils.longToName(fromPlayerIndex)), 2600 2602 s9, 7); 2601 - else if (j23 == 1) 2602 - addChatMessage("@cr1@" + TextUtils.formatName(TextUtils.longToName(l6)), 2603 + else if (fromPlayerRights == 1) 2604 + addChatMessage("@cr1@" + TextUtils.formatName(TextUtils.longToName(fromPlayerIndex)), 2603 2605 s9, 7); 2604 2606 else 2605 - addChatMessage(TextUtils.formatName(TextUtils.longToName(l6)), s9, 3); 2607 + addChatMessage(TextUtils.formatName(TextUtils.longToName(fromPlayerIndex)), s9, 3); 2606 2608 } catch (Exception exception1) { 2607 2609 SignLink.reportError("cde1"); 2608 2610 } 2609 2611 opcode = -1; 2610 2612 return true; 2611 2613 } 2612 - if (opcode == 183) { 2614 + if (opcode == UPDATE_GROUND_ITEMS_AND_LANDSCAPE_OBJECTS) { 2613 2615 placementX = buffer.getUnsignedByte(); 2614 2616 placementY = buffer.getUnsignedPostNegativeOffsetByte(); 2615 2617 while (buffer.currentPosition < packetSize) { ··· 2619 2621 opcode = -1; 2620 2622 return true; 2621 2623 } 2622 - if (opcode == 159) { // open interface 2624 + if (opcode == SHOW_GAME_INTERFACE) { 2623 2625 int interfaceId = buffer.getUnsignedNegativeOffsetShortLE(); 2624 2626 method112((byte) 36, interfaceId); 2625 2627 if (openInvOverLayId != -1) { ··· 2654 2656 opcode = -1; 2655 2657 return true; 2656 2658 } 2657 - if (opcode == 246) { 2658 - int i7 = buffer.getUnsignedNegativeOffsetShortLE(); 2659 - method112((byte) 36, i7); 2659 + if (opcode == SHOW_SIDEBAR_OVERLAY_INTERFACE) { 2660 + int interfaceId = buffer.getUnsignedNegativeOffsetShortLE(); 2661 + method112((byte) 36, interfaceId); 2660 2662 if (backDialogueId != -1) { 2661 2663 method44(backDialogueId); 2662 2664 backDialogueId = -1; ··· 2675 2677 method44(openInterfaceId); 2676 2678 openInterfaceId = -1; 2677 2679 } 2678 - if (openInvOverLayId != i7) { 2680 + if (openInvOverLayId != interfaceId) { 2679 2681 method44(openInvOverLayId); 2680 - openInvOverLayId = i7; 2682 + openInvOverLayId = interfaceId; 2681 2683 } 2682 2684 if (inputType != 0) { 2683 2685 inputType = 0; ··· 2689 2691 opcode = -1; 2690 2692 return true; 2691 2693 } 2692 - if (opcode == 49) { 2694 + if (opcode == UPDATE_SKILL) { 2693 2695 redrawTabArea = true; 2694 - int _skillId = buffer.getUnsignedInvertedByte(); 2695 - int _skillLevel = buffer.getUnsignedByte(); 2696 - int _skillExp = buffer.getIntBE(); 2697 - skillExperience[_skillId] = _skillExp; 2698 - skillLevel[_skillId] = _skillLevel; 2699 - skillMaxLevel[_skillId] = 1; 2700 - for (int level = 0; level < 98; level++) 2701 - if (_skillExp >= SKILL_EXPERIENCE[level]) 2702 - skillMaxLevel[_skillId] = level + 2; 2696 + int skillIndex = buffer.getUnsignedInvertedByte(); 2697 + int level = buffer.getUnsignedByte(); 2698 + int xp = buffer.getIntBE(); 2699 + skillExperience[skillIndex] = xp; 2700 + skillLevel[skillIndex] = level; 2701 + skillMaxLevel[skillIndex] = 1; 2702 + for (int l = 0; l < 98; l++) 2703 + if (xp >= SKILL_EXPERIENCE[l]) 2704 + skillMaxLevel[skillIndex] = l + 2; 2703 2705 2704 2706 opcode = -1; 2705 2707 return true; 2706 2708 } 2707 - if (opcode == 206) { // update all items in interface 2709 + if (opcode == UPDATE_ALL_INTERFACE_ITEMS) { // update all items in interface 2708 2710 redrawTabArea = true; 2709 2711 int interfaceId = buffer.getUnsignedShortBE(); 2710 - Widget inter = Widget.forId(interfaceId); 2712 + Widget widget = Widget.forId(interfaceId); 2711 2713 int items = buffer.getUnsignedShortBE(); 2712 2714 for (int item = 0; item < items; item++) { 2713 - inter.items[item] = buffer.getUnsignedNegativeOffsetShortLE(); 2715 + widget.items[item] = buffer.getUnsignedNegativeOffsetShortLE(); 2714 2716 int amount = buffer.getUnsignedInvertedByte(); 2715 2717 if (amount == 255) 2716 2718 amount = buffer.getIntLE(); 2717 - inter.itemAmounts[item] = amount; 2719 + widget.itemAmounts[item] = amount; 2718 2720 } 2719 2721 2720 - for (int i26 = items; i26 < inter.items.length; i26++) { 2721 - inter.items[i26] = 0; 2722 - inter.itemAmounts[i26] = 0; 2722 + for (int i26 = items; i26 < widget.items.length; i26++) { 2723 + widget.items[i26] = 0; 2724 + widget.itemAmounts[i26] = 0; 2723 2725 } 2724 2726 2725 2727 opcode = -1; 2726 2728 return true; 2727 2729 } 2728 - if (opcode == 222 || opcode == 53) { // new map region 2730 + if (opcode == UPDATE_ACTIVE_MAP_REGION || opcode == CONSTRUCT_MAP_REGION) { 2729 2731 int tmpChunkX = chunkX; 2730 2732 int tmpChunkY = chunkY; 2731 - if (opcode == 222) { 2733 + if (opcode == UPDATE_ACTIVE_MAP_REGION) { 2732 2734 tmpChunkY = buffer.getUnsignedShortBE(); 2733 2735 tmpChunkX = buffer.getUnsignedNegativeOffsetShortLE(); 2734 2736 aBoolean1163 = false; 2735 2737 } 2736 - if (opcode == 53) { 2738 + if (opcode == CONSTRUCT_MAP_REGION) { 2737 2739 tmpChunkX = buffer.getUnsignedNegativeOffsetShortBE(); 2738 2740 buffer.initBitAccess(); 2739 2741 for (int z = 0; z < 4; z++) { ··· 2770 2772 loadingStage = 1; 2771 2773 aLong1229 = System.currentTimeMillis(); 2772 2774 method125(null, "Loading - please wait."); 2773 - if (opcode == 222) { 2775 + if (opcode == UPDATE_ACTIVE_MAP_REGION) { 2774 2776 int count = 0; 2775 2777 for (int fileX = (chunkX - 6) / 8; fileX <= (chunkX + 6) / 8; fileX++) { 2776 2778 for (int fileY = (chunkY - 6) / 8; fileY <= (chunkY + 6) / 8; fileY++) ··· 2806 2808 } 2807 2809 2808 2810 } 2809 - if (opcode == 53) { 2811 + if (opcode == CONSTRUCT_MAP_REGION) { 2810 2812 int uniqueCount = 0; 2811 2813 int fileIndices[] = new int[676]; 2812 2814 for (int tileZ = 0; tileZ < 4; tileZ++) { ··· 2929 2931 opcode = -1; 2930 2932 return true; 2931 2933 } 2932 - if (opcode == 190) { 2934 + if (opcode == SYSTEM_UPDATE) { 2933 2935 systemUpdateTime = buffer.getUnsignedShortLE() * 30; 2934 2936 opcode = -1; 2935 2937 return true; 2936 2938 } 2937 - if (opcode == 41 || opcode == 121 || opcode == 203 || opcode == 106 || opcode == 59 || opcode == 181 2938 - || opcode == 208 || opcode == 107 || opcode == 142 || opcode == 88 || opcode == 152) { 2939 - parsePlacementPacket(buffer, opcode); // these are to do with objects iirc 2939 + if (opcode == PLAY_POSITION_SOUND || opcode == UPDATE_GROUND_ITEM_AMOUNT || opcode == 203 || opcode == SET_PLAYER_GROUND_ITEM 2940 + || opcode == SHOW_STILL_GRAPHICS || opcode == SHOW_PROJECTILE || opcode == REMOVE_GROUND_ITEM 2941 + || opcode == SET_GROUND_ITEM || opcode == 142 || opcode == REMOVE_LANDSCAPE_OBJECT || opcode == SET_LANDSCAPE_OBJECT) { 2942 + parsePlacementPacket(buffer, opcode); 2940 2943 opcode = -1; 2941 2944 return true; 2942 2945 } 2943 - if (opcode == 125) { 2946 + if (opcode == UPDATE_RUN_ENERGY) { 2944 2947 if (currentTabId == 12) 2945 2948 redrawTabArea = true; 2946 2949 runEnergy = buffer.getUnsignedByte(); 2947 2950 opcode = -1; 2948 2951 return true; 2949 2952 } 2950 - if (opcode == 21) { // show a model on an interface?? 2953 + if (opcode == SET_INTERFACE_ITEM_MODEL) { 2951 2954 int scale = buffer.getUnsignedShortBE(); 2952 2955 int itemId = buffer.getUnsignedShortLE(); 2953 2956 int interfaceId = buffer.getUnsignedNegativeOffsetShortLE(); ··· 2966 2969 return true; 2967 2970 } 2968 2971 } 2969 - if (opcode == 3) { 2972 + if (opcode == 3) { // camera? something with cutscenes? Set cutscene camera position?... 2970 2973 cutsceneActive = true; 2971 2974 anInt874 = buffer.getUnsignedByte(); 2972 2975 anInt875 = buffer.getUnsignedByte(); ··· 2981 2984 opcode = -1; 2982 2985 return true; 2983 2986 } 2984 - if (opcode == 2) { 2987 + if (opcode == SET_INTERFACE_ANIMATION) { 2985 2988 int interfaceId = buffer.getUnsignedNegativeOffsetShortLE(); 2986 2989 int animationId = buffer.getNegativeOffsetShortBE(); 2987 - Widget class13_3 = Widget.forId(interfaceId); 2988 - if (class13_3.disabledAnimation != animationId || animationId == -1) { 2989 - class13_3.disabledAnimation = animationId; 2990 - class13_3.animationFrame = 0; 2991 - class13_3.animationDuration = 0; 2990 + Widget widget = Widget.forId(interfaceId); 2991 + if (widget.disabledAnimation != animationId || animationId == -1) { 2992 + widget.disabledAnimation = animationId; 2993 + widget.animationFrame = 0; 2994 + widget.animationDuration = 0; 2992 2995 } 2993 2996 opcode = -1; 2994 2997 return true; 2995 2998 } 2996 - if (opcode == 71) { 2999 + if (opcode == NPC_UPDATING) { 2997 3000 updateNpcs(buffer, aBoolean1038, packetSize); 2998 3001 opcode = -1; 2999 3002 return true; 3000 3003 } 3001 - if (opcode == 226) { // ignore list 3004 + if (opcode == UPDATE_IGNORE_LIST) { 3002 3005 ignoresCount = packetSize / 8; 3003 - for (int k8 = 0; k8 < ignoresCount; k8++) 3004 - ignores[k8] = buffer.getLongBE(); 3006 + for (int i = 0; i < ignoresCount; i++) 3007 + ignores[i] = buffer.getLongBE(); 3005 3008 3006 3009 opcode = -1; 3007 3010 return true; 3008 3011 } 3009 - if (opcode == 10) { 3010 - int sidebarIcon = buffer.getUnsignedPreNegativeOffsetByte(); 3012 + if (opcode == SET_SIDEBAR_INTERFACE) { 3013 + int sidebarIndex = buffer.getUnsignedPreNegativeOffsetByte(); 3011 3014 int interfaceId = buffer.getUnsignedNegativeOffsetShortBE(); 3012 3015 if (interfaceId == 65535) 3013 3016 interfaceId = -1; 3014 - if (tabInterfaceIDs[sidebarIcon] != interfaceId) { 3015 - method44(tabInterfaceIDs[sidebarIcon]); 3016 - tabInterfaceIDs[sidebarIcon] = interfaceId; 3017 + if (tabInterfaceIDs[sidebarIndex] != interfaceId) { 3018 + method44(tabInterfaceIDs[sidebarIndex]); 3019 + tabInterfaceIDs[sidebarIndex] = interfaceId; 3017 3020 } 3018 3021 redrawTabArea = true; 3019 3022 drawTabIcons = true; 3020 3023 opcode = -1; 3021 3024 return true; 3022 3025 } 3023 - if (opcode == 219) { // reset all items on interface? 3026 + if (opcode == CLEAR_INTERFACE_ITEMS) { 3024 3027 int interfaceId = buffer.getUnsignedShortLE(); 3025 - Widget class13_2 = Widget.forId(interfaceId); 3026 - for (int k21 = 0; k21 < class13_2.items.length; k21++) { 3027 - class13_2.items[k21] = -1; 3028 - class13_2.items[k21] = 0; 3028 + Widget widget = Widget.forId(interfaceId); 3029 + for (int k21 = 0; k21 < widget.items.length; k21++) { 3030 + widget.items[k21] = -1; 3031 + widget.items[k21] = 0; 3029 3032 } 3030 3033 3031 3034 opcode = -1; 3032 3035 return true; 3033 3036 } 3034 - if (opcode == 238) { 3035 - anInt1213 = buffer.getUnsignedByte(); 3036 - if (anInt1213 == currentTabId) { 3037 - if (anInt1213 == 3) 3037 + if (opcode == FLASH_SIDEBAR_ICON) { 3038 + flashingSidebarId = buffer.getUnsignedByte(); 3039 + if (flashingSidebarId == currentTabId) { 3040 + if (flashingSidebarId == 3) 3038 3041 currentTabId = 1; 3039 3042 else 3040 3043 currentTabId = 3; ··· 3043 3046 opcode = -1; 3044 3047 return true; 3045 3048 } 3046 - if (opcode == 148) { 3049 + if (opcode == RESET_CUTSCENE_CAMERA) { 3047 3050 cutsceneActive = false; 3048 3051 for (int j9 = 0; j9 < 5; j9++) 3049 3052 customCameraActive[j9] = false; ··· 3051 3054 opcode = -1; 3052 3055 return true; 3053 3056 } 3054 - if (opcode == 126) { 3057 + if (opcode == UPDATE_MEMBERSHIP_AND_WORLD_INDEX) { 3055 3058 playerMembers = buffer.getUnsignedByte(); 3056 3059 thisPlayerServerId = buffer.getUnsignedShortLE(); 3057 3060 opcode = -1; 3058 3061 return true; 3059 3062 } 3060 - if (opcode == 75) { 3063 + if (opcode == SEND_REFERENCE_POSITION) { 3061 3064 placementX = buffer.getUnsignedInvertedByte(); 3062 3065 placementY = buffer.getUnsignedPostNegativeOffsetByte(); 3063 3066 opcode = -1; 3064 3067 return true; 3065 3068 } 3066 - if (opcode == 253) { // open fullscreen interface 3069 + if (opcode == 253) { // ??? open some interface 3067 3070 int k9 = buffer.getUnsignedShortLE(); 3068 3071 int k15 = buffer.getUnsignedNegativeOffsetShortBE(); 3069 3072 method112((byte) 36, k15); ··· 3094 3097 opcode = -1; 3095 3098 return true; 3096 3099 } 3097 - if (opcode == 251) { 3100 + if (opcode == UPDATE_FRIEND_LIST_STATUS) { 3098 3101 friendListStatus = buffer.getUnsignedByte(); 3099 3102 redrawTabArea = true; 3100 3103 opcode = -1; 3101 3104 return true; 3102 3105 } 3103 - if (opcode == 18) { 3106 + if (opcode == 18) { // ??? interface setting something 3104 3107 int l9 = buffer.getUnsignedShortBE(); 3105 3108 int interfaceId = buffer.getUnsignedNegativeOffsetShortBE(); 3106 3109 int l21 = buffer.getUnsignedShortLE(); ··· 3108 3111 opcode = -1; 3109 3112 return true; 3110 3113 } 3111 - if (opcode == 90) { // player update 3114 + if (opcode == PLAYER_UPDATING) { 3112 3115 updatePlayers(packetSize, buffer); 3113 3116 aBoolean1209 = false; 3114 3117 opcode = -1; 3115 3118 return true; 3116 3119 } 3117 - if (opcode == 113) { 3118 - for (int i10 = 0; i10 < widgetSettings.length; i10++) 3119 - if (widgetSettings[i10] != anIntArray1005[i10]) { 3120 - widgetSettings[i10] = anIntArray1005[i10]; 3121 - updateVarp(0, i10); 3120 + if (opcode == RESET_INTERFACE_SETTINGS) { 3121 + for (int i = 0; i < widgetSettings.length; i++) 3122 + if (widgetSettings[i] != anIntArray1005[i]) { 3123 + widgetSettings[i] = anIntArray1005[i]; 3124 + updateVarp(0, i); 3122 3125 redrawTabArea = true; 3123 3126 } 3124 3127 3125 3128 opcode = -1; 3126 3129 return true; 3127 3130 } 3128 - if (opcode == 232) { // update interface string? 3129 - int j10 = buffer.getUnsignedNegativeOffsetShortLE(); 3130 - String s6 = buffer.getString(); 3131 - Widget.forId(j10).disabledText = s6; 3132 - if (Widget.forId(j10).parentId == tabInterfaceIDs[currentTabId]) 3131 + if (opcode == UPDATE_INTERFACE_STRING) { 3132 + int interfaceId = buffer.getUnsignedNegativeOffsetShortLE(); 3133 + String newText = buffer.getString(); 3134 + Widget.forId(interfaceId).disabledText = newText; 3135 + if (Widget.forId(interfaceId).parentId == tabInterfaceIDs[currentTabId]) 3133 3136 redrawTabArea = true; 3134 3137 opcode = -1; 3135 3138 return true; 3136 3139 } 3137 - if (opcode == 200) { 3140 + if (opcode == UPDATE_INTERFACE_SCROLL_POSITION) { 3138 3141 int interfaceId = buffer.getUnsignedShortBE(); 3139 3142 int scrollPosition = buffer.getUnsignedNegativeOffsetShortLE(); 3140 3143 Widget widget = Widget.forId(interfaceId); ··· 4963 4966 } 4964 4967 4965 4968 if (onDemandRequester.requestFails > 3) { 4966 - method19("ondemand"); 4969 + openErrorWebPage("ondemand"); 4967 4970 return; 4968 4971 } 4969 4972 } ··· 4990 4993 } 4991 4994 4992 4995 if (onDemandRequester.requestFails > 3) { 4993 - method19("ondemand"); 4996 + openErrorWebPage("ondemand"); 4994 4997 return; 4995 4998 } 4996 4999 } ··· 6023 6026 renderMinimap(); 6024 6027 aClass18_1157.drawGraphics(550, 4, super.gameGraphics); 6025 6028 } 6026 - if (anInt1213 != -1) 6029 + if (flashingSidebarId != -1) 6027 6030 drawTabIcons = true; 6028 6031 if (drawTabIcons) { 6029 - if (anInt1213 != -1 && anInt1213 == currentTabId) { 6030 - anInt1213 = -1; 6032 + if (flashingSidebarId != -1 && flashingSidebarId == currentTabId) { 6033 + flashingSidebarId = -1; 6031 6034 outBuffer.putOpcode(119); 6032 6035 outBuffer.putByte(currentTabId); 6033 6036 } ··· 6051 6054 if (currentTabId == 6) 6052 6055 aClass50_Sub1_Sub1_Sub3_883.drawImage(209, 9); 6053 6056 } 6054 - if (tabInterfaceIDs[0] != -1 && (anInt1213 != 0 || pulseCycle % 20 < 10)) 6057 + if (tabInterfaceIDs[0] != -1 && (flashingSidebarId != 0 || pulseCycle % 20 < 10)) 6055 6058 tabIcon[0].drawImage(29, 13); 6056 - if (tabInterfaceIDs[1] != -1 && (anInt1213 != 1 || pulseCycle % 20 < 10)) 6059 + if (tabInterfaceIDs[1] != -1 && (flashingSidebarId != 1 || pulseCycle % 20 < 10)) 6057 6060 tabIcon[1].drawImage(53, 11); 6058 - if (tabInterfaceIDs[2] != -1 && (anInt1213 != 2 || pulseCycle % 20 < 10)) 6061 + if (tabInterfaceIDs[2] != -1 && (flashingSidebarId != 2 || pulseCycle % 20 < 10)) 6059 6062 tabIcon[2].drawImage(82, 11); 6060 - if (tabInterfaceIDs[3] != -1 && (anInt1213 != 3 || pulseCycle % 20 < 10)) 6063 + if (tabInterfaceIDs[3] != -1 && (flashingSidebarId != 3 || pulseCycle % 20 < 10)) 6061 6064 tabIcon[3].drawImage(115, 12); 6062 - if (tabInterfaceIDs[4] != -1 && (anInt1213 != 4 || pulseCycle % 20 < 10)) 6065 + if (tabInterfaceIDs[4] != -1 && (flashingSidebarId != 4 || pulseCycle % 20 < 10)) 6063 6066 tabIcon[4].drawImage(153, 13); 6064 - if (tabInterfaceIDs[5] != -1 && (anInt1213 != 5 || pulseCycle % 20 < 10)) 6067 + if (tabInterfaceIDs[5] != -1 && (flashingSidebarId != 5 || pulseCycle % 20 < 10)) 6065 6068 tabIcon[5].drawImage(180, 11); 6066 - if (tabInterfaceIDs[6] != -1 && (anInt1213 != 6 || pulseCycle % 20 < 10)) 6069 + if (tabInterfaceIDs[6] != -1 && (flashingSidebarId != 6 || pulseCycle % 20 < 10)) 6067 6070 tabIcon[6].drawImage(208, 13); 6068 6071 } 6069 6072 aClass18_1110.drawGraphics(516, 160, super.gameGraphics); ··· 6086 6089 if (currentTabId == 13) 6087 6090 aClass50_Sub1_Sub1_Sub3_986.drawImage(229, 0); 6088 6091 } 6089 - if (tabInterfaceIDs[8] != -1 && (anInt1213 != 8 || pulseCycle % 20 < 10)) 6092 + if (tabInterfaceIDs[8] != -1 && (flashingSidebarId != 8 || pulseCycle % 20 < 10)) 6090 6093 tabIcon[7].drawImage(74, 2); 6091 - if (tabInterfaceIDs[9] != -1 && (anInt1213 != 9 || pulseCycle % 20 < 10)) 6094 + if (tabInterfaceIDs[9] != -1 && (flashingSidebarId != 9 || pulseCycle % 20 < 10)) 6092 6095 tabIcon[8].drawImage(102, 3); 6093 - if (tabInterfaceIDs[10] != -1 && (anInt1213 != 10 || pulseCycle % 20 < 10)) 6096 + if (tabInterfaceIDs[10] != -1 && (flashingSidebarId != 10 || pulseCycle % 20 < 10)) 6094 6097 tabIcon[9].drawImage(137, 4); 6095 - if (tabInterfaceIDs[11] != -1 && (anInt1213 != 11 || pulseCycle % 20 < 10)) 6098 + if (tabInterfaceIDs[11] != -1 && (flashingSidebarId != 11 || pulseCycle % 20 < 10)) 6096 6099 tabIcon[10].drawImage(174, 2); 6097 - if (tabInterfaceIDs[12] != -1 && (anInt1213 != 12 || pulseCycle % 20 < 10)) 6100 + if (tabInterfaceIDs[12] != -1 && (flashingSidebarId != 12 || pulseCycle % 20 < 10)) 6098 6101 tabIcon[11].drawImage(201, 2); 6099 - if (tabInterfaceIDs[13] != -1 && (anInt1213 != 13 || pulseCycle % 20 < 10)) 6102 + if (tabInterfaceIDs[13] != -1 && (flashingSidebarId != 13 || pulseCycle % 20 < 10)) 6100 6103 tabIcon[12].drawImage(226, 2); 6101 6104 } 6102 6105 aClass18_1109.drawGraphics(496, 466, super.gameGraphics); ··· 6167 6170 privilege = 2; 6168 6171 } 6169 6172 6170 - if ((type == 3 || type == 7) && (type == 7 || privateChatMode == 0 || privateChatMode == 1 && method148(13292, name))) { 6173 + if ((type == 3 || type == 7) && (type == 7 || privateChatMode == 0 || privateChatMode == 1 && hasFriend(name))) { 6171 6174 int y = 329 - line * 13; 6172 6175 int x = 4; 6173 6176 ··· 6481 6484 messagePromptRaised = false; 6482 6485 clickToContinueString = null; 6483 6486 anInt1319 = 0; 6484 - anInt1213 = -1; 6487 + flashingSidebarId = -1; 6485 6488 characterEditChangeGenger = true; 6486 6489 6487 6490 method25(); ··· 7004 7007 line++; 7005 7008 } 7006 7009 7007 - if ((type == 1 || type == 2) && (type == 1 || publicChatMode == 0 || publicChatMode == 1 && method148(13292, name))) { 7010 + if ((type == 1 || type == 2) && (type == 1 || publicChatMode == 0 || publicChatMode == 1 && hasFriend(name))) { 7008 7011 if (y > 0 && y < 110) { 7009 7012 int x = 4; 7010 7013 ··· 7029 7032 } 7030 7033 7031 7034 if ((type == 3 || type == 7) && anInt1223 == 0 7032 - && (type == 7 || privateChatMode == 0 || privateChatMode == 1 && method148(13292, name))) { 7035 + && (type == 7 || privateChatMode == 0 || privateChatMode == 1 && hasFriend(name))) { 7033 7036 if (y > 0 && y < 110) { 7034 7037 int x = 4; 7035 7038 ··· 7057 7060 line++; 7058 7061 } 7059 7062 7060 - if (type == 4 && (tradeMode == 0 || tradeMode == 1 && method148(13292, name))) { 7063 + if (type == 4 && (tradeMode == 0 || tradeMode == 1 && hasFriend(name))) { 7061 7064 if (y > 0 && y < 110) 7062 7065 typeFace.drawString(name + " " + chatMessages[i], 4, y, 0x800080); 7063 7066 ··· 7080 7083 line++; 7081 7084 } 7082 7085 7083 - if (type == 8 && (tradeMode == 0 || tradeMode == 1 && method148(13292, name))) { 7086 + if (type == 8 && (tradeMode == 0 || tradeMode == 1 && hasFriend(name))) { 7084 7087 if (y > 0 && y < 110) 7085 7088 typeFace.drawString(name + " " + chatMessages[i], 4, y, 0x7e3200); 7086 7089 ··· 8525 8528 if (s != null && s.startsWith("@cr2@")) { 8526 8529 s = s.substring(5); 8527 8530 } 8528 - if ((l == 3 || l == 7) && (l == 7 || privateChatMode == 0 || privateChatMode == 1 && method148(13292, s))) { 8531 + if ((l == 3 || l == 7) && (l == 7 || privateChatMode == 0 || privateChatMode == 1 && hasFriend(s))) { 8529 8532 int i1 = 329 - j * 13; 8530 8533 if (super.mouseX > 4 && super.mouseY - 4 > i1 - 10 && super.mouseY - 4 <= i1 + 3) { 8531 8534 int j1 = fontNormal.getStringEffectWidth("From: " + s + chatMessages[k]) + 25; ··· 8589 8592 } 8590 8593 if (j1 == 0) 8591 8594 l++; 8592 - if ((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && method148(13292, s))) { 8595 + if ((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && hasFriend(s))) { 8593 8596 if (k > k1 - 14 && k <= k1 && !s.equals(localPlayer.playerName)) { 8594 8597 if (playerRights >= 1) { 8595 8598 menuActionTexts[menuActionRow] = "Report abuse @whi@" + s; ··· 8606 8609 l++; 8607 8610 } 8608 8611 if ((j1 == 3 || j1 == 7) && anInt1223 == 0 8609 - && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && method148(13292, s))) { 8612 + && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && hasFriend(s))) { 8610 8613 if (k > k1 - 14 && k <= k1) { 8611 8614 if (playerRights >= 1) { 8612 8615 menuActionTexts[menuActionRow] = "Report abuse @whi@" + s; ··· 8622 8625 } 8623 8626 l++; 8624 8627 } 8625 - if (j1 == 4 && (tradeMode == 0 || tradeMode == 1 && method148(13292, s))) { 8628 + if (j1 == 4 && (tradeMode == 0 || tradeMode == 1 && hasFriend(s))) { 8626 8629 if (k > k1 - 14 && k <= k1) { 8627 8630 menuActionTexts[menuActionRow] = "Accept trade @whi@" + s; 8628 8631 menuActionTypes[menuActionRow] = 544; ··· 8632 8635 } 8633 8636 if ((j1 == 5 || j1 == 6) && anInt1223 == 0 && privateChatMode < 2) 8634 8637 l++; 8635 - if (j1 == 8 && (tradeMode == 0 || tradeMode == 1 && method148(13292, s))) { 8638 + if (j1 == 8 && (tradeMode == 0 || tradeMode == 1 && hasFriend(s))) { 8636 8639 if (k > k1 - 14 && k <= k1) { 8637 8640 menuActionTexts[menuActionRow] = "Accept challenge @whi@" + s; 8638 8641 menuActionTypes[menuActionRow] = 695; ··· 9831 9834 } 9832 9835 if (((Actor) (obj)).forcedChat != null 9833 9836 && (i >= localPlayerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 9834 - && method148(13292, ((Player) obj).playerName))) { 9837 + && hasFriend(((Player) obj).playerName))) { 9835 9838 method136(((Actor) (obj)), false, ((Actor) (obj)).modelHeight); 9836 9839 if (anInt932 > -1 && anInt939 < anInt940) { 9837 9840 anIntArray944[anInt939] = fontBold.getDisplayedWidth(((Actor) (obj)).forcedChat ··· 10493 10496 } 10494 10497 10495 10498 private void parsePlacementPacket(Buffer buf, int opcode) { 10496 - if (opcode == 203) { 10497 - int objectId = buf.getUnsignedShortBE(); 10498 - int j3 = buf.getUnsignedByte(); 10499 - int modelType = j3 >> 2; 10500 - int modelOrientation = j3 & 3; 10501 - int type = objectTypes[modelType]; 10499 + if (opcode == 203) { // ??? something with object spawning? 10500 + int landscapeObjectId = buf.getUnsignedShortBE(); 10501 + int landscapeObjectData = buf.getUnsignedByte(); 10502 + int typeIndex = landscapeObjectData >> 2; 10503 + int rotation = landscapeObjectData & 3; 10504 + int type = objectTypes[typeIndex]; 10502 10505 byte byte0 = buf.getInvertedByte(); 10503 10506 int offset = buf.getUnsignedPostNegativeOffsetByte(); 10504 10507 int x = placementX + (offset >> 4 & 7); 10505 10508 int y = placementY + (offset & 7); 10506 10509 byte byte1 = buf.getPostNegativeOffsetByte(); 10507 10510 int duration = buf.getUnsignedNegativeOffsetShortBE(); 10508 - int id = buf.getUnsignedShortLE(); 10511 + int playerId = buf.getUnsignedShortLE(); 10509 10512 byte byte2 = buf.getByte(); 10510 10513 byte byte3 = buf.getPostNegativeOffsetByte(); 10511 10514 int startDelay = buf.getUnsignedShortBE(); 10512 10515 Player player; 10513 - if (id == thisPlayerServerId) 10516 + if (playerId == thisPlayerServerId) 10514 10517 player = localPlayer; 10515 10518 else 10516 - player = players[id]; 10519 + player = players[playerId]; 10517 10520 if (player != null) { 10518 - GameObjectDefinition object = GameObjectDefinition.getDefinition(objectId); 10521 + GameObjectDefinition object = GameObjectDefinition.getDefinition(landscapeObjectId); 10519 10522 int vertexHeight = this.intGroundArray[plane][x][y]; 10520 10523 int vertexHeightRight = this.intGroundArray[plane][x + 1][y]; 10521 10524 int vertexHeightTopRight = this.intGroundArray[plane][x + 1][y + 1]; 10522 10525 int vertexHeightTop = this.intGroundArray[plane][x][y + 1]; 10523 - Model model = object.getGameObjectModel(modelType, modelOrientation, vertexHeight, vertexHeightRight, vertexHeightTopRight, vertexHeightTop, -1); 10526 + Model model = object.getGameObjectModel(typeIndex, rotation, vertexHeight, vertexHeightRight, vertexHeightTopRight, vertexHeightTop, -1); 10524 10527 if (model != null) { 10525 10528 createObjectSpawnRequest(plane, x, 0, duration + 1, 0, -1, startDelay + 1, type, y); 10526 10529 player.objectAppearanceStartTick = startDelay + pulseCycle; ··· 10528 10531 player.playerModel = model; 10529 10532 int i23 = object.sizeX; 10530 10533 int j23 = object.sizeY; 10531 - if (modelOrientation == 1 || modelOrientation == 3) { 10534 + if (rotation == 1 || rotation == 3) { 10532 10535 i23 = object.sizeY; 10533 10536 j23 = object.sizeX; 10534 10537 } ··· 10553 10556 } 10554 10557 } 10555 10558 } 10556 - if (opcode == 106) { // add ground item dropped by player 10559 + if (opcode == SET_PLAYER_GROUND_ITEM) { 10557 10560 int offset = buf.getUnsignedPostNegativeOffsetByte(); 10558 10561 int x = placementX + (offset >> 4 & 7); 10559 10562 int y = placementY + (offset & 7); 10560 10563 int amount = buf.getUnsignedNegativeOffsetShortLE(); 10561 - int id = buf.getUnsignedNegativeOffsetShortBE(); 10564 + int itemId = buf.getUnsignedNegativeOffsetShortBE(); 10562 10565 int playerId = buf.getUnsignedNegativeOffsetShortBE(); 10563 10566 if (x >= 0 && y >= 0 && x < 104 && y < 104 && playerId != thisPlayerServerId) { 10564 10567 Item item = new Item(); 10565 - item.itemId = id; 10568 + item.itemId = itemId; 10566 10569 item.itemCount = amount; 10567 10570 if (groundItems[plane][x][y] == null) 10568 10571 groundItems[plane][x][y] = new LinkedList(); ··· 10571 10574 } 10572 10575 return; 10573 10576 } 10574 - if (opcode == 142) { 10575 - int i1 = buf.getUnsignedShortBE(); 10576 - int l3 = buf.getUnsignedPostNegativeOffsetByte(); 10577 - int k6 = l3 >> 2; 10578 - int j9 = l3 & 3; 10579 - int i12 = objectTypes[k6]; 10580 - int j14 = buf.getUnsignedByte(); 10581 - int x = placementX + (j14 >> 4 & 7); 10582 - int y = placementY + (j14 & 7); 10577 + if (opcode == 142) { // object animation??? 10578 + int animationId = buf.getUnsignedShortBE(); 10579 + int landscapeObjectData = buf.getUnsignedPostNegativeOffsetByte(); 10580 + int typeIndex = landscapeObjectData >> 2; 10581 + int rotation = landscapeObjectData & 3; 10582 + int type = objectTypes[typeIndex]; 10583 + int offset = buf.getUnsignedByte(); 10584 + int x = placementX + (offset >> 4 & 7); 10585 + int y = placementY + (offset & 7); 10583 10586 if (x >= 0 && y >= 0 && x < 103 && y < 103) { 10584 - int l18 = intGroundArray[plane][x][y]; 10585 - int j19 = intGroundArray[plane][x + 1][y]; 10586 - int i20 = intGroundArray[plane][x + 1][y + 1]; 10587 - int l20 = intGroundArray[plane][x][y + 1]; 10588 - if (i12 == 0) { 10589 - Wall wall = currentScene.method263(plane, 17734, x, y); 10587 + int vertixHeight = intGroundArray[plane][x][y]; 10588 + int vertixHeightRight = intGroundArray[plane][x + 1][y]; 10589 + int vertixHeightTopRight = intGroundArray[plane][x + 1][y + 1]; 10590 + int vertixHeightTop = intGroundArray[plane][x][y + 1]; 10591 + if (type == 0) { 10592 + Wall wall = currentScene.getWallObject(plane, x, y); 10590 10593 if (wall != null) { 10591 - int k21 = wall.uid >> 14 & 0x7fff; 10592 - if (k6 == 2) { 10593 - wall.primary = new GameObject(k21, 4 + j9, 2, j19, i20, l18, l20, i1, 10594 + int landscapeObjectId = wall.uid >> 14 & 0x7fff; 10595 + if (typeIndex == 2) { 10596 + wall.primary = new GameObject(landscapeObjectId, 4 + rotation, 2, vertixHeightRight, vertixHeightTopRight, vertixHeight, vertixHeightTop, animationId, 10594 10597 false); 10595 - wall.secondary = new GameObject(k21, j9 + 1 & 3, 2, j19, i20, l18, l20, i1, 10598 + wall.secondary = new GameObject(landscapeObjectId, rotation + 1 & 3, 2, vertixHeightRight, vertixHeightTopRight, vertixHeight, vertixHeightTop, animationId, 10596 10599 false); 10597 10600 } else { 10598 - wall.primary = new GameObject(k21, j9, k6, j19, i20, l18, l20, i1, 10601 + wall.primary = new GameObject(landscapeObjectId, rotation, typeIndex, vertixHeightRight, vertixHeightTopRight, vertixHeight, vertixHeightTop, animationId, 10599 10602 false); 10600 10603 } 10601 10604 } 10602 10605 } 10603 - if (i12 == 1) { 10604 - WallDecoration wallDecoration = currentScene.method264(plane, y, x, false); 10606 + if (type == 1) { 10607 + WallDecoration wallDecoration = currentScene.getWallDecoration(plane, y, x); 10605 10608 if (wallDecoration != null) 10606 - wallDecoration.renderable = new GameObject(wallDecoration.uid >> 14 & 0x7fff, 0, 4, j19, i20, l18, l20, i1, 10609 + wallDecoration.renderable = new GameObject(wallDecoration.uid >> 14 & 0x7fff, 0, 4, vertixHeightRight, vertixHeightTopRight, vertixHeight, vertixHeightTop, animationId, 10607 10610 false); 10608 10611 } 10609 - if (i12 == 2) { 10610 - InteractiveObject interactiveObject = currentScene.method265(x, (byte) 32, y, plane); 10611 - if (k6 == 11) 10612 - k6 = 10; 10612 + if (type == 2) { 10613 + InteractiveObject interactiveObject = currentScene.method265(x, y, plane); 10614 + if (typeIndex == 11) 10615 + typeIndex = 10; 10613 10616 if (interactiveObject != null) 10614 - interactiveObject.renderable = new GameObject(interactiveObject.uid >> 14 & 0x7fff, j9, k6, j19, i20, l18, l20, i1, 10617 + interactiveObject.renderable = new GameObject(interactiveObject.uid >> 14 & 0x7fff, rotation, typeIndex, vertixHeightRight, vertixHeightTopRight, vertixHeight, vertixHeightTop, animationId, 10615 10618 false); 10616 10619 } 10617 - if (i12 == 3) { 10618 - FloorDecoration floorDecoration = currentScene.method266(plane, y, 0, x); 10620 + if (type == 3) { 10621 + FloorDecoration floorDecoration = currentScene.getFloorDecoration(plane, y, x); 10619 10622 if (floorDecoration != null) 10620 - floorDecoration.renderable = new GameObject(floorDecoration.uid >> 14 & 0x7fff, j9, 22, j19, i20, l18, l20, i1, 10623 + floorDecoration.renderable = new GameObject(floorDecoration.uid >> 14 & 0x7fff, rotation, 22, vertixHeightRight, vertixHeightTopRight, vertixHeight, vertixHeightTop, animationId, 10621 10624 false); 10622 10625 } 10623 10626 } 10624 10627 return; 10625 10628 } 10626 - if (opcode == 107) { // add ground item (dropped by npc or "auto spawn") 10627 - int id = buf.getUnsignedShortBE(); 10629 + if (opcode == SET_GROUND_ITEM) { 10630 + int itemId = buf.getUnsignedShortBE(); 10628 10631 int offset = buf.getUnsignedInvertedByte(); 10629 10632 int x = placementX + (offset >> 4 & 7); 10630 10633 int y = placementY + (offset & 7); 10631 10634 int amount = buf.getUnsignedNegativeOffsetShortBE(); 10632 10635 if (x >= 0 && y >= 0 && x < 104 && y < 104) { 10633 10636 Item item = new Item(); 10634 - item.itemId = id; 10637 + item.itemId = itemId; 10635 10638 item.itemCount = amount; 10636 10639 if (groundItems[plane][x][y] == null) 10637 10640 groundItems[plane][x][y] = new LinkedList(); ··· 10640 10643 } 10641 10644 return; 10642 10645 } 10643 - if (opcode == 121) { // update amount of ground item 10646 + if (opcode == UPDATE_GROUND_ITEM_AMOUNT) { 10644 10647 int offset = buf.getUnsignedByte(); 10645 10648 int x = placementX + (offset >> 4 & 7); 10646 10649 int y = placementY + (offset & 7); 10647 - int id = buf.getUnsignedShortBE(); 10648 - int amount = buf.getUnsignedShortBE(); 10650 + int itemId = buf.getUnsignedShortBE(); 10651 + int oldAmount = buf.getUnsignedShortBE(); 10649 10652 int newAmount = buf.getUnsignedShortBE(); 10650 10653 if (x >= 0 && y >= 0 && x < 104 && y < 104) { 10651 10654 LinkedList list = groundItems[plane][x][y]; 10652 10655 if (list != null) { 10653 10656 for (Item item = (Item) list.first(); item != null; item = (Item) list.next()) { 10654 - if (item.itemId != (id & 0x7fff) || item.itemCount != amount) 10657 + if (item.itemId != (itemId & 0x7fff) || item.itemCount != oldAmount) 10655 10658 continue; 10656 10659 item.itemCount = newAmount; 10657 10660 break; ··· 10662 10665 } 10663 10666 return; 10664 10667 } 10665 - if (opcode == 181) { 10668 + if (opcode == SHOW_PROJECTILE) { 10666 10669 int offset = buf.getUnsignedByte(); 10667 - int x = placementX + (offset >> 4 & 7); 10668 - int y = placementY + (offset & 7); 10669 - int i10 = x + buf.getByte(); 10670 - int l12 = y + buf.getByte(); 10671 - int l14 = buf.getShortBE(); 10672 - int k16 = buf.getUnsignedShortBE(); 10673 - int i18 = buf.getUnsignedByte() * 4; 10674 - int i19 = buf.getUnsignedByte() * 4; 10675 - int k19 = buf.getUnsignedShortBE(); 10676 - int j20 = buf.getUnsignedShortBE(); 10677 - int i21 = buf.getUnsignedByte(); 10678 - int j21 = buf.getUnsignedByte(); 10679 - if (x >= 0 && y >= 0 && x < 104 && y < 104 && i10 >= 0 && l12 >= 0 && i10 < 104 && l12 < 104 10680 - && k16 != 65535) { 10681 - x = x * 128 + 64; 10682 - y = y * 128 + 64; 10683 - i10 = i10 * 128 + 64; 10684 - l12 = l12 * 128 + 64; 10685 - Projectile class50_sub1_sub4_sub2 = new Projectile(plane, i19, j21, y, 10686 - k16, j20 + pulseCycle, i21, l14, getFloorDrawHeight(plane, x, y) - i18, x, k19 + pulseCycle); 10687 - class50_sub1_sub4_sub2.trackTarget(i10, l12, getFloorDrawHeight(plane, i10, l12) - i19, k19 10670 + int startX = placementX + (offset >> 4 & 7); 10671 + int startY = placementY + (offset & 7); 10672 + int endX = startX + buf.getByte(); 10673 + int endY = startY + buf.getByte(); 10674 + int entityIndex = buf.getShortBE(); 10675 + int graphicsId = buf.getUnsignedShortBE(); 10676 + int startHeight = buf.getUnsignedByte() * 4; 10677 + int endHeight = buf.getUnsignedByte() * 4; 10678 + int delay = buf.getUnsignedShortBE(); 10679 + int speed = buf.getUnsignedShortBE(); 10680 + int startSlope = buf.getUnsignedByte(); 10681 + int startDistance = buf.getUnsignedByte(); 10682 + if (startX >= 0 && startY >= 0 && startX < 104 && startY < 104 && endX >= 0 && endY >= 0 && endX < 104 && endY < 104 10683 + && graphicsId != 65535) { 10684 + startX = startX * 128 + 64; 10685 + startY = startY * 128 + 64; 10686 + endX = endX * 128 + 64; 10687 + endY = endY * 128 + 64; 10688 + Projectile projectile = new Projectile(plane, endHeight, startDistance, startY, 10689 + graphicsId, speed + pulseCycle, startSlope, entityIndex, getFloorDrawHeight(plane, startX, startY) - startHeight, startX, delay + pulseCycle); 10690 + projectile.trackTarget(endX, endY, getFloorDrawHeight(plane, endX, endY) - endHeight, delay 10688 10691 + pulseCycle); 10689 - aClass6_1282.pushBack(class50_sub1_sub4_sub2); 10692 + aClass6_1282.pushBack(projectile); 10690 10693 } 10691 10694 return; 10692 10695 } 10693 - if (opcode == 41) { 10696 + if (opcode == PLAY_POSITION_SOUND) { 10694 10697 int offset = buf.getUnsignedByte(); 10695 10698 int x = placementX + (offset >> 4 & 7); 10696 10699 int y = placementY + (offset & 7); 10697 10700 int soundId = buf.getUnsignedShortBE(); 10698 - int i13 = buf.getUnsignedByte(); 10699 - int i15 = i13 >> 4 & 0xf; 10700 - int type = i13 & 7; 10701 - if (localPlayer.pathX[0] >= x - i15 10702 - && localPlayer.pathX[0] <= x + i15 10703 - && localPlayer.pathY[0] >= y - i15 10704 - && localPlayer.pathY[0] <= y + i15 && aBoolean1301 && !lowMemory 10701 + int soundData = buf.getUnsignedByte(); 10702 + int radius = soundData >> 4 & 0xf; 10703 + int type = soundData & 7; // what types exist? 10704 + if (localPlayer.pathX[0] >= x - radius 10705 + && localPlayer.pathX[0] <= x + radius 10706 + && localPlayer.pathY[0] >= y - radius 10707 + && localPlayer.pathY[0] <= y + radius && aBoolean1301 && !lowMemory 10705 10708 && currentSound < 50) { 10706 10709 sound[currentSound] = soundId; 10707 10710 soundType[currentSound] = type; ··· 10709 10712 currentSound++; 10710 10713 } 10711 10714 } 10712 - if (opcode == 59) { 10713 - int j2 = buf.getUnsignedByte(); 10714 - int i5 = placementX + (j2 >> 4 & 7); 10715 - int l7 = placementY + (j2 & 7); 10716 - int k10 = buf.getUnsignedShortBE(); 10717 - int j13 = buf.getUnsignedByte(); 10718 - int j15 = buf.getUnsignedShortBE(); 10719 - if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) { 10720 - i5 = i5 * 128 + 64; 10721 - l7 = l7 * 128 + 64; 10722 - GameAnimableObject gameAnimableObject = new GameAnimableObject(plane, pulseCycle, j15, k10, getFloorDrawHeight(plane, i5, l7) - j13, l7, i5); 10715 + if (opcode == SHOW_STILL_GRAPHICS) { 10716 + int offset = buf.getUnsignedByte(); 10717 + int x = placementX + (offset >> 4 & 7); 10718 + int y = placementY + (offset & 7); 10719 + int graphicsId = buf.getUnsignedShortBE(); 10720 + int graphicsHeight = buf.getUnsignedByte(); 10721 + int delay = buf.getUnsignedShortBE(); 10722 + if (x >= 0 && y >= 0 && x < 104 && y < 104) { 10723 + x = x * 128 + 64; 10724 + y = y * 128 + 64; 10725 + GameAnimableObject gameAnimableObject = new GameAnimableObject(plane, pulseCycle, delay, graphicsId, getFloorDrawHeight(plane, x, y) - graphicsHeight, y, x); 10723 10726 aClass6_1210.pushBack(gameAnimableObject); 10724 10727 } 10725 10728 return; 10726 10729 } 10727 - if (opcode == 152) { 10728 - int k2 = buf.getUnsignedInvertedByte(); 10729 - int j5 = k2 >> 2; 10730 - int i8 = k2 & 3; 10731 - int l10 = objectTypes[j5]; 10732 - int k13 = buf.getUnsignedNegativeOffsetShortLE(); 10733 - int k15 = buf.getUnsignedPostNegativeOffsetByte(); 10734 - int i17 = placementX + (k15 >> 4 & 7); 10735 - int j18 = placementY + (k15 & 7); 10736 - if (i17 >= 0 && j18 >= 0 && i17 < 104 && j18 < 104) 10737 - createObjectSpawnRequest(plane, i17, i8, -1, j5, k13, 0, l10, j18); 10730 + if (opcode == SET_LANDSCAPE_OBJECT) { 10731 + int landscapeObjectData = buf.getUnsignedInvertedByte(); 10732 + int typeIndex = landscapeObjectData >> 2; 10733 + int rotation = landscapeObjectData & 3; 10734 + int type = objectTypes[typeIndex]; 10735 + int landscapeObjectId = buf.getUnsignedNegativeOffsetShortLE(); 10736 + int offset = buf.getUnsignedPostNegativeOffsetByte(); 10737 + int x = placementX + (offset >> 4 & 7); 10738 + int y = placementY + (offset & 7); 10739 + if (x >= 0 && y >= 0 && x < 104 && y < 104) 10740 + createObjectSpawnRequest(plane, x, rotation, -1, typeIndex, landscapeObjectId, 0, type, y); 10738 10741 return; 10739 10742 } 10740 - if (opcode == 208) { // remove ground item 10741 - int id = buf.getUnsignedNegativeOffsetShortBE(); 10743 + if (opcode == REMOVE_GROUND_ITEM) { 10744 + int itemId = buf.getUnsignedNegativeOffsetShortBE(); 10742 10745 int offset = buf.getUnsignedPostNegativeOffsetByte(); 10743 10746 int x = placementX + (offset >> 4 & 7); 10744 10747 int y = placementY + (offset & 7); ··· 10746 10749 LinkedList list = groundItems[plane][x][y]; 10747 10750 if (list != null) { 10748 10751 for (Item item = (Item) list.first(); item != null; item = (Item) list.next()) { 10749 - if (item.itemId != (id & 0x7fff)) 10752 + if (item.itemId != (itemId & 0x7fff)) 10750 10753 continue; 10751 10754 item.remove(); 10752 10755 break; ··· 10759 10762 } 10760 10763 return; 10761 10764 } 10762 - if (opcode == 88) { 10763 - int positionOffset = buf.getUnsignedPreNegativeOffsetByte(); 10764 - int x = placementX + (positionOffset >> 4 & 7); 10765 - int y = placementY + (positionOffset & 7); 10766 - int data = buf.getUnsignedPreNegativeOffsetByte(); 10767 - int objectType = data >> 2; 10768 - int orientation = data & 3; 10769 - int type = objectTypes[objectType]; 10765 + if (opcode == REMOVE_LANDSCAPE_OBJECT) { 10766 + int offset = buf.getUnsignedPreNegativeOffsetByte(); 10767 + int x = placementX + (offset >> 4 & 7); 10768 + int y = placementY + (offset & 7); 10769 + int landscapeObjectData = buf.getUnsignedPreNegativeOffsetByte(); 10770 + int typeIndex = landscapeObjectData >> 2; 10771 + int rotation = landscapeObjectData & 3; 10772 + int type = objectTypes[typeIndex]; 10770 10773 if (x >= 0 && y >= 0 && x < 104 && y < 104) 10771 - createObjectSpawnRequest(plane, x, orientation, -1, objectType, -1, 0, type, y); 10774 + createObjectSpawnRequest(plane, x, rotation, -1, typeIndex, -1, 0, type, y); 10772 10775 } 10773 10776 } 10774 10777 ··· 10886 10889 10887 10890 private void prepareTitleBackground() { 10888 10891 byte abyte0[] = titleArchive.getFile("title.dat"); 10889 - ImageRGB class50_sub1_sub1_sub1 = new ImageRGB(abyte0, this); 10892 + ImageRGB imageRGB = new ImageRGB(abyte0, this); 10890 10893 flameLeftBackground.createRasterizer(); 10891 - class50_sub1_sub1_sub1.drawInverse(0, 0); 10894 + imageRGB.drawInverse(0, 0); 10892 10895 flameRightBackground.createRasterizer(); 10893 - class50_sub1_sub1_sub1.drawInverse(-637, 0); 10896 + imageRGB.drawInverse(-637, 0); 10894 10897 aClass18_1198.createRasterizer(); 10895 - class50_sub1_sub1_sub1.drawInverse(-128, 0); 10898 + imageRGB.drawInverse(-128, 0); 10896 10899 aClass18_1199.createRasterizer(); 10897 - class50_sub1_sub1_sub1.drawInverse(-202, -371); 10900 + imageRGB.drawInverse(-202, -371); 10898 10901 aClass18_1200.createRasterizer(); 10899 - class50_sub1_sub1_sub1.drawInverse(-202, -171); 10902 + imageRGB.drawInverse(-202, -171); 10900 10903 aClass18_1203.createRasterizer(); 10901 - class50_sub1_sub1_sub1.drawInverse(0, -265); 10904 + imageRGB.drawInverse(0, -265); 10902 10905 aClass18_1204.createRasterizer(); 10903 - class50_sub1_sub1_sub1.drawInverse(-562, -265); 10906 + imageRGB.drawInverse(-562, -265); 10904 10907 aClass18_1205.createRasterizer(); 10905 - class50_sub1_sub1_sub1.drawInverse(-128, -171); 10908 + imageRGB.drawInverse(-128, -171); 10906 10909 aClass18_1206.createRasterizer(); 10907 - class50_sub1_sub1_sub1.drawInverse(-562, -171); 10908 - int ai[] = new int[class50_sub1_sub1_sub1.width]; 10909 - for (int i = 0; i < class50_sub1_sub1_sub1.height; i++) { 10910 - for (int j = 0; j < class50_sub1_sub1_sub1.width; j++) 10911 - ai[j] = class50_sub1_sub1_sub1.pixels[(class50_sub1_sub1_sub1.width - j - 1) 10912 - + class50_sub1_sub1_sub1.width * i]; 10910 + imageRGB.drawInverse(-562, -171); 10911 + int ai[] = new int[imageRGB.width]; 10912 + for (int i = 0; i < imageRGB.height; i++) { 10913 + for (int j = 0; j < imageRGB.width; j++) 10914 + ai[j] = imageRGB.pixels[(imageRGB.width - j - 1) 10915 + + imageRGB.width * i]; 10913 10916 10914 - for (int l = 0; l < class50_sub1_sub1_sub1.width; l++) 10915 - class50_sub1_sub1_sub1.pixels[l + class50_sub1_sub1_sub1.width * i] = ai[l]; 10917 + for (int l = 0; l < imageRGB.width; l++) 10918 + imageRGB.pixels[l + imageRGB.width * i] = ai[l]; 10916 10919 10917 10920 } 10918 10921 10919 10922 flameLeftBackground.createRasterizer(); 10920 - class50_sub1_sub1_sub1.drawInverse(382, 0); 10923 + imageRGB.drawInverse(382, 0); 10921 10924 flameRightBackground.createRasterizer(); 10922 - class50_sub1_sub1_sub1.drawInverse(-255, 0); 10925 + imageRGB.drawInverse(-255, 0); 10923 10926 aClass18_1198.createRasterizer(); 10924 - class50_sub1_sub1_sub1.drawInverse(254, 0); 10927 + imageRGB.drawInverse(254, 0); 10925 10928 aClass18_1199.createRasterizer(); 10926 - class50_sub1_sub1_sub1.drawInverse(180, -371); 10929 + imageRGB.drawInverse(180, -371); 10927 10930 aClass18_1200.createRasterizer(); 10928 - class50_sub1_sub1_sub1.drawInverse(180, -171); 10931 + imageRGB.drawInverse(180, -171); 10929 10932 aClass18_1203.createRasterizer(); 10930 - class50_sub1_sub1_sub1.drawInverse(382, -265); 10933 + imageRGB.drawInverse(382, -265); 10931 10934 aClass18_1204.createRasterizer(); 10932 - class50_sub1_sub1_sub1.drawInverse(-180, -265); 10935 + imageRGB.drawInverse(-180, -265); 10933 10936 aClass18_1205.createRasterizer(); 10934 - class50_sub1_sub1_sub1.drawInverse(254, -171); 10937 + imageRGB.drawInverse(254, -171); 10935 10938 aClass18_1206.createRasterizer(); 10936 - class50_sub1_sub1_sub1.drawInverse(-180, -171); 10937 - class50_sub1_sub1_sub1 = new ImageRGB(titleArchive, "logo", 0); 10939 + imageRGB.drawInverse(-180, -171); 10940 + imageRGB = new ImageRGB(titleArchive, "logo", 0); 10938 10941 aClass18_1198.createRasterizer(); 10939 - class50_sub1_sub1_sub1.drawImage(382 - class50_sub1_sub1_sub1.width / 2 - 128, 18); 10940 - class50_sub1_sub1_sub1 = null; 10942 + imageRGB.drawImage(382 - imageRGB.width / 2 - 128, 18); 10943 + imageRGB = null; 10941 10944 abyte0 = null; 10942 10945 ai = null; 10943 10946 System.gc(); ··· 11046 11049 int k11 = 0; 11047 11050 if (itemSelected == 1 && anInt1147 == i3 && anInt1148 == child.id) 11048 11051 k11 = 0xffffff; 11049 - ImageRGB class50_sub1_sub1_sub1_2 = ItemDefinition.sprite( 11052 + ImageRGB imageRGB = ItemDefinition.sprite( 11050 11053 l10, child.itemAmounts[i3], k11); 11051 - if (class50_sub1_sub1_sub1_2 != null) { 11054 + if (imageRGB != null) { 11052 11055 if (activeInterfaceType != 0 && selectedInventorySlot == i3 && modifiedWidgetId == child.id) { 11053 11056 i7 = super.mouseX - anInt1114; 11054 11057 j8 = super.mouseY - anInt1115; ··· 11060 11063 i7 = 0; 11061 11064 j8 = 0; 11062 11065 } 11063 - class50_sub1_sub1_sub1_2.drawImageAlpha(i6 + i7, l6 + j8, 128); 11066 + imageRGB.drawImageAlpha(i6 + i7, l6 + j8, 128); 11064 11067 if (l6 + j8 < Rasterizer.topY && class13.scrollPosition > 0) { 11065 11068 int i12 = (tickDelta * (Rasterizer.topY - l6 - j8)) / 3; 11066 11069 if (i12 > tickDelta * 10) ··· 11081 11084 anInt1115 -= j12; 11082 11085 } 11083 11086 } else if (atInventoryInterfaceType != 0 && anInt1331 == i3 && anInt1330 == child.id) 11084 - class50_sub1_sub1_sub1_2.drawImageAlpha(i6, l6, 128); 11087 + imageRGB.drawImageAlpha(i6, l6, 128); 11085 11088 else 11086 - class50_sub1_sub1_sub1_2.drawImage(i6, l6); 11087 - if (class50_sub1_sub1_sub1_2.maxWidth == 33 || child.itemAmounts[i3] != 1) { 11089 + imageRGB.drawImage(i6, l6); 11090 + if (imageRGB.maxWidth == 33 || child.itemAmounts[i3] != 1) { 11088 11091 int k12 = child.itemAmounts[i3]; 11089 11092 fontSmall.drawString(getShortenedAmountText(k12), i6 + 1 + i7, l6 + 10 + j8, 0 11090 11093 ); ··· 11094 11097 } 11095 11098 } 11096 11099 } else if (child.images != null && i3 < 20) { 11097 - ImageRGB class50_sub1_sub1_sub1_1 = child.images[i3]; 11098 - if (class50_sub1_sub1_sub1_1 != null) 11099 - class50_sub1_sub1_sub1_1.drawImage(i6, l6); 11100 + ImageRGB imageRGB = child.images[i3]; 11101 + if (imageRGB != null) 11102 + imageRGB.drawImage(i6, l6); 11100 11103 } 11101 11104 i3++; 11102 11105 } ··· 11130 11133 Rasterizer.drawUnfilledRectangleAlpha(k2, l2, child.width, child.height, j3, 11131 11134 256 - (child.alpha & 0xff)); 11132 11135 } else if (child.type == 4) { 11133 - TypeFace class50_sub1_sub1_sub2 = child.typeFaces; 11136 + TypeFace typeFace = child.typeFaces; 11134 11137 String s = child.disabledText; 11135 11138 boolean flag1 = false; 11136 11139 if (anInt1106 == child.id || anInt1280 == child.id ··· 11158 11161 if (j4 == 49152) 11159 11162 j4 = 0xffffff; 11160 11163 } 11161 - for (int j7 = l2 + class50_sub1_sub1_sub2.characterDefaultHeight; s.length() > 0; j7 += class50_sub1_sub1_sub2.characterDefaultHeight) { 11164 + for (int j7 = l2 + typeFace.characterDefaultHeight; s.length() > 0; j7 += typeFace.characterDefaultHeight) { 11162 11165 if (s.indexOf("%") != -1) { 11163 11166 do { 11164 11167 int k8 = s.indexOf("%1"); ··· 11201 11204 s = ""; 11202 11205 } 11203 11206 if (child.typeFaceCentered) 11204 - class50_sub1_sub1_sub2.drawStringCenter(s3, k2 11207 + typeFace.drawStringCenter(s3, k2 11205 11208 + child.width / 2, j7, j4, child.typeFaceShadowed); 11206 11209 else 11207 - class50_sub1_sub1_sub2.drawShadowedString(s3, k2, j7, child.typeFaceShadowed, j4); 11210 + typeFace.drawShadowedString(s3, k2, j7, child.typeFaceShadowed, j4); 11208 11211 } 11209 11212 11210 11213 } else if (child.type == 5) { 11211 - ImageRGB class50_sub1_sub1_sub1; 11214 + ImageRGB imageRGB; 11212 11215 if (componentEnabled(child)) 11213 - class50_sub1_sub1_sub1 = child.enabledImage; 11216 + imageRGB = child.enabledImage; 11214 11217 else 11215 - class50_sub1_sub1_sub1 = child.disabledImage; 11218 + imageRGB = child.disabledImage; 11216 11219 switch (child.id) { 11217 11220 case 1164: 11218 11221 case 1167: ··· 11221 11224 case 1540: 11222 11225 case 1541: 11223 11226 case 7455: 11224 - class50_sub1_sub1_sub1 = child.enabledImage; 11227 + imageRGB = child.enabledImage; 11225 11228 break; 11226 11229 default: 11227 11230 break; 11228 11231 } 11229 - if (class50_sub1_sub1_sub1 != null) 11230 - class50_sub1_sub1_sub1.drawImage(k2, l2); 11232 + if (imageRGB != null) 11233 + imageRGB.drawImage(k2, l2); 11231 11234 } else if (child.type == 6) { 11232 11235 int k3 = Rasterizer3D.centerX; 11233 11236 int k4 = Rasterizer3D.centerY; ··· 11241 11244 k7 = child.enabledAnimation; 11242 11245 else 11243 11246 k7 = child.disabledAnimation; 11244 - Model class50_sub1_sub4_sub4; 11247 + Model model; 11245 11248 if (k7 == -1) { 11246 - class50_sub1_sub4_sub4 = child.getAnimatedModel(-1, -1, flag2); 11249 + model = child.getAnimatedModel(-1, -1, flag2); 11247 11250 } else { 11248 11251 AnimationSequence class14 = AnimationSequence.animations[k7]; 11249 - class50_sub1_sub4_sub4 = child.getAnimatedModel(class14.frame1Ids[child.animationFrame], class14.getPrimaryFrame[child.animationFrame], 11252 + model = child.getAnimatedModel(class14.frame1Ids[child.animationFrame], class14.getPrimaryFrame[child.animationFrame], 11250 11253 flag2); 11251 11254 } 11252 - if (class50_sub1_sub4_sub4 != null) 11253 - class50_sub1_sub4_sub4.render(0, child.rotationY, 0, child.rotationX, 0, k5, j6); 11255 + if (model != null) 11256 + model.render(0, child.rotationY, 0, child.rotationX, 0, k5, j6); 11254 11257 Rasterizer3D.centerX = k3; 11255 11258 Rasterizer3D.centerY = k4; 11256 11259 } else { 11257 11260 if (child.type == 7) { 11258 - TypeFace class50_sub1_sub1_sub2_1 = child.typeFaces; 11261 + TypeFace typeFace = child.typeFaces; 11259 11262 int l4 = 0; 11260 11263 for (int l5 = 0; l5 < child.height; l5++) { 11261 11264 for (int k6 = 0; k6 < child.width; k6++) { ··· 11267 11270 int i10 = k2 + k6 * (115 + child.itemSpritePadsX); 11268 11271 int i11 = l2 + l5 * (12 + child.itemSpritePadsY); 11269 11272 if (child.typeFaceCentered) 11270 - class50_sub1_sub1_sub2_1.drawStringCenter(s6, i10 + child.width / 2, i11, child.disabledColor, child.typeFaceShadowed 11273 + typeFace.drawStringCenter(s6, i10 + child.width / 2, i11, child.disabledColor, child.typeFaceShadowed 11271 11274 ); 11272 11275 else 11273 - class50_sub1_sub1_sub2_1.drawShadowedString(s6, i10, i11, child.typeFaceShadowed, child.disabledColor 11276 + typeFace.drawShadowedString(s6, i10, i11, child.typeFaceShadowed, child.disabledColor 11274 11277 ); 11275 11278 } 11276 11279 l4++; ··· 11284 11287 && anInt893 == 100) { 11285 11288 int l3 = 0; 11286 11289 int i5 = 0; 11287 - TypeFace class50_sub1_sub1_sub2_2 = fontNormal; 11290 + TypeFace typeFace = fontNormal; 11288 11291 for (String s1 = child.disabledText; s1.length() > 0; ) { 11289 11292 int l7 = s1.indexOf("\\n"); 11290 11293 String s4; ··· 11295 11298 s4 = s1; 11296 11299 s1 = ""; 11297 11300 } 11298 - int j10 = class50_sub1_sub1_sub2_2.getStringEffectWidth(s4); 11301 + int j10 = typeFace.getStringEffectWidth(s4); 11299 11302 if (j10 > l3) 11300 11303 l3 = j10; 11301 - i5 += class50_sub1_sub1_sub2_2.characterDefaultHeight + 1; 11304 + i5 += typeFace.characterDefaultHeight + 1; 11302 11305 } 11303 11306 11304 11307 l3 += 6; ··· 11314 11317 Rasterizer.drawFilledRectangle(i8, k10, l3, i5, 0xffffa0); 11315 11318 Rasterizer.drawUnfilledRectangle(i8, k10, l3, i5, 0); 11316 11319 String s2 = child.disabledText; 11317 - for (int j11 = k10 + class50_sub1_sub1_sub2_2.characterDefaultHeight + 2; s2.length() > 0; j11 += class50_sub1_sub1_sub2_2.characterDefaultHeight + 1) { 11320 + for (int j11 = k10 + typeFace.characterDefaultHeight + 2; s2.length() > 0; j11 += typeFace.characterDefaultHeight + 1) { 11318 11321 int l11 = s2.indexOf("\\n"); 11319 11322 String s5; 11320 11323 if (l11 != -1) { ··· 11324 11327 s5 = s2; 11325 11328 s2 = ""; 11326 11329 } 11327 - class50_sub1_sub1_sub2_2.drawShadowedString(s5, i8 + 3, j11, false, 0); 11330 + typeFace.drawShadowedString(s5, i8 + 3, j11, false, 0); 11328 11331 } 11329 11332 11330 11333 } ··· 11486 11489 aBoolean1046 = true; 11487 11490 } 11488 11491 11489 - private boolean method148(int i, String s) { 11492 + private boolean hasFriend(String s) { 11490 11493 if (s == null) 11491 11494 return false; 11492 11495 for (int j = 0; j < friendsCount; j++) 11493 11496 if (s.equalsIgnoreCase(friendUsernames[j])) 11494 11497 return true; 11495 11498 11496 - if (i != 13292) 11497 - aBoolean1014 = !aBoolean1014; 11498 11499 return s.equalsIgnoreCase(localPlayer.playerName); 11499 11500 } 11500 11501 ··· 11609 11610 int ai[] = minimapImage.pixels; 11610 11611 int k4 = 24624 + k * 4 + (103 - i) * 512 * 4; 11611 11612 int i5 = k1 >> 14 & 0x7fff; 11612 - GameObjectDefinition class47_2 = GameObjectDefinition.getDefinition(i5); 11613 - if (class47_2.anInt795 != -1) { 11614 - IndexedImage class50_sub1_sub1_sub3_2 = aClass50_Sub1_Sub1_Sub3Array1153[class47_2.anInt795]; 11615 - if (class50_sub1_sub1_sub3_2 != null) { 11616 - int i6 = (class47_2.sizeX * 4 - class50_sub1_sub1_sub3_2.width) / 2; 11617 - int j6 = (class47_2.sizeY * 4 - class50_sub1_sub1_sub3_2.height) / 2; 11618 - class50_sub1_sub1_sub3_2.drawImage(48 + k * 4 + i6, 48 + (104 - i - class47_2.sizeY) * 4 + j6 11613 + GameObjectDefinition gameObjectDefinition = GameObjectDefinition.getDefinition(i5); 11614 + if (gameObjectDefinition.anInt795 != -1) { 11615 + IndexedImage indexedImage = aClass50_Sub1_Sub1_Sub3Array1153[gameObjectDefinition.anInt795]; 11616 + if (indexedImage != null) { 11617 + int i6 = (gameObjectDefinition.sizeX * 4 - indexedImage.width) / 2; 11618 + int j6 = (gameObjectDefinition.sizeY * 4 - indexedImage.height) / 2; 11619 + indexedImage.drawImage(48 + k * 4 + i6, 48 + (104 - i - gameObjectDefinition.sizeY) * 4 + j6 11619 11620 ); 11620 11621 } 11621 11622 } else { ··· 11680 11681 int l2 = i2 >> 6 & 3; 11681 11682 int j3 = i2 & 0x1f; 11682 11683 int l3 = k1 >> 14 & 0x7fff; 11683 - GameObjectDefinition class47_1 = GameObjectDefinition.getDefinition(l3); 11684 - if (class47_1.anInt795 != -1) { 11685 - IndexedImage class50_sub1_sub1_sub3_1 = aClass50_Sub1_Sub1_Sub3Array1153[class47_1.anInt795]; 11686 - if (class50_sub1_sub1_sub3_1 != null) { 11687 - int j5 = (class47_1.sizeX * 4 - class50_sub1_sub1_sub3_1.width) / 2; 11688 - int k5 = (class47_1.sizeY * 4 - class50_sub1_sub1_sub3_1.height) / 2; 11689 - class50_sub1_sub1_sub3_1.drawImage(48 + k * 4 + j5, 48 + (104 - i - class47_1.sizeY) * 4 + k5 11684 + GameObjectDefinition gameObjectDefinition = GameObjectDefinition.getDefinition(l3); 11685 + if (gameObjectDefinition.anInt795 != -1) { 11686 + IndexedImage indexedImage = aClass50_Sub1_Sub1_Sub3Array1153[gameObjectDefinition.anInt795]; 11687 + if (indexedImage != null) { 11688 + int j5 = (gameObjectDefinition.sizeX * 4 - indexedImage.width) / 2; 11689 + int k5 = (gameObjectDefinition.sizeY * 4 - indexedImage.height) / 2; 11690 + indexedImage.drawImage(48 + k * 4 + j5, 48 + (104 - i - gameObjectDefinition.sizeY) * 4 + k5 11690 11691 ); 11691 11692 } 11692 11693 } else if (j3 == 9) { ··· 11713 11714 int j2 = k1 >> 14 & 0x7fff; 11714 11715 GameObjectDefinition class47 = GameObjectDefinition.getDefinition(j2); 11715 11716 if (class47.anInt795 != -1) { 11716 - IndexedImage class50_sub1_sub1_sub3 = aClass50_Sub1_Sub1_Sub3Array1153[class47.anInt795]; 11717 - if (class50_sub1_sub1_sub3 != null) { 11718 - int i4 = (class47.sizeX * 4 - class50_sub1_sub1_sub3.width) / 2; 11719 - int j4 = (class47.sizeY * 4 - class50_sub1_sub1_sub3.height) / 2; 11720 - class50_sub1_sub1_sub3.drawImage(48 + k * 4 + i4, 48 + (104 - i - class47.sizeY) * 4 + j4); 11717 + IndexedImage indexedImage = aClass50_Sub1_Sub1_Sub3Array1153[class47.anInt795]; 11718 + if (indexedImage != null) { 11719 + int i4 = (class47.sizeX * 4 - indexedImage.width) / 2; 11720 + int j4 = (class47.sizeY * 4 - indexedImage.height) / 2; 11721 + indexedImage.drawImage(48 + k * 4 + i4, 48 + (104 - i - class47.sizeY) * 4 + j4); 11721 11722 } 11722 11723 } 11723 11724 }
+84
src/main/java/com/jagex/runescape/config/IncomingPacketIds.java
··· 1 + package com.jagex.runescape.config; 2 + 3 + public final class IncomingPacketIds { 4 + 5 + public static final int 6 + REMOVE_LANDSCAPE_OBJECT = 88, 7 + SET_LANDSCAPE_OBJECT = 152, 8 + REMOVE_GROUND_ITEM = 208, 9 + UPDATE_GROUND_ITEM_AMOUNT = 121, 10 + SET_GROUND_ITEM = 107, 11 + SET_PLAYER_GROUND_ITEM = 106, 12 + UPDATE_GROUND_ITEMS_AND_LANDSCAPE_OBJECTS = 183, 13 + CLEAR_GROUND_ITEMS_AND_LANDSCAPE_OBJECTS = 40, 14 + 15 + SHOW_STILL_GRAPHICS = 59, 16 + SHOW_PROJECTILE = 181, 17 + SHOW_HINT_ICON = 199, 18 + 19 + PLAY_SOUND = 26, 20 + PLAY_POSITION_SOUND = 41, 21 + PLAY_SONG = 220, 22 + PLAY_TEMP_SONG = 249, 23 + 24 + SYSTEM_UPDATE = 190, 25 + CHATBOX_MESSAGE = 63, 26 + 27 + CONSTRUCT_MAP_REGION = 53, 28 + UPDATE_ACTIVE_MAP_REGION = 222, 29 + 30 + SET_INTERFACE_ANIMATION = 2, 31 + SET_INTERFACE_ITEM_MODEL = 21, 32 + SET_INTERFACE_PLAYER_HEAD = 255, 33 + SET_CHAT_INPUT_TYPE_2 = 6, 34 + SET_INTERFACE_MODEL_1 = 216, 35 + SET_INTERFACE_MODEL_2 = 162, 36 + RESET_INTERFACE_SETTINGS = 113, 37 + FLASH_SIDEBAR_ICON = 238, 38 + SET_SIDEBAR_INTERFACE = 10, 39 + SET_OPEN_SIDEBAR = 252, 40 + CLEAR_INTERFACE_ITEMS = 219, 41 + UPDATE_ALL_INTERFACE_ITEMS = 206, 42 + UPDATE_INTERFACE_ITEMS_BY_SLOT = 134, 43 + UPDATE_INTERFACE_SETTING_LARGE = 115, 44 + UPDATE_INTERFACE_SETTING_SMALL = 182, 45 + UPDATE_CHAT_SETTINGS = 201, 46 + UPDATE_INTERFACE_COLOR = 218, 47 + UPDATE_INTERFACE_STRING = 232, 48 + UPDATE_INTERFACE_SCROLL_POSITION = 200, 49 + UPDATE_INTERFACE_MODEL_DISPLAY = 186, 50 + UPDATE_INTERFACE_HIDDEN_ON_HOVER_STATE = 82, 51 + UPDATE_INTERFACE_POSITION = 166, 52 + SHOW_SIDEBAR_OVERLAY_INTERFACE = 246, 53 + SHOW_GAME_INTERFACE = 159, 54 + SHOW_SIDEBAR_AND_GAME_INTERFACE = 128, 55 + SHOW_WALKABLE_INTERFACE = 50, 56 + SHOW_WELCOME_SCREEN = 76, 57 + SHOW_DIALOG = 158, 58 + SHOW_CHATBOX_INTERFACE = 109, 59 + CLOSE_ALL_INTERFACES = 29, 60 + SET_MINIMAP_STATE = 156, 61 + 62 + PLAYER_UPDATING = 90, 63 + NPC_UPDATING = 71, 64 + RESET_MOB_ANIMATIONS = 13, 65 + 66 + UPDATE_FRIEND_LIST_STATUS = 251, 67 + UPDATE_IGNORE_LIST = 226, 68 + PRIVATE_MESSAGE_RECEIVED = 135, 69 + UPDATE_FRIEND = 78, 70 + UPDATE_PLAYER_CONTEXT_OPTION = 157, 71 + 72 + SEND_REFERENCE_POSITION = 75, 73 + 74 + UPDATE_MEMBERSHIP_AND_WORLD_INDEX = 126, 75 + UPDATE_RUN_ENERGY = 125, 76 + UPDATE_SKILL = 49, 77 + UPDATE_CARRY_WEIGHT = 174, 78 + SEND_LOGOUT = 5, 79 + 80 + RESET_CUTSCENE_CAMERA = 148, 81 + MOVE_CUTSCENE_CAMERA = 167, 82 + CAMERA_SHAKE = 67; 83 + 84 + }
+3 -3
src/main/java/com/jagex/runescape/media/renderable/Projectile.java
··· 92 92 return projectileModel; 93 93 } 94 94 95 - public Projectile(int sceneId, int endHeight, int startDistanceFromTarget, int projectileY, int i1, int speed, int startSlope, int targetedEntityIndex, int height, int projectileX, 96 - int delay) { 95 + public Projectile(int sceneId, int endHeight, int startDistanceFromTarget, int projectileY, int graphicsId, int speed, int startSlope, 96 + int targetedEntityIndex, int height, int projectileX, int delay) { 97 97 this.aBoolean1561 = false; 98 98 this.aBoolean1573 = true; 99 - this.animation = SpotAnimation.cache[i1]; 99 + this.animation = SpotAnimation.cache[graphicsId]; 100 100 this.sceneId = sceneId; 101 101 this.startX = projectileX; 102 102 this.startY = projectileY;
+94 -105
src/main/java/com/jagex/runescape/scene/Scene.java
··· 522 522 } 523 523 524 524 public void method261(int x, int y, int z) { 525 - SceneTile tile = groundArray[z][x][y]; 526 - if (tile == null) { 525 + SceneTile sceneTile = groundArray[z][x][y]; 526 + if (sceneTile == null) { 527 527 return; 528 528 } 529 - tile.floorDecoration = null; 529 + sceneTile.floorDecoration = null; 530 530 } 531 531 532 532 public void clearGroundItem(int i, int j, int k) { 533 - SceneTile class50_sub3 = groundArray[i][j][k]; 534 - if (class50_sub3 != null) { 535 - class50_sub3.groundItemTile = null; 533 + SceneTile sceneTile = groundArray[i][j][k]; 534 + if (sceneTile != null) { 535 + sceneTile.groundItemTile = null; 536 536 } 537 537 } 538 538 539 - public Wall method263(int i, int j, int k, int l) { 540 - SceneTile class50_sub3 = groundArray[i][k][l]; 541 - if (j != 17734) { 542 - throw new NullPointerException(); 543 - } 544 - if (class50_sub3 == null) { 539 + public Wall getWallObject(int level, int x, int y) { 540 + SceneTile sceneTile = groundArray[level][x][y]; 541 + 542 + if (sceneTile == null) { 545 543 return null; 546 544 } else { 547 - return class50_sub3.wall; 545 + return sceneTile.wall; 548 546 } 549 547 } 550 548 551 - public WallDecoration method264(int i, int j, int k, boolean flag) { 552 - SceneTile class50_sub3 = groundArray[i][k][j]; 553 - if (flag) { 554 - throw new NullPointerException(); 555 - } 556 - if (class50_sub3 == null) { 549 + public WallDecoration getWallDecoration(int level, int y, int x) { 550 + SceneTile sceneTile = groundArray[level][x][y]; 551 + 552 + if (sceneTile == null) { 557 553 return null; 558 554 } else { 559 - return class50_sub3.wallDecoration; 555 + return sceneTile.wallDecoration; 560 556 } 561 557 } 562 558 563 - public InteractiveObject method265(int i, byte byte0, int j, int k) { 564 - if (byte0 != 32) { 565 - for (int l = 1; l > 0; l++) { 566 - } 567 - } 568 - SceneTile class50_sub3 = groundArray[k][i][j]; 569 - if (class50_sub3 == null) { 559 + public InteractiveObject method265(int x, int y, int level) { 560 + SceneTile sceneTile = groundArray[level][x][y]; 561 + if (sceneTile == null) { 570 562 return null; 571 563 } 572 - for (int i1 = 0; i1 < class50_sub3.entityCount; i1++) { 573 - InteractiveObject interactiveObject = class50_sub3.interactiveObjects[i1]; 574 - if ((interactiveObject.uid >> 29 & 3) == 2 && interactiveObject.tileLeft == i && interactiveObject.tileTop == j) { 564 + for (int i = 0; i < sceneTile.entityCount; i++) { 565 + InteractiveObject interactiveObject = sceneTile.interactiveObjects[i]; 566 + if ((interactiveObject.uid >> 29 & 3) == 2 && interactiveObject.tileLeft == x && interactiveObject.tileTop == y) { 575 567 return interactiveObject; 576 568 } 577 569 } ··· 579 571 return null; 580 572 } 581 573 582 - public FloorDecoration method266(int i, int j, int k, int l) { 583 - if (k != 0) { 584 - throw new NullPointerException(); 585 - } 586 - SceneTile class50_sub3 = groundArray[i][l][j]; 587 - if (class50_sub3 == null || class50_sub3.floorDecoration == null) { 574 + public FloorDecoration getFloorDecoration(int level, int x, int y) { 575 + SceneTile sceneTile = groundArray[level][y][x]; 576 + if (sceneTile == null || sceneTile.floorDecoration == null) { 588 577 return null; 589 578 } else { 590 - return class50_sub3.floorDecoration; 579 + return sceneTile.floorDecoration; 591 580 } 592 581 } 593 582 594 583 public int method267(int i, int j, int k) { 595 - SceneTile class50_sub3 = groundArray[i][j][k]; 596 - if (class50_sub3 == null || class50_sub3.wall == null) { 584 + SceneTile sceneTile = groundArray[i][j][k]; 585 + if (sceneTile == null || sceneTile.wall == null) { 597 586 return 0; 598 587 } else { 599 - return class50_sub3.wall.uid; 588 + return sceneTile.wall.uid; 600 589 } 601 590 } 602 591 603 592 public int method268(int i, byte byte0, int j, int k) { 604 - SceneTile class50_sub3 = groundArray[j][i][k]; 605 - if (class50_sub3 == null || class50_sub3.wallDecoration == null) { 593 + SceneTile sceneTile = groundArray[j][i][k]; 594 + if (sceneTile == null || sceneTile.wallDecoration == null) { 606 595 return 0; 607 596 } else { 608 - return class50_sub3.wallDecoration.uid; 597 + return sceneTile.wallDecoration.uid; 609 598 } 610 599 } 611 600 612 601 public int method269(int i, int j, int k) { 613 - SceneTile class50_sub3 = groundArray[i][j][k]; 614 - if (class50_sub3 == null) { 602 + SceneTile sceneTile = groundArray[i][j][k]; 603 + if (sceneTile == null) { 615 604 return 0; 616 605 } 617 - for (int l = 0; l < class50_sub3.entityCount; l++) { 618 - InteractiveObject interactiveObject = class50_sub3.interactiveObjects[l]; 606 + for (int l = 0; l < sceneTile.entityCount; l++) { 607 + InteractiveObject interactiveObject = sceneTile.interactiveObjects[l]; 619 608 if ((interactiveObject.uid >> 29 & 3) == 2 && interactiveObject.tileLeft == j && interactiveObject.tileTop == k) { 620 609 return interactiveObject.uid; 621 610 } ··· 625 614 } 626 615 627 616 public int getFloorDecorationHash(int i, int j, int k) { 628 - SceneTile class50_sub3 = groundArray[i][j][k]; 629 - if (class50_sub3 == null || class50_sub3.floorDecoration == null) { 617 + SceneTile sceneTile = groundArray[i][j][k]; 618 + if (sceneTile == null || sceneTile.floorDecoration == null) { 630 619 return 0; 631 620 } else { 632 - return class50_sub3.floorDecoration.uid; 621 + return sceneTile.floorDecoration.uid; 633 622 } 634 623 } 635 624 636 625 public int method271(int i, int j, int k, int l) { 637 - SceneTile class50_sub3 = groundArray[i][j][k]; 638 - if (class50_sub3 == null) { 626 + SceneTile sceneTile = groundArray[i][j][k]; 627 + if (sceneTile == null) { 639 628 return -1; 640 629 } 641 - if (class50_sub3.wall != null && class50_sub3.wall.uid == l) { 642 - return class50_sub3.wall.config & 0xff; 630 + if (sceneTile.wall != null && sceneTile.wall.uid == l) { 631 + return sceneTile.wall.config & 0xff; 643 632 } 644 - if (class50_sub3.wallDecoration != null && class50_sub3.wallDecoration.uid == l) { 645 - return class50_sub3.wallDecoration.config & 0xff; 633 + if (sceneTile.wallDecoration != null && sceneTile.wallDecoration.uid == l) { 634 + return sceneTile.wallDecoration.config & 0xff; 646 635 } 647 - if (class50_sub3.floorDecoration != null && class50_sub3.floorDecoration.uid == l) { 648 - return class50_sub3.floorDecoration.config & 0xff; 636 + if (sceneTile.floorDecoration != null && sceneTile.floorDecoration.uid == l) { 637 + return sceneTile.floorDecoration.config & 0xff; 649 638 } 650 - for (int i1 = 0; i1 < class50_sub3.entityCount; i1++) { 651 - if (class50_sub3.interactiveObjects[i1].uid == l) { 652 - return class50_sub3.interactiveObjects[i1].config & 0xff; 639 + for (int i1 = 0; i1 < sceneTile.entityCount; i1++) { 640 + if (sceneTile.interactiveObjects[i1].uid == l) { 641 + return sceneTile.interactiveObjects[i1].config & 0xff; 653 642 } 654 643 } 655 644 ··· 700 689 701 690 } 702 691 703 - private void method273(int i, Model class50_sub1_sub4_sub4, int j, int k, int l) { 692 + private void method273(int i, Model model, int j, int k, int l) { 704 693 if (l != 0) { 705 694 return; 706 695 } 707 696 if (i < mapSizeX) { 708 - SceneTile class50_sub3 = groundArray[k][i + 1][j]; 709 - if (class50_sub3 != null && class50_sub3.floorDecoration != null 710 - && class50_sub3.floorDecoration.renderable.verticesNormal != null) { 711 - mergeNormals(class50_sub1_sub4_sub4, 712 - (Model) class50_sub3.floorDecoration.renderable, 128, 0, 0, true); 697 + SceneTile sceneTile = groundArray[k][i + 1][j]; 698 + if (sceneTile != null && sceneTile.floorDecoration != null 699 + && sceneTile.floorDecoration.renderable.verticesNormal != null) { 700 + mergeNormals(model, 701 + (Model) sceneTile.floorDecoration.renderable, 128, 0, 0, true); 713 702 } 714 703 } 715 704 if (j < mapSizeX) { 716 - SceneTile class50_sub3_1 = groundArray[k][i][j + 1]; 717 - if (class50_sub3_1 != null && class50_sub3_1.floorDecoration != null 718 - && class50_sub3_1.floorDecoration.renderable.verticesNormal != null) { 719 - mergeNormals(class50_sub1_sub4_sub4, 720 - (Model) class50_sub3_1.floorDecoration.renderable, 0, 0, 128, true); 705 + SceneTile sceneTile = groundArray[k][i][j + 1]; 706 + if (sceneTile != null && sceneTile.floorDecoration != null 707 + && sceneTile.floorDecoration.renderable.verticesNormal != null) { 708 + mergeNormals(model, 709 + (Model) sceneTile.floorDecoration.renderable, 0, 0, 128, true); 721 710 } 722 711 } 723 712 if (i < mapSizeX && j < mapSizeY) { 724 - SceneTile class50_sub3_2 = groundArray[k][i + 1][j + 1]; 725 - if (class50_sub3_2 != null && class50_sub3_2.floorDecoration != null 726 - && class50_sub3_2.floorDecoration.renderable.verticesNormal != null) { 727 - mergeNormals(class50_sub1_sub4_sub4, 728 - (Model) class50_sub3_2.floorDecoration.renderable, 128, 0, 128, true); 713 + SceneTile sceneTile = groundArray[k][i + 1][j + 1]; 714 + if (sceneTile != null && sceneTile.floorDecoration != null 715 + && sceneTile.floorDecoration.renderable.verticesNormal != null) { 716 + mergeNormals(model, 717 + (Model) sceneTile.floorDecoration.renderable, 128, 0, 128, true); 729 718 } 730 719 } 731 720 if (i < mapSizeX && j > 0) { 732 - SceneTile class50_sub3_3 = groundArray[k][i + 1][j - 1]; 733 - if (class50_sub3_3 != null && class50_sub3_3.floorDecoration != null 734 - && class50_sub3_3.floorDecoration.renderable.verticesNormal != null) { 735 - mergeNormals(class50_sub1_sub4_sub4, 736 - (Model) class50_sub3_3.floorDecoration.renderable, 128, 0, -128, 721 + SceneTile sceneTile = groundArray[k][i + 1][j - 1]; 722 + if (sceneTile != null && sceneTile.floorDecoration != null 723 + && sceneTile.floorDecoration.renderable.verticesNormal != null) { 724 + mergeNormals(model, 725 + (Model) sceneTile.floorDecoration.renderable, 128, 0, -128, 737 726 true); 738 727 } 739 728 } ··· 870 859 } 871 860 872 861 public void renderMinimapDot(int[] ai, int i, int j, int k, int l, int i1) { 873 - SceneTile class50_sub3 = groundArray[k][l][i1]; 874 - if (class50_sub3 == null) { 862 + SceneTile sceneTile = groundArray[k][l][i1]; 863 + if (sceneTile == null) { 875 864 return; 876 865 } 877 - GenericTile genericTile = class50_sub3.plainTile; 866 + GenericTile genericTile = sceneTile.plainTile; 878 867 if (genericTile != null) { 879 868 int j1 = genericTile.rgbColor; 880 869 if (j1 == 0) { ··· 890 879 891 880 return; 892 881 } 893 - ComplexTile complexTile = class50_sub3.shapedTile; 882 + ComplexTile complexTile = sceneTile.shapedTile; 894 883 if (complexTile == null) { 895 884 return; 896 885 } ··· 1097 1086 } 1098 1087 1099 1088 for (int z = currentPositionZ; z < mapSizeZ; z++) { 1100 - SceneTile[][] tiles = groundArray[z]; 1089 + SceneTile[][] sceneTiles = groundArray[z]; 1101 1090 for (int offsetX = -25; offsetX <= 0; offsetX++) { 1102 1091 int x = cameraPositionTileX + offsetX; 1103 1092 int x2 = cameraPositionTileX - offsetX; ··· 1107 1096 int y2 = cameraPositionTileY - offsetY; 1108 1097 if (x >= currentPositionX) { 1109 1098 if (y >= currentPositionY) { 1110 - SceneTile tile = tiles[x][y]; 1111 - if (tile != null && tile.draw) { 1112 - renderTile(tile, true); 1099 + SceneTile sceneTile = sceneTiles[x][y]; 1100 + if (sceneTile != null && sceneTile.draw) { 1101 + renderTile(sceneTile, true); 1113 1102 } 1114 1103 } 1115 1104 if (y2 < mapBoundsY) { 1116 - SceneTile tile = tiles[x][y2]; 1117 - if (tile != null && tile.draw) { 1118 - renderTile(tile, true); 1105 + SceneTile sceneTile = sceneTiles[x][y2]; 1106 + if (sceneTile != null && sceneTile.draw) { 1107 + renderTile(sceneTile, true); 1119 1108 } 1120 1109 } 1121 1110 } 1122 1111 if (x2 < mapBoundsX) { 1123 1112 if (y >= currentPositionY) { 1124 - SceneTile class50_sub3_3 = tiles[x2][y]; 1125 - if (class50_sub3_3 != null && class50_sub3_3.draw) { 1126 - renderTile(class50_sub3_3, true); 1113 + SceneTile sceneTile = sceneTiles[x2][y]; 1114 + if (sceneTile != null && sceneTile.draw) { 1115 + renderTile(sceneTile, true); 1127 1116 } 1128 1117 } 1129 1118 if (y2 < mapBoundsY) { 1130 - SceneTile class50_sub3_4 = tiles[x2][y2]; 1131 - if (class50_sub3_4 != null && class50_sub3_4.draw) { 1132 - renderTile(class50_sub3_4, true); 1119 + SceneTile sceneTile = sceneTiles[x2][y2]; 1120 + if (sceneTile != null && sceneTile.draw) { 1121 + renderTile(sceneTile, true); 1133 1122 } 1134 1123 } 1135 1124 } ··· 1145 1134 } 1146 1135 1147 1136 for (int z = currentPositionZ; z < mapSizeZ; z++) { 1148 - SceneTile[][] tiles = groundArray[z]; 1137 + SceneTile[][] sceneTiles = groundArray[z]; 1149 1138 for (int offsetX = -25; offsetX <= 0; offsetX++) { 1150 1139 int x = cameraPositionTileX + offsetX; 1151 1140 int x2 = cameraPositionTileX - offsetX; ··· 1155 1144 int y2 = cameraPositionTileY - offsetY; 1156 1145 if (x >= currentPositionX) { 1157 1146 if (y >= currentPositionY) { 1158 - SceneTile tile = tiles[x][y]; 1147 + SceneTile tile = sceneTiles[x][y]; 1159 1148 if (tile != null && tile.draw) { 1160 1149 renderTile(tile, false); 1161 1150 } 1162 1151 } 1163 1152 if (y2 < mapBoundsY) { 1164 - SceneTile tile = tiles[x][y2]; 1153 + SceneTile tile = sceneTiles[x][y2]; 1165 1154 if (tile != null && tile.draw) { 1166 1155 renderTile(tile, false); 1167 1156 } ··· 1169 1158 } 1170 1159 if (x2 < mapBoundsX) { 1171 1160 if (y >= currentPositionY) { 1172 - SceneTile tile = tiles[x2][y]; 1161 + SceneTile tile = sceneTiles[x2][y]; 1173 1162 if (tile != null && tile.draw) { 1174 1163 renderTile(tile, false); 1175 1164 } 1176 1165 } 1177 1166 if (y2 < mapBoundsY) { 1178 - SceneTile tile = tiles[x2][y2]; 1167 + SceneTile tile = sceneTiles[x2][y2]; 1179 1168 if (tile != null && tile.draw) { 1180 1169 renderTile(tile, false); 1181 1170 } ··· 2292 2281 } 2293 2282 2294 2283 } 2295 - //TODO:Needs more refactoring 2284 + //TODO:Needs more refactoring