Little bit of client fun for Easter. Lasts until the 8th.

This commit is contained in:
Woah 2021-03-31 07:38:55 -04:00
parent b6495f8d33
commit e6d109bad0
6 changed files with 29 additions and 20 deletions

View file

@ -55,17 +55,6 @@ final class Class163_Sub2_Sub1 extends Class163_Sub2 {
}
}
// static void method2222() {
// try {
// Unsorted.aReferenceCache_4043.clearSoftReferences();
// CS2Script.aReferenceCache_2442.clearSoftReferences();
// Class154.aReferenceCache_1964.clearSoftReferences();
//
// } catch (RuntimeException var2) {
// throw ClientErrorException.clientError(var2, "t.G(" + (byte) 127 + ')');
// }
// }
static void method2223(boolean var0, byte var1) {
try {
byte var3;

View file

@ -221,7 +221,7 @@ public final class Class40 {
TextureOperation26.method198(false);
if (null != TextureOperation35.aByteArrayArray3335) {
TextureOperation37.method272((byte) -124);
TextureOperation37.displayNPCOnLoginRegion();
}
}

View file

@ -1538,7 +1538,15 @@ public final class Client extends GameShell {
Class3_Sub26.aClass3_Sub24_Sub2_2563 = new Class3_Sub24_Sub2();
Class3_Sub21.aAudioChannel_2491.method2154(Class3_Sub26.aClass3_Sub24_Sub2_2563);
Class27.resampler = new Class157(22050, Class21.sampleRate);
KeyboardListener.loginThemeSongArchiveID = CacheIndex.musicIndex.getArchiveForName(RSString.parse(GameConfig.LOGIN_THEME));
int loginThemeID;
if (GameConfig.EASTER_EVENT_ENABLED) {
loginThemeID = CacheIndex.musicIndex.getArchiveForName(RSString.parse("Funny Bunnies"));
} else {
loginThemeID = CacheIndex.musicIndex.getArchiveForName(RSString.parse(GameConfig.LOGIN_THEME));
}
KeyboardListener.loginThemeSongArchiveID = loginThemeID;
LoadingStageNumber = 30;
anInt1354 = 50;
loadingBarTextToDisplay = TextCore.PreparedSoundEngine;

View file

@ -1,4 +1,5 @@
package org.runite.client;
import org.rs09.client.config.GameConfig;
import org.rs09.client.net.Connection;
import java.io.IOException;
@ -240,11 +241,8 @@ final class TextureOperation37 extends TextureOperation {
}
}
static void method272(byte var0) {
static void displayNPCOnLoginRegion() {
try {
if(var0 != -124) {
aClass3_Sub28_Sub3_3264 = null;
}
int var1 = TextureOperation35.aByteArrayArray3335.length;
@ -275,7 +273,13 @@ final class TextureOperation37 extends TextureOperation {
int var11 = var9 + 64 * (Class3_Sub24_Sub3.anIntArray3494[var2] >> 8) - Class131.anInt1716;
int var10 = var7 & 63;
int var12 = var10 + -Texture.anInt1152 + 64 * (255 & Class3_Sub24_Sub3.anIntArray3494[var2]);
NPCDefinition var13 = NPCDefinition.getNPCDefinition(var16.readUnsignedShort());
int npcID = var16.readUnsignedShort();
if (GameConfig.EASTER_EVENT_ENABLED) {
npcID = 1321;
}
NPCDefinition var13 = NPCDefinition.getNPCDefinition(npcID);
if(NPC.npcs[var6] == null && (var13.aByte1267 & 1) > 0 && Class140_Sub3.anInt2745 == var8 && var11 >= 0 && 104 > var13.size + var11 && var12 >= 0 && 104 > var12 - -var13.size) {
NPC.npcs[var6] = new NPC();
NPC npc = NPC.npcs[var6];
@ -297,7 +301,7 @@ final class TextureOperation37 extends TextureOperation {
}
} catch (RuntimeException var15) {
throw ClientErrorException.clientError(var15, "mh.E(" + var0 + ')');
throw ClientErrorException.clientError(var15, "mh.E(" + (byte) -124 + ')');
}
}

View file

@ -320,6 +320,8 @@ class GameConfig {
@JvmField
var HOLIDAYS_ENABLED = true
@JvmField
var EASTER_EVENT_ENABLED = false
/**
* Halloween event NPC Definitions are handled inside of NPCDefinition.java
*/
@ -334,11 +336,17 @@ class GameConfig {
private val calendar: Calendar = Calendar.getInstance()
private val month = calendar.get(Calendar.MONTH)
private val day = calendar.get(Calendar.DAY_OF_MONTH)
@JvmStatic
fun implementHoliday() {
if (HOLIDAYS_ENABLED) {
when (month) {
3 -> {
if (day <= 8) {
EASTER_EVENT_ENABLED = true
}
}
9 -> HALLOWEEN_EVENT_ENABLED = true
10 -> THANKSGIVING_EVENT_ENABLED = true
11 -> CHRISTMAS_EVENT_ENABLED = true

View file

@ -255,7 +255,7 @@ object DeveloperConsole {
}
}
"playsong" -> {
if (argSize in 2..4) {
if (argSize in 2..8) {
if (clientCommand[1].toIntOrNull() == null) {
clientCommand.removeFirst()
AudioHandler.musicHandler(