mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-04 00:31:54 +00:00
Various fixes and improvements (#640)
* Added more client settings for winter and hide roofs * Removed unnecessary local var and added Javadoc comment * Fixed dark wizards casting magic in melee range * Added AttackType enum * Removed extra asterisk * Removed attackType magic numbers * Enabled snow toggles by default * Combined snow month into one variable * Added option for fixes without custom settings Added option for fixes (and QoL tab) without overriding specific features. * Added more main args * Fixed typo * Added player sound saving We have it for music, so why not for sounds too? * Fixed typos * Added closed client exception to ignores * Fixed NPC definitions not loading * Replaced NPC definitions XML with JSON * Replaced NPCDefinition Array with HashMap * Use err for early exit output * Fixed KQ death causing client crash It had the wrong anims. * Added zoom level to debug info * Added zoom level messages option * Added fire breath attack type enum * Replaced remaining fire breath attack types * Fixed client lag This should technically not be necessary, but it's more of a workaround due to server inefficiencies (if you kill a bunch of cows, your client will start to lag and you will even stack hits, I suspect it's due to the ground items) until we fix the server inefficiencies. There's not really any downsides in changing this from 5 to 100, so it's a good change for now. * Make definitions private * Fixed dark wizards not attacking back * Improved comments * Removed extra giant mole spawns * Added mole lair rope action * Only send yes chat head when talking to NPC * Fixed removing item does not reset autocast * Fixed picking up stackable items with full inv * Fixed lvl 7 dark wizard anims * Added confirm param to xprate command and fixed players command * Removed usages of Misc.println This hides which file the println is actually called from, so it's actually better to remove this helper. * Don't move player when clicking on barrows check This is both unauthentic and unnecessary. * Removed unnecessary commented out code We don't even need it commented out tbh. * Fixed incorrect barrows NPC attack anims * Improved slayer points message * Fixed slayer task message cut off * Might as well make this naming consistent * Fixed typo * Fixed stronghold slayer dungeon getting stuck in wall * Require control key for zooming It's too easy to accidentally zoom in/out with the scroll wheel, so let's make it so you need the control key held to scroll wheel zoom in/out. * Added option for control key zooming This way, it's off by default so it works the way it always did by default. * Added alias for control key zoom * Fixed quest interface not emptying out completely * Updated slayer point dialogue to be more accurate * Fixed compile error * Fixed formatting * More formatting fixes * Added 5th click object handling (fixes pick-lock crash) * Fixed lower level NPCs always hitting 0 * Fixed NPCs having incorrect max hit Chickens were hitting 3's, ouch... * Fixed NPCs still hitting 0s This is much better now. Combat feels good. * Fixed boss max hits * Fixed al-kharid gate talking option * Copied over max hits from spawns.json to npcDefinitions.json This fixes a lot of NPCs. Many NPCs already seem to be correct. * Added workaround preventing players stuck in level 28 wildy * Changed comment to TODO * Added control key zoom toggle * Extracted config option to ClientSettings * added message for control key zooming
This commit is contained in:
@@ -7,6 +7,47 @@ import java.math.BigInteger;
|
||||
*/
|
||||
|
||||
public class ClientSettings {
|
||||
/**
|
||||
* @QoL
|
||||
* Require control key to zoom the client
|
||||
*/
|
||||
public static boolean CONTROL_KEY_ZOOMING = false;
|
||||
|
||||
/**
|
||||
* @QoL
|
||||
* Show zoom level messages in chat when changing zoom levels
|
||||
*/
|
||||
public static boolean SHOW_ZOOM_LEVEL_MESSAGES = false;
|
||||
/**
|
||||
* @QoL
|
||||
* Hide roofs
|
||||
*/
|
||||
public static boolean HIDE_ROOFS = false;
|
||||
/**
|
||||
* @QoL
|
||||
* Hide buggy varrock sword shop snow
|
||||
*/
|
||||
public static boolean HIDE_BUGGY_VARROCK_SWORD_SHOP_SNOW = true;
|
||||
/**
|
||||
* @QoL
|
||||
* Forces Server-Wide Snow floor
|
||||
*/
|
||||
public static boolean SNOW_FLOOR_FORCE_ENABLED = false;
|
||||
/**
|
||||
* @QoL
|
||||
* Toggles Server-Wide Snow floor (for the designated month)
|
||||
*/
|
||||
public static boolean SNOW_FLOOR_ENABLED = true;
|
||||
/**
|
||||
* @QoL
|
||||
* Forces Server-Wide Snow overlay
|
||||
*/
|
||||
public static boolean SNOW_OVERLAY_FORCE_ENABLED = false;
|
||||
/**
|
||||
* @QoL
|
||||
* Toggles Server-Wide Snow overlay (for the designated month)
|
||||
*/
|
||||
public static boolean SNOW_OVERLAY_ENABLED = false;
|
||||
/**
|
||||
* @QoL
|
||||
* Enables Server-Wide Snow In The Designated Month
|
||||
|
||||
@@ -35,7 +35,7 @@ public final class Flo {
|
||||
} else if (i == 1) {
|
||||
anInt390 = stream.read3Bytes();
|
||||
Calendar date = new GregorianCalendar();
|
||||
if ((date.get(Calendar.MONTH) + 1) == 12) {
|
||||
if (ClientSettings.SNOW_FLOOR_FORCE_ENABLED || (ClientSettings.SNOW_FLOOR_ENABLED && (date.get(Calendar.MONTH) + 1) == Integer.parseInt(ClientSettings.SNOW_MONTH.substring(1)))) {
|
||||
anInt390 = 0xffffff;
|
||||
}
|
||||
method262(anInt390);
|
||||
|
||||
@@ -2975,7 +2975,11 @@ public class Game extends RSApplet {
|
||||
if (anInt1011 > 0) {
|
||||
anInt1011--;
|
||||
}
|
||||
for (int j = 0; j < 5; j++) {
|
||||
//TODO: Technically, this loop should be < 5 for authenticity, but until we reduce server inefficiencies
|
||||
//(for example killing a bunch of cows results in client lag,
|
||||
//likely from all the items on the ground for example), < 100 is fine.
|
||||
//OSRS uses < 100 and there are no drawbacks from having this < 100.
|
||||
for (int j = 0; j < 100; j++) {
|
||||
if (!parsePacket()) {
|
||||
break;
|
||||
}
|
||||
@@ -3758,7 +3762,7 @@ public class Game extends RSApplet {
|
||||
worldController.method312(k - 4, j - 4);
|
||||
}
|
||||
}
|
||||
if (l == 1062) {
|
||||
if (l == 1062) { //Fifth click
|
||||
anInt924 += baseX;
|
||||
if (anInt924 >= 113) {
|
||||
stream.createFrame(183);
|
||||
@@ -5034,6 +5038,10 @@ public class Game extends RSApplet {
|
||||
if (inputString.equals("::gfxtgl") || inputString.equals("::tglgfx") || inputString.equals("::togglerender") || inputString.equals("::togglegfx")) {
|
||||
graphicsEnabled = !graphicsEnabled;
|
||||
}
|
||||
if (inputString.equals("::crtlkeyzoom") || inputString.equals("::controlkeyzoom")) {
|
||||
ClientSettings.CONTROL_KEY_ZOOMING = !ClientSettings.CONTROL_KEY_ZOOMING;
|
||||
pushMessage("Your control key zooming is now: " + (ClientSettings.CONTROL_KEY_ZOOMING ? "enabled" : "disabled"), 0, "");
|
||||
}
|
||||
if (myPrivilege >= 2) {
|
||||
if (inputString.equals("::noclip"))
|
||||
for (int k1 = 0; k1 < 4; k1++)
|
||||
@@ -11571,7 +11579,7 @@ public class Game extends RSApplet {
|
||||
// 15774 = Good/Bad Password
|
||||
// 15767 = Drama Type
|
||||
if (l7 == 15244) {
|
||||
if (Flo.getTodaysDate().contains(ClientSettings.SNOW_MONTH)) {
|
||||
if (ClientSettings.SNOW_OVERLAY_FORCE_ENABLED || (ClientSettings.SNOW_OVERLAY_ENABLED && Flo.getTodaysDate().contains(ClientSettings.SNOW_MONTH))) {
|
||||
openInterfaceID = 15819;
|
||||
} else {
|
||||
openInterfaceID = 15801;
|
||||
@@ -11814,8 +11822,8 @@ public class Game extends RSApplet {
|
||||
draw3dScreen();
|
||||
if (showInfo) {
|
||||
int debugX = 0;
|
||||
int debugY = 249;
|
||||
int debugItems = 4;
|
||||
int debugY = 234;
|
||||
int debugItems = 5;
|
||||
int debugWidth = 140;
|
||||
int debugHeight = 25 + (debugItems * 15);
|
||||
int fill = 0x5d5447;
|
||||
@@ -11842,6 +11850,8 @@ public class Game extends RSApplet {
|
||||
chatTextDrawingArea.textRightShadow(true, debugX + debugWidth - 4, Color.YELLOW.hashCode(), (myPlayer.smallX[0] + baseX) + ", " + (myPlayer.smallY[0] + baseY), debugY);
|
||||
chatTextDrawingArea.textLeftShadow(true, debugX + 4, Color.WHITE.hashCode(), "Interface:", debugY += 15);
|
||||
chatTextDrawingArea.textRightShadow(true, debugX + debugWidth - 4, Color.YELLOW.hashCode(), "" + openInterfaceID, debugY);
|
||||
chatTextDrawingArea.textLeftShadow(true, debugX + 4, Color.WHITE.hashCode(), "Zoom level:", debugY += 15);
|
||||
chatTextDrawingArea.textRightShadow(true, debugX + debugWidth - 4, Color.YELLOW.hashCode(), "" + zoom, debugY);
|
||||
}
|
||||
|
||||
if (customSettingShowExperiencePerHour) {
|
||||
@@ -12619,12 +12629,20 @@ public class Game extends RSApplet {
|
||||
tabAreaAltered = true;
|
||||
break;
|
||||
case KeyEvent.VK_PAGE_UP:
|
||||
if (zoom > -1)
|
||||
if (zoom > -1) {
|
||||
zoom--;
|
||||
if (ClientSettings.SHOW_ZOOM_LEVEL_MESSAGES) {
|
||||
pushMessage("Your zoom level is now: " + zoom, 0, "");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KeyEvent.VK_PAGE_DOWN:
|
||||
if (zoom < (WorldController.drawDistance / 3))
|
||||
if (zoom < (WorldController.drawDistance / 3)) {
|
||||
zoom++;
|
||||
if (ClientSettings.SHOW_ZOOM_LEVEL_MESSAGES) {
|
||||
pushMessage("Your zoom level is now: " + zoom, 0, "");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KeyEvent.VK_V:
|
||||
if (keyevent.isControlDown()) {
|
||||
@@ -12783,7 +12801,7 @@ public class Game extends RSApplet {
|
||||
inputTaken = true;
|
||||
}
|
||||
if (interfaceID == 15244) {
|
||||
if (Flo.getTodaysDate().contains(ClientSettings.SNOW_MONTH)) {
|
||||
if (ClientSettings.SNOW_OVERLAY_FORCE_ENABLED || (ClientSettings.SNOW_OVERLAY_ENABLED && Flo.getTodaysDate().contains(ClientSettings.SNOW_MONTH))) {
|
||||
openInterfaceID = 15819;
|
||||
} else {
|
||||
openInterfaceID = 15801;
|
||||
@@ -12806,14 +12824,25 @@ public class Game extends RSApplet {
|
||||
|
||||
public final void mouseWheelMoved(MouseWheelEvent e) {
|
||||
int notches = e.getWheelRotation();
|
||||
if (ClientSettings.CONTROL_KEY_ZOOMING && !e.isControlDown()) {
|
||||
return;
|
||||
}
|
||||
// If mouse over main game screen, without anything else opened
|
||||
if (openInterfaceID == -1 && mouseX < 515 && mouseY < 340) {
|
||||
if (notches < 0) {
|
||||
if (zoom > -1)
|
||||
if (zoom > -1) {
|
||||
zoom--;
|
||||
if (ClientSettings.SHOW_ZOOM_LEVEL_MESSAGES) {
|
||||
pushMessage("Your zoom level is now: " + zoom, 0, "");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (zoom < (WorldController.drawDistance / 3))
|
||||
if (zoom < (WorldController.drawDistance / 3)) {
|
||||
zoom++;
|
||||
if (ClientSettings.SHOW_ZOOM_LEVEL_MESSAGES) {
|
||||
pushMessage("Your zoom level is now: " + zoom, 0, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,13 +32,28 @@ public final class Main {
|
||||
ClientSettings.BILINEAR_MINIMAP_FILTERING = true;
|
||||
ClientSettings.FIX_TRANSPARENCY_OVERFLOW = true;
|
||||
ClientSettings.FULL_512PX_VIEWPORT = true;
|
||||
Game.customSettingVisiblePlayerNames = true;
|
||||
Game.customSettingMinItemValue = 1000;
|
||||
ClientSettings.CONTROL_KEY_ZOOMING = true;
|
||||
break;
|
||||
case "-no-nav":
|
||||
case"-disable-nav":
|
||||
case "-disable-nav":
|
||||
ClientSettings.SHOW_NAVBAR = false;
|
||||
break;
|
||||
case"-no-snow":
|
||||
case"-hide-snow":
|
||||
case"-disable-snow":
|
||||
ClientSettings.SNOW_FLOOR_ENABLED = false;
|
||||
ClientSettings.SNOW_FLOOR_FORCE_ENABLED = false;
|
||||
ClientSettings.SNOW_OVERLAY_FORCE_ENABLED = false;
|
||||
ClientSettings.SNOW_OVERLAY_ENABLED = false;
|
||||
break;
|
||||
case"-no-roofs":
|
||||
case"-hide-roofs":
|
||||
case"-disable-roofs":
|
||||
ClientSettings.HIDE_ROOFS = true;
|
||||
break;
|
||||
case"-show-zoom":
|
||||
ClientSettings.SHOW_ZOOM_LEVEL_MESSAGES = true;
|
||||
break;
|
||||
}
|
||||
if (args[i].startsWith("-") && (i + 1) < args.length && !args[i + 1].startsWith("-")) {
|
||||
switch(args[i]) {
|
||||
|
||||
@@ -146,7 +146,7 @@ final class ObjectManager {
|
||||
k15 -= anIntArray127[k18];
|
||||
k16 -= anIntArray128[k18];
|
||||
}
|
||||
if (k17 >= 1 && k17 < anInt147 - 1 && (!lowMem || (aByteArrayArrayArray149[0][l6][k17] & 2) != 0 || (aByteArrayArrayArray149[l][l6][k17] & 0x10) == 0 && method182(k17, l, l6) == anInt131)) {
|
||||
if (k17 >= 1 && k17 < anInt147 - 1 && ((!hideBuggyVarrockSwordShopSnow && !hideRoofs && !lowMem) || (aByteArrayArrayArray149[0][l6][k17] & 2) != 0 || (aByteArrayArrayArray149[l][l6][k17] & 0x10) == 0 && method182(k17, l, l6) == anInt131)) {
|
||||
if (l < anInt145) {
|
||||
anInt145 = l;
|
||||
}
|
||||
@@ -456,7 +456,7 @@ final class ObjectManager {
|
||||
}
|
||||
|
||||
private void method175(int i, WorldController worldController, CollisionMap class11, int j, int k, int l, int i1, int j1) {
|
||||
if (lowMem && (aByteArrayArrayArray149[0][l][i] & 2) == 0) {
|
||||
if ((hideRoofs || lowMem) && (aByteArrayArrayArray149[0][l][i] & 2) == 0) {
|
||||
if ((aByteArrayArrayArray149[k][l][i] & 0x10) != 0) {
|
||||
return;
|
||||
}
|
||||
@@ -1355,6 +1355,10 @@ final class ObjectManager {
|
||||
private final byte[][][] aByteArrayArrayArray148;
|
||||
private final byte[][][] aByteArrayArrayArray149;
|
||||
static boolean lowMem = true;
|
||||
|
||||
static boolean hideRoofs = ClientSettings.HIDE_ROOFS;
|
||||
|
||||
static boolean hideBuggyVarrockSwordShopSnow = ClientSettings.HIDE_BUGGY_VARROCK_SWORD_SHOP_SNOW; //There is some buggy snow near Varrock sword shop, let's hide it. I know, this is not ideal, but it does work.
|
||||
private static final int anIntArray152[] = {1, 2, 4, 8};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user