diff --git a/client/src/main/java/rt4/ClientScriptList.java b/client/src/main/java/rt4/ClientScriptList.java index 52facad..ada204b 100644 --- a/client/src/main/java/rt4/ClientScriptList.java +++ b/client/src/main/java/rt4/ClientScriptList.java @@ -36,7 +36,7 @@ public class ClientScriptList { local12.aClass133Array1 = new HashTable[local98]; for (local107 = 0; local107 < local98; local107++) { local114 = local42.g2(); - @Pc(121) HashTable local121 = new HashTable(Static165.clp2(local114)); + @Pc(121) HashTable local121 = new HashTable(IntUtils.clp2(local114)); local12.aClass133Array1[local107] = local121; while (local114-- > 0) { @Pc(136) int local136 = local42.g4(); diff --git a/client/src/main/java/rt4/EnumType.java b/client/src/main/java/rt4/EnumType.java index c4e5c4b..08d76c2 100644 --- a/client/src/main/java/rt4/EnumType.java +++ b/client/src/main/java/rt4/EnumType.java @@ -38,7 +38,7 @@ public final class EnumType extends SecondaryNode { this.defaultInt = arg1.g4(); } else if (arg0 == 5 || arg0 == 6) { @Pc(41) int size = arg1.g2(); - this.table = new HashTable(Static165.clp2(size)); + this.table = new HashTable(IntUtils.clp2(size)); for (@Pc(51) int local51 = 0; local51 < size; local51++) { @Pc(58) int local58 = arg1.g4(); @Pc(70) Node local70; diff --git a/client/src/main/java/rt4/Equipment.java b/client/src/main/java/rt4/Equipment.java index 26d2ef3..67e8c1a 100644 --- a/client/src/main/java/rt4/Equipment.java +++ b/client/src/main/java/rt4/Equipment.java @@ -14,7 +14,7 @@ public class Equipment { @Pc(12) int local12; for (local12 = 0; local12 < ObjTypeList.anInt3245; local12++) { @Pc(19) ObjType local19 = ObjTypeList.get(local12); - if (local19.manWear1 >= 0 || local19.womanWear1 >= 0) { + if (local19.manwear >= 0 || local19.womanwear >= 0) { local8[local10++] = local12; } } diff --git a/client/src/main/java/rt4/Find.java b/client/src/main/java/rt4/Find.java index b90f998..c1b4b80 100644 --- a/client/src/main/java/rt4/Find.java +++ b/client/src/main/java/rt4/Find.java @@ -54,7 +54,7 @@ public class Find { @Pc(14) int local14 = 0; for (@Pc(16) int local16 = 0; local16 < ObjTypeList.anInt3245; local16++) { @Pc(27) ObjType local27 = ObjTypeList.get(local16); - if ((!arg0 || local27.stockMarket) && local27.certificateTemplate == -1 && local27.lentTemplate == -1 && local27.dummyItem == 0 && local27.name.toLowerCase().indexOf(local12) != -1) { + if ((!arg0 || local27.stockMarket) && local27.certtemplate == -1 && local27.lentTemplate == -1 && local27.dummyItem == 0 && local27.name.toLowerCase().indexOf(local12) != -1) { if (local14 >= 250) { results = null; index = -1; diff --git a/client/src/main/java/rt4/GlAlphaSprite.java b/client/src/main/java/rt4/GlAlphaSprite.java index b158231..4705de8 100644 --- a/client/src/main/java/rt4/GlAlphaSprite.java +++ b/client/src/main/java/rt4/GlAlphaSprite.java @@ -23,8 +23,8 @@ public final class GlAlphaSprite extends GlSprite { @OriginalMember(owner = "client!el", name = "a", descriptor = "([I)V") @Override protected final void method1430(@OriginalArg(0) int[] arg0) { - this.powerOfTwoWidth = Static165.clp2(this.width); - this.powerOfTwoHeight = Static165.clp2(this.height); + this.powerOfTwoWidth = IntUtils.clp2(this.width); + this.powerOfTwoHeight = IntUtils.clp2(this.height); @Pc(20) byte[] local20 = new byte[this.powerOfTwoWidth * this.powerOfTwoHeight * 4]; @Pc(22) int local22 = 0; @Pc(24) int local24 = 0; diff --git a/client/src/main/java/rt4/GlFont.java b/client/src/main/java/rt4/GlFont.java index 2cc9b0a..cbeee31 100644 --- a/client/src/main/java/rt4/GlFont.java +++ b/client/src/main/java/rt4/GlFont.java @@ -174,7 +174,7 @@ public final class GlFont extends Font { } } this.powerOfTwoSize *= 16; - this.powerOfTwoSize = Static165.clp2(this.powerOfTwoSize); + this.powerOfTwoSize = IntUtils.clp2(this.powerOfTwoSize); int glyphSize = this.powerOfTwoSize / 16; @Pc(66) byte[] dest = new byte[this.powerOfTwoSize * this.powerOfTwoSize * 2]; for (@Pc(68) int i = 0; i < 256; i++) { diff --git a/client/src/main/java/rt4/GlIndexedSprite.java b/client/src/main/java/rt4/GlIndexedSprite.java index 856bced..841f698 100644 --- a/client/src/main/java/rt4/GlIndexedSprite.java +++ b/client/src/main/java/rt4/GlIndexedSprite.java @@ -45,8 +45,8 @@ public final class GlIndexedSprite extends IndexedSprite { @OriginalMember(owner = "client!oh", name = "a", descriptor = "([B[I)V") private void method3337(@OriginalArg(0) byte[] arg0, @OriginalArg(1) int[] arg1) { - this.anInt4287 = Static165.clp2(this.width); - this.anInt4286 = Static165.clp2(this.height); + this.anInt4287 = IntUtils.clp2(this.width); + this.anInt4286 = IntUtils.clp2(this.height); @Pc(20) byte[] local20 = new byte[this.anInt4287 * this.anInt4286 * 4]; @Pc(22) int local22 = 0; @Pc(24) int local24 = 0; diff --git a/client/src/main/java/rt4/GlSprite.java b/client/src/main/java/rt4/GlSprite.java index a2a3c1c..ff35e3f 100644 --- a/client/src/main/java/rt4/GlSprite.java +++ b/client/src/main/java/rt4/GlSprite.java @@ -443,8 +443,8 @@ public class GlSprite extends Sprite { @OriginalMember(owner = "client!cf", name = "a", descriptor = "([I)V") protected void method1430(@OriginalArg(0) int[] arg0) { - this.powerOfTwoWidth = Static165.clp2(this.width); - this.powerOfTwoHeight = Static165.clp2(this.height); + this.powerOfTwoWidth = IntUtils.clp2(this.width); + this.powerOfTwoHeight = IntUtils.clp2(this.height); @Pc(20) byte[] local20 = new byte[this.powerOfTwoWidth * this.powerOfTwoHeight * 4]; @Pc(22) int local22 = 0; @Pc(24) int local24 = 0; diff --git a/client/src/main/java/rt4/GlTile.java b/client/src/main/java/rt4/GlTile.java index a9d18c2..b5f7ed3 100644 --- a/client/src/main/java/rt4/GlTile.java +++ b/client/src/main/java/rt4/GlTile.java @@ -136,7 +136,7 @@ public final class GlTile extends Node { this.anIntArray227 = new int[this.anInt2484]; this.anIntArray231 = new int[this.anInt2484]; this.anIntArrayArray17 = new int[this.anInt2484][]; - this.aClass133_8 = new HashTable(Static165.clp2(this.anInt2482)); + this.aClass133_8 = new HashTable(IntUtils.clp2(this.anInt2482)); if (this.blend) { this.anIntArrayArray18 = new int[this.anInt2484][]; this.aBooleanArray54 = new boolean[this.anInt2484]; diff --git a/client/src/main/java/rt4/IntUtils.java b/client/src/main/java/rt4/IntUtils.java index b834a95..de8667f 100644 --- a/client/src/main/java/rt4/IntUtils.java +++ b/client/src/main/java/rt4/IntUtils.java @@ -21,4 +21,15 @@ public class IntUtils { return local15; } } + + @OriginalMember(owner = "client!nb", name = "a", descriptor = "(BI)I") + public static int clp2(@OriginalArg(1) int arg0) { + @Pc(0) int local0 = arg0 - 1; + @Pc(6) int local6 = local0 | local0 >>> 1; + @Pc(22) int local22 = local6 | local6 >>> 2; + @Pc(28) int local28 = local22 | local22 >>> 4; + @Pc(34) int local34 = local28 | local28 >>> 8; + @Pc(40) int local40 = local34 | local34 >>> 16; + return local40 + 1; + } } diff --git a/client/src/main/java/rt4/Inv.java b/client/src/main/java/rt4/Inv.java index 3c08280..c9b5283 100644 --- a/client/src/main/java/rt4/Inv.java +++ b/client/src/main/java/rt4/Inv.java @@ -165,11 +165,11 @@ public final class Inv extends Node { @OriginalMember(owner = "client!na", name = "a", descriptor = "(IBZIZIIZ)Lclient!qf;") public static Sprite renderObjectSprite(@OriginalArg(0) int shadow, @OriginalArg(2) boolean linked, @OriginalArg(3) int id, @OriginalArg(4) boolean drawText, @OriginalArg(5) int state, @OriginalArg(6) int stack, @OriginalArg(7) boolean cert) { @Pc(5) ObjType objType = ObjTypeList.get(id); - if (stack > 1 && objType.countObj != null) { + if (stack > 1 && objType.countobj != null) { @Pc(15) int stackId = -1; for (@Pc(17) int i = 0; i < 10; i++) { - if (stack >= objType.countCount[i] && objType.countCount[i] != 0) { - stackId = objType.countObj[i]; + if (stack >= objType.countco[i] && objType.countco[i] != 0) { + stackId = objType.countobj[i]; } } if (stackId != -1) { @@ -183,8 +183,8 @@ public final class Inv extends Node { } @Pc(71) SoftwareSprite linkedSprite = null; - if (objType.certificateTemplate != -1) { - linkedSprite = (SoftwareSprite) renderObjectSprite(0, true, objType.certificateLink, false, 1, 10, true); + if (objType.certtemplate != -1) { + linkedSprite = (SoftwareSprite) renderObjectSprite(0, true, objType.certlink, false, 1, 10, true); if (linkedSprite == null) { return null; } @@ -217,9 +217,9 @@ public final class Inv extends Node { zoom = (int) ((double) zoom * 1.04D); } - @Pc(176) int pitchcos = MathUtils.cos[objType.xAngle2d] * zoom >> 16; - @Pc(185) int pitchsin = MathUtils.sin[objType.xAngle2d] * zoom >> 16; - model.setCamera(objType.yAngle2d, objType.zAngle2d, objType.xAngle2d, objType.xOffset2d, pitchsin + objType.yOffset2d - model.getMinY() / 2, objType.yOffset2d + pitchcos, -1L); + @Pc(176) int pitchcos = MathUtils.cos[objType.xAngle2D] * zoom >> 16; + @Pc(185) int pitchsin = MathUtils.sin[objType.xAngle2D] * zoom >> 16; + model.setCamera(objType.yAngle2D, objType.zAngle2D, objType.xAngle2D, objType.xOffset2D, pitchsin + objType.yOffset2D - model.getMinY() / 2, objType.yOffset2D + pitchcos, -1L); if (state >= 1) { canvas.drawOutline(1); @@ -233,7 +233,7 @@ public final class Inv extends Node { canvas.drawShadow(shadow); } - if (objType.certificateTemplate != -1) { + if (objType.certtemplate != -1) { linkedSprite.render(0, 0); } else if (objType.lentTemplate != -1) { SoftwareRaster.setSize(linkedSprite.pixels, canvasWidth, canvasHeight); diff --git a/client/src/main/java/rt4/JavaAudioChannel.java b/client/src/main/java/rt4/JavaAudioChannel.java index ebc0afe..d4018b0 100644 --- a/client/src/main/java/rt4/JavaAudioChannel.java +++ b/client/src/main/java/rt4/JavaAudioChannel.java @@ -81,7 +81,7 @@ public final class JavaAudioChannel extends AudioChannel { this.aSourceDataLine1 = null; throw local36; } else { - this.open(Static165.clp2(arg0)); + this.open(IntUtils.clp2(arg0)); } } } diff --git a/client/src/main/java/rt4/Light_Class45.java b/client/src/main/java/rt4/Light_Class45.java index 83fc294..9203a77 100644 --- a/client/src/main/java/rt4/Light_Class45.java +++ b/client/src/main/java/rt4/Light_Class45.java @@ -178,7 +178,7 @@ public final class Light_Class45 { this.aByteArray25 = new byte[this.anInt2019]; this.aByteArray23 = new byte[this.anInt2019]; this.aByteArray24 = new byte[this.anInt2019]; - this.aClass133_4 = new HashTable(Static165.clp2(this.anInt2019)); + this.aClass133_4 = new HashTable(IntUtils.clp2(this.anInt2019)); } @OriginalMember(owner = "client!fj", name = "c", descriptor = "()V") diff --git a/client/src/main/java/rt4/LocType.java b/client/src/main/java/rt4/LocType.java index 1a81ff6..b30a1a7 100644 --- a/client/src/main/java/rt4/LocType.java +++ b/client/src/main/java/rt4/LocType.java @@ -593,7 +593,7 @@ public final class LocType { } else if (arg1 == 249) { defaultMultiLoc = arg0.g1(); if (this.params == null) { - len = Static165.clp2(defaultMultiLoc); + len = IntUtils.clp2(defaultMultiLoc); this.params = new HashTable(len); } for (len = 0; len < defaultMultiLoc; len++) { diff --git a/client/src/main/java/rt4/MiniMenu.java b/client/src/main/java/rt4/MiniMenu.java index 087e860..a9bfe43 100644 --- a/client/src/main/java/rt4/MiniMenu.java +++ b/client/src/main/java/rt4/MiniMenu.java @@ -158,15 +158,15 @@ public class MiniMenu { @Pc(276) ObjType local276 = ObjTypeList.get(component.objTypes[local171] - 1); if (anInt5014 == 1 && local267.isObjOpsEnabled()) { if (Static224.anInt5062 != component.id || Static185.anInt4370 != local171) { - add(-1, (long) local276.anInt2354, JagString.concatenate(new JagString[] { aClass100_203, aClass100_947, local276.name}), local171, (short) 40, LocalizedText.USE, component.id); + add(-1, (long) local276.id, JagString.concatenate(new JagString[] { aClass100_203, aClass100_947, local276.name}), local171, (short) 40, LocalizedText.USE, component.id); } } else if (Static241.aBoolean302 && local267.isObjOpsEnabled()) { @Pc(596) ParamType local596 = Static121.anInt3039 == -1 ? null : ParamTypeList.get(Static121.anInt3039); if ((anInt4999 & 0x10) != 0 && (local596 == null || local276.getParam(local596.defaultInt, Static121.anInt3039) != local596.defaultInt)) { - add(anInt5393, (long) local276.anInt2354, JagString.concatenate(new JagString[] { aClass100_466, aClass100_947, local276.name}), local171, (short) 3, aClass100_545, component.id); + add(anInt5393, (long) local276.id, JagString.concatenate(new JagString[] { aClass100_466, aClass100_947, local276.name}), local171, (short) 3, aClass100_545, component.id); } } else { - @Pc(296) JagString[] local296 = local276.inventoryOps; + @Pc(296) JagString[] local296 = local276.iops; if (aBoolean237) { local296 = annotateOps(local296); } @@ -180,12 +180,12 @@ public class MiniMenu { } else { local334 = 58; } - add(-1, (long) local276.anInt2354, JagString.concatenate(new JagString[] { aClass100_32, local276.name}), local171, local334, local296[local309], component.id); + add(-1, (long) local276.id, JagString.concatenate(new JagString[] { aClass100_32, local276.name}), local171, local334, local296[local309], component.id); } } } if (local267.method507()) { - add(Static169.anInt4075, (long) local276.anInt2354, JagString.concatenate(new JagString[] { aClass100_32, local276.name}), local171, (short) 22, LocalizedText.USE, component.id); + add(Static169.anInt4075, (long) local276.id, JagString.concatenate(new JagString[] { aClass100_32, local276.name}), local171, (short) 22, LocalizedText.USE, component.id); } if (local267.isObjOpsEnabled() && local296 != null) { for (local309 = 2; local309 >= 0; local309--) { @@ -200,7 +200,7 @@ public class MiniMenu { if (local309 == 2) { local334 = 43; } - add(-1, (long) local276.anInt2354, JagString.concatenate(new JagString[] { aClass100_32, local276.name}), local171, local334, local296[local309], component.id); + add(-1, (long) local276.id, JagString.concatenate(new JagString[] { aClass100_32, local276.name}), local171, local334, local296[local309], component.id); } } } @@ -227,11 +227,11 @@ public class MiniMenu { if (local309 == 4) { local334 = 13; } - add(-1, (long) local276.anInt2354, JagString.concatenate(new JagString[] { aClass100_32, local276.name}), local171, local334, local296[local309], component.id); + add(-1, (long) local276.id, JagString.concatenate(new JagString[] { aClass100_32, local276.name}), local171, local334, local296[local309], component.id); } } } - add(Static225.anInt5073, (long) local276.anInt2354, JagString.concatenate(new JagString[] { aClass100_32, local276.name}), local171, (short) 1006, LocalizedText.EXAMINE, component.id); + add(Static225.anInt5073, (long) local276.id, JagString.concatenate(new JagString[] { aClass100_32, local276.name}), local171, (short) 1006, LocalizedText.EXAMINE, component.id); } } } diff --git a/client/src/main/java/rt4/NpcType.java b/client/src/main/java/rt4/NpcType.java index b132e69..8047ca2 100644 --- a/client/src/main/java/rt4/NpcType.java +++ b/client/src/main/java/rt4/NpcType.java @@ -732,7 +732,7 @@ public final class NpcType { } else if (arg0 == 249) { count = arg1.g1(); if (this.params == null) { - local18 = Static165.clp2(count); + local18 = IntUtils.clp2(count); this.params = new HashTable(local18); } for (local18 = 0; local18 < count; local18++) { diff --git a/client/src/main/java/rt4/ObjType.java b/client/src/main/java/rt4/ObjType.java index 82ce875..cdd5742 100644 --- a/client/src/main/java/rt4/ObjType.java +++ b/client/src/main/java/rt4/ObjType.java @@ -9,52 +9,52 @@ import org.openrs2.deob.annotation.Pc; public final class ObjType { @OriginalMember(owner = "client!h", name = "a", descriptor = "[S") - private short[] retextureDestination; + private short[] retex_s; @OriginalMember(owner = "client!h", name = "g", descriptor = "I") private int model; @OriginalMember(owner = "client!h", name = "y", descriptor = "[S") - private short[] retextureSource; + private short[] retex_d; @OriginalMember(owner = "client!h", name = "z", descriptor = "[I") - public int[] countCount; + public int[] countco; @OriginalMember(owner = "client!h", name = "G", descriptor = "[S") - private short[] recolorSource; + private short[] recol_s; @OriginalMember(owner = "client!h", name = "I", descriptor = "[S") - private short[] recolorDestination; + private short[] recol_d; @OriginalMember(owner = "client!h", name = "W", descriptor = "[B") private byte[] recolorDestinationPalette; @OriginalMember(owner = "client!h", name = "Y", descriptor = "I") - public int anInt2354; + public int id; @OriginalMember(owner = "client!h", name = "nb", descriptor = "Lclient!sc;") public HashTable params; @OriginalMember(owner = "client!h", name = "tb", descriptor = "[I") - public int[] countObj; + public int[] countobj; @OriginalMember(owner = "client!h", name = "h", descriptor = "I") public int cursor2 = -1; @OriginalMember(owner = "client!h", name = "K", descriptor = "I") - private int womanWear3 = -1; + private int womanwear3 = -1; @OriginalMember(owner = "client!h", name = "l", descriptor = "I") public int cost = 1; @OriginalMember(owner = "client!h", name = "e", descriptor = "I") - private int womanHead2 = -1; + private int womanhead2 = -1; @OriginalMember(owner = "client!h", name = "q", descriptor = "I") private int manWearXOff = 0; @OriginalMember(owner = "client!h", name = "H", descriptor = "I") - private int womanHead = -1; + private int womanhead = -1; @OriginalMember(owner = "client!h", name = "T", descriptor = "I") public int team = 0; @@ -69,13 +69,13 @@ public final class ObjType { private int ambient = 0; @OriginalMember(owner = "client!h", name = "C", descriptor = "I") - private int manWear3 = -1; + private int manwear3 = -1; @OriginalMember(owner = "client!h", name = "ib", descriptor = "I") - private int manHead2 = -1; + private int manhead2 = -1; @OriginalMember(owner = "client!h", name = "cb", descriptor = "I") - public int certificateTemplate = -1; + public int certtemplate = -1; @OriginalMember(owner = "client!h", name = "M", descriptor = "I") private int womanWearXOff = 0; @@ -90,7 +90,7 @@ public final class ObjType { public int cursor1 = -1; @OriginalMember(owner = "client!h", name = "B", descriptor = "I") - public int zAngle2d = 0; + public int zAngle2D = 0; @OriginalMember(owner = "client!h", name = "u", descriptor = "I") public int lentTemplate = -1; @@ -99,19 +99,19 @@ public final class ObjType { public int lentLink = -1; @OriginalMember(owner = "client!h", name = "r", descriptor = "I") - public int womanWear1 = -1; + public int womanwear = -1; @OriginalMember(owner = "client!h", name = "F", descriptor = "I") - private int manWear2 = -1; + private int manwear2 = -1; @OriginalMember(owner = "client!h", name = "f", descriptor = "I") - public int yOffset2d = 0; + public int yOffset2D = 0; @OriginalMember(owner = "client!h", name = "X", descriptor = "I") - public int xAngle2d = 0; + public int xAngle2D = 0; @OriginalMember(owner = "client!h", name = "ob", descriptor = "I") - public int yAngle2d = 0; + public int yAngle2D = 0; @OriginalMember(owner = "client!h", name = "pb", descriptor = "I") public int dummyItem = 0; @@ -120,10 +120,10 @@ public final class ObjType { public int stackable = 0; @OriginalMember(owner = "client!h", name = "ab", descriptor = "I") - public int certificateLink = -1; + public int certlink = -1; @OriginalMember(owner = "client!h", name = "fb", descriptor = "I") - private int womanWear2 = -1; + private int womanwear2 = -1; @OriginalMember(owner = "client!h", name = "Z", descriptor = "I") public int cursor2Op = -1; @@ -138,16 +138,16 @@ public final class ObjType { private int womanWearZOff = 0; @OriginalMember(owner = "client!h", name = "db", descriptor = "I") - public int xOffset2d = 0; + public int xOffset2D = 0; @OriginalMember(owner = "client!h", name = "sb", descriptor = "I") - private int manHead = -1; + private int manhead = -1; @OriginalMember(owner = "client!h", name = "rb", descriptor = "I") private int womanWearYOff = 0; @OriginalMember(owner = "client!h", name = "eb", descriptor = "I") - public int manWear1 = -1; + public int manwear = -1; @OriginalMember(owner = "client!h", name = "qb", descriptor = "[Lclient!na;") public JagString[] ops = new JagString[] { null, null, LocalizedText.TAKE, null, null }; @@ -162,7 +162,7 @@ public final class ObjType { private int manWearYOff = 0; @OriginalMember(owner = "client!h", name = "U", descriptor = "[Lclient!na;") - public JagString[] inventoryOps = new JagString[] { null, null, null, null, LocalizedText.DROP}; + public JagString[] iops = new JagString[] { null, null, null, null, LocalizedText.DROP}; @OriginalMember(owner = "client!h", name = "Ab", descriptor = "I") public int zoom2d = 2000; @@ -170,484 +170,518 @@ public final class ObjType { @OriginalMember(owner = "client!h", name = "xb", descriptor = "Z") public boolean stockMarket = false; - static { - @Pc(4) int local4 = 0; - for (@Pc(6) int local6 = 0; local6 < 99; local6++) { - @Pc(13) int local13 = local6 + 1; - @Pc(26) int local26 = (int) (Math.pow(2.0D, (double) local13 / 7.0D) * 300.0D + (double) local13); - local4 += local26; - PlayerSkillXpTable.xpLevelLookup[local6] = local4 / 4; - } - } - @OriginalMember(owner = "client!h", name = "a", descriptor = "(ZZ)Z") - public final boolean method1816(@OriginalArg(0) boolean arg0) { - @Pc(6) int local6 = this.manHead; - @Pc(9) int local9 = this.manHead2; - if (arg0) { - local6 = this.womanHead; - local9 = this.womanHead2; + public final boolean method1816(@OriginalArg(0) boolean female) { + @Pc(6) int manhead1 = this.manhead; + @Pc(9) int manhead2 = this.manhead2; + if (female) { + manhead1 = this.womanhead; + manhead2 = this.womanhead2; } - if (local6 == -1) { + if (manhead1 == -1) { return true; } - @Pc(33) boolean local33 = true; - if (!ObjTypeList.modelsArchive.isFileReady(0, local6)) { - local33 = false; + @Pc(33) boolean ready = true; + if (!ObjTypeList.modelsArchive.isFileReady(0, manhead1)) { + ready = false; } - if (local9 != -1 && !ObjTypeList.modelsArchive.isFileReady(0, local9)) { - local33 = false; + if (manhead2 != -1 && !ObjTypeList.modelsArchive.isFileReady(0, manhead2)) { + ready = false; } - return local33; + return ready; } @OriginalMember(owner = "client!h", name = "a", descriptor = "(ILclient!na;I)Lclient!na;") - public final JagString getParam(@OriginalArg(1) JagString arg0, @OriginalArg(2) int arg1) { + public final JagString getParam(@OriginalArg(1) JagString defaultValue, @OriginalArg(2) int id) { if (this.params == null) { - return arg0; + return defaultValue; } else { - @Pc(21) StringNode local21 = (StringNode) this.params.get((long) arg1); - return local21 == null ? arg0 : local21.value; + @Pc(21) StringNode node = (StringNode) this.params.get(id); + return node == null ? defaultValue : node.value; } } @OriginalMember(owner = "client!h", name = "a", descriptor = "(II)Lclient!h;") - public final ObjType method1820(@OriginalArg(0) int arg0) { - if (this.countObj != null && arg0 > 1) { - @Pc(23) int local23 = -1; - for (@Pc(25) int local25 = 0; local25 < 10; local25++) { - if (this.countCount[local25] <= arg0 && this.countCount[local25] != 0) { - local23 = this.countObj[local25]; + public final ObjType method1820(@OriginalArg(0) int count) { + if (this.countobj != null && count > 1) { + @Pc(23) int countId = -1; + for (@Pc(25) int i = 0; i < 10; i++) { + if (this.countco[i] <= count && this.countco[i] != 0) { + countId = this.countobj[i]; } } - if (local23 != -1) { - return ObjTypeList.get(local23); + if (countId != -1) { + return ObjTypeList.get(countId); } } return this; } @OriginalMember(owner = "client!h", name = "a", descriptor = "(BZ)Z") - public final boolean method1822(@OriginalArg(1) boolean arg0) { - @Pc(6) int local6 = this.manWear2; - @Pc(9) int local9 = this.manWear1; - @Pc(20) int local20 = this.manWear3; - if (arg0) { - local20 = this.womanWear3; - local9 = this.womanWear1; - local6 = this.womanWear2; + public final boolean method1822(@OriginalArg(1) boolean female) { + @Pc(6) int wear2 = this.manwear2; + @Pc(9) int wear1 = this.manwear; + @Pc(20) int wear3 = this.manwear3; + if (female) { + wear3 = this.womanwear3; + wear1 = this.womanwear; + wear2 = this.womanwear2; } - if (local9 == -1) { + if (wear1 == -1) { return true; } - @Pc(41) boolean local41 = true; - if (!ObjTypeList.modelsArchive.isFileReady(0, local9)) { - local41 = false; + @Pc(41) boolean ready = true; + if (!ObjTypeList.modelsArchive.isFileReady(0, wear1)) { + ready = false; } - if (local6 != -1 && !ObjTypeList.modelsArchive.isFileReady(0, local6)) { - local41 = false; + if (wear2 != -1 && !ObjTypeList.modelsArchive.isFileReady(0, wear2)) { + ready = false; } - if (local20 != -1 && !ObjTypeList.modelsArchive.isFileReady(0, local20)) { - local41 = false; + if (wear3 != -1 && !ObjTypeList.modelsArchive.isFileReady(0, wear3)) { + ready = false; } - return local41; + return ready; } @OriginalMember(owner = "client!h", name = "a", descriptor = "(BLclient!h;Lclient!h;)V") - public final void method1823(@OriginalArg(1) ObjType arg0, @OriginalArg(2) ObjType arg1) { - this.recolorDestinationPalette = arg0.recolorDestinationPalette; - this.manWearYOff = arg0.manWearYOff; - this.params = arg0.params; - this.manWear3 = arg0.manWear3; - this.womanWear1 = arg0.womanWear1; - this.manWearZOff = arg0.manWearZOff; - this.inventoryOps = new JagString[5]; - this.model = arg1.model; - this.zoom2d = arg1.zoom2d; + public final void generateLent(@OriginalArg(1) ObjType link, @OriginalArg(2) ObjType template) { + this.recolorDestinationPalette = link.recolorDestinationPalette; + this.manWearYOff = link.manWearYOff; + this.params = link.params; + this.manwear3 = link.manwear3; + this.womanwear = link.womanwear; + this.manWearZOff = link.manWearZOff; + this.iops = new JagString[5]; + this.model = template.model; + this.zoom2d = template.zoom2d; this.cost = 0; - this.team = arg0.team; - this.womanHead = arg0.womanHead; - this.recolorDestination = arg0.recolorDestination; - this.zAngle2d = arg1.zAngle2d; - this.manWear2 = arg0.manWear2; - this.yAngle2d = arg1.yAngle2d; - this.manHead = arg0.manHead; - this.manHead2 = arg0.manHead2; - this.manWearXOff = arg0.manWearXOff; - this.xAngle2d = arg1.xAngle2d; - this.yOffset2d = arg1.yOffset2d; - this.womanHead2 = arg0.womanHead2; - this.womanWearXOff = arg0.womanWearXOff; - this.recolorSource = arg0.recolorSource; - this.womanWearYOff = arg0.womanWearYOff; - this.womanWearZOff = arg0.womanWearZOff; - this.xOffset2d = arg1.xOffset2d; - this.manWear1 = arg0.manWear1; - this.womanWear2 = arg0.womanWear2; - this.name = arg0.name; - this.retextureDestination = arg0.retextureDestination; - this.retextureSource = arg0.retextureSource; - this.ops = arg0.ops; - this.members = arg0.members; - this.womanWear3 = arg0.womanWear3; - if (arg0.inventoryOps != null) { + this.team = link.team; + this.womanhead = link.womanhead; + this.recol_d = link.recol_d; + this.zAngle2D = template.zAngle2D; + this.manwear2 = link.manwear2; + this.yAngle2D = template.yAngle2D; + this.manhead = link.manhead; + this.manhead2 = link.manhead2; + this.manWearXOff = link.manWearXOff; + this.xAngle2D = template.xAngle2D; + this.yOffset2D = template.yOffset2D; + this.womanhead2 = link.womanhead2; + this.womanWearXOff = link.womanWearXOff; + this.recol_s = link.recol_s; + this.womanWearYOff = link.womanWearYOff; + this.womanWearZOff = link.womanWearZOff; + this.xOffset2D = template.xOffset2D; + this.manwear = link.manwear; + this.womanwear2 = link.womanwear2; + this.name = link.name; + this.retex_s = link.retex_s; + this.retex_d = link.retex_d; + this.ops = link.ops; + this.members = link.members; + this.womanwear3 = link.womanwear3; + if (link.iops != null) { for (@Pc(157) int local157 = 0; local157 < 4; local157++) { - this.inventoryOps[local157] = arg0.inventoryOps[local157]; + this.iops[local157] = link.iops[local157]; } } - this.inventoryOps[4] = LocalizedText.LENT_ITEM_RETURN; + this.iops[4] = LocalizedText.LENT_ITEM_RETURN; } @OriginalMember(owner = "client!h", name = "a", descriptor = "(IIILclient!tk;II)Lclient!ak;") - public final Model getModel(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) SeqType arg2, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4) { - if (this.countObj != null && arg3 > 1) { - @Pc(22) int local22 = -1; - for (@Pc(24) int local24 = 0; local24 < 10; local24++) { - if (arg3 >= this.countCount[local24] && this.countCount[local24] != 0) { - local22 = this.countObj[local24]; + public final Model getModel(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) SeqType seqType, @OriginalArg(4) int count, @OriginalArg(5) int arg4) { + if (this.countobj != null && count > 1) { + @Pc(22) int countId = -1; + for (@Pc(24) int i = 0; i < 10; i++) { + if (count >= this.countco[i] && this.countco[i] != 0) { + countId = this.countobj[i]; } } - if (local22 != -1) { - return ObjTypeList.get(local22).getModel(arg0, arg1, arg2, 1, arg4); + if (countId != -1) { + return ObjTypeList.get(countId).getModel(arg0, arg1, seqType, 1, arg4); } } - @Pc(76) Model local76 = (Model) ObjTypeList.models.get((long) this.anInt2354); - if (local76 == null) { - @Pc(85) RawModel local85 = RawModel.create(ObjTypeList.modelsArchive, this.model); - if (local85 == null) { + @Pc(76) Model model = (Model) ObjTypeList.models.get(this.id); + if (model == null) { + @Pc(85) RawModel model2 = RawModel.create(ObjTypeList.modelsArchive, this.model); + if (model2 == null) { return null; } - @Pc(97) int local97; - if (this.recolorDestination != null) { - for (local97 = 0; local97 < this.recolorDestination.length; local97++) { - if (this.recolorDestinationPalette == null || local97 >= this.recolorDestinationPalette.length) { - local85.recolor(this.recolorDestination[local97], this.recolorSource[local97]); + @Pc(97) int i; + if (this.recol_d != null) { + for (i = 0; i < this.recol_d.length; i++) { + if (this.recolorDestinationPalette == null || i >= this.recolorDestinationPalette.length) { + model2.recolor(this.recol_d[i], this.recol_s[i]); } else { - local85.recolor(this.recolorDestination[local97], client.aShortArray87[this.recolorDestinationPalette[local97] & 0xFF]); + model2.recolor(this.recol_d[i], client.aShortArray87[this.recolorDestinationPalette[i] & 0xFF]); } } } - if (this.retextureSource != null) { - for (local97 = 0; local97 < this.retextureSource.length; local97++) { - local85.retexture(this.retextureSource[local97], this.retextureDestination[local97]); + if (this.retex_d != null) { + for (i = 0; i < this.retex_d.length; i++) { + model2.retexture(this.retex_d[i], this.retex_s[i]); } } - local76 = local85.createModel(this.ambient + 64, this.contrast + 768, -50, -10, -50); + model = model2.createModel(this.ambient + 64, this.contrast + 768, -50, -10, -50); if (this.resizeX != 128 || this.resizeY != 128 || this.resizeZ != 128) { - local76.resize(this.resizeX, this.resizeY, this.resizeZ); + model.resize(this.resizeX, this.resizeY, this.resizeZ); } - local76.aBoolean303 = true; + model.aBoolean303 = true; if (GlRenderer.enabled) { - ((GlModel) local76).method4111(false, false, false, false, false, true); + ((GlModel) model).method4111(false, false, false, false, false, true); } - ObjTypeList.models.put(local76, (long) this.anInt2354); + ObjTypeList.models.put(model, this.id); } - if (arg2 != null) { - local76 = arg2.method4215(local76, arg0, arg1, arg4); + if (seqType != null) { + model = seqType.method4215(model, arg0, arg1, arg4); } - return local76; + return model; } @OriginalMember(owner = "client!h", name = "c", descriptor = "(I)V") - public final void method1826() { + public final void postDecode() { } @OriginalMember(owner = "client!h", name = "a", descriptor = "(ILclient!wa;)V") - public final void decode(@OriginalArg(1) Buffer arg0) { + public final void decode(@OriginalArg(1) Buffer buffer) { while (true) { - @Pc(5) int local5 = arg0.g1(); - if (local5 == 0) { + @Pc(5) int code = buffer.g1(); + if (code == 0) { return; } - this.decode(arg0, local5); + this.decode(buffer, code); } } + public static class Opcodes { + + public static final int model = 1; + public static final int name = 2; + public static final int zoom2d = 4; + public static final int xan2d = 5; + public static final int yan2d = 6; + public static final int xof2d = 7; + public static final int yof2d = 8; + public static final int stackable_yes = 11; + public static final int cost = 12; + public static final int members = 16; + public static final int manwear = 23; + public static final int manwear2 = 24; + public static final int womanwear = 25; + public static final int womanwear2 = 26; + public static final int op1 = 30; + public static final int op5 = 34; + public static final int iop1 = 35; + public static final int iop5 = 39; + public static final int recol = 40; + public static final int retex = 41; + public static final int stockmarket_yes = 65; + public static final int manwear3 = 78; + public static final int womanwear3 = 79; + public static final int manhead = 90; + public static final int womanhead = 91; + public static final int manhead2 = 92; + public static final int womanhead2 = 93; + public static final int zan2d = 95; + public static final int certlink = 97; + public static final int certtemplate = 98; + public static final int countobj1 = 100; + public static final int countobj10 = 109; + public static final int resizex = 110; + public static final int resizey = 111; + public static final int resizez = 112; + public static final int ambient = 113; + public static final int contrast = 114; + public static final int team = 115; + public static final int params = 249; + + } + @OriginalMember(owner = "client!h", name = "a", descriptor = "(BLclient!wa;I)V") - private void decode(@OriginalArg(1) Buffer arg0, @OriginalArg(2) int arg1) { - if (arg1 == 1) { - this.model = arg0.g2(); - } else if (arg1 == 2) { - this.name = arg0.gjstr(); - } else if (arg1 == 4) { - this.zoom2d = arg0.g2(); - } else if (arg1 == 5) { - this.xAngle2d = arg0.g2(); - } else if (arg1 == 6) { - this.yAngle2d = arg0.g2(); - } else if (arg1 == 7) { - this.xOffset2d = arg0.g2(); - if (this.xOffset2d > 32767) { - this.xOffset2d -= 65536; + private void decode(@OriginalArg(1) Buffer buffer, @OriginalArg(2) int opcode) { + if (opcode == Opcodes.model) { // 1 + this.model = buffer.g2(); + } else if (opcode == Opcodes.name) { // 2 + this.name = buffer.gjstr(); + } else if (opcode == Opcodes.zoom2d) { // 4 + this.zoom2d = buffer.g2(); + } else if (opcode == Opcodes.xan2d) { // 5 + this.xAngle2D = buffer.g2(); + } else if (opcode == Opcodes.yan2d) { // 6 + this.yAngle2D = buffer.g2(); + } else if (opcode == Opcodes.xof2d) { // 7 + this.xOffset2D = buffer.g2(); + if (this.xOffset2D > 32767) { + this.xOffset2D -= 65536; } - } else if (arg1 == 8) { - this.yOffset2d = arg0.g2(); - if (this.yOffset2d > 32767) { - this.yOffset2d -= 65536; + } else if (opcode == Opcodes.yof2d) { // 8 + this.yOffset2D = buffer.g2(); + if (this.yOffset2D > 32767) { + this.yOffset2D -= 65536; } - } else if (arg1 == 11) { + } else if (opcode == Opcodes.stackable_yes) { // 11 this.stackable = 1; - } else if (arg1 == 12) { - this.cost = arg0.g4(); - } else if (arg1 == 16) { + } else if (opcode == Opcodes.cost) { // 12 + this.cost = buffer.g4(); + } else if (opcode == Opcodes.members) { // 16 this.members = true; - } else if (arg1 == 23) { - this.manWear1 = arg0.g2(); - } else if (arg1 == 24) { - this.manWear2 = arg0.g2(); - } else if (arg1 == 25) { - this.womanWear1 = arg0.g2(); - } else if (arg1 == 26) { - this.womanWear2 = arg0.g2(); - } else if (arg1 >= 30 && arg1 < 35) { - this.ops[arg1 - 30] = arg0.gjstr(); - if (this.ops[arg1 - 30].equalsIgnoreCase(LocalizedText.HIDDEN)) { - this.ops[arg1 - 30] = null; + } else if (opcode == Opcodes.manwear) { // 23 + this.manwear = buffer.g2(); + } else if (opcode == Opcodes.manwear2) { // 24 + this.manwear2 = buffer.g2(); + } else if (opcode == Opcodes.womanwear) { // 25 + this.womanwear = buffer.g2(); + } else if (opcode == Opcodes.womanwear2) { // 26 + this.womanwear2 = buffer.g2(); + } else if (opcode >= Opcodes.op1 && opcode <= Opcodes.op5) { // 30-34 + this.ops[opcode - Opcodes.op1] = buffer.gjstr(); + if (this.ops[opcode - Opcodes.op1].equalsIgnoreCase(LocalizedText.HIDDEN)) { + this.ops[opcode - Opcodes.op1] = null; } - } else if (arg1 >= 35 && arg1 < 40) { - this.inventoryOps[arg1 - 35] = arg0.gjstr(); + } else if (opcode >= Opcodes.iop1 && opcode <= Opcodes.iop5) { // 35-39 + this.iops[opcode - Opcodes.iop1] = buffer.gjstr(); } else { - @Pc(169) int local169; - @Pc(179) int local179; - if (arg1 == 40) { - local169 = arg0.g1(); - this.recolorSource = new short[local169]; - this.recolorDestination = new short[local169]; - for (local179 = 0; local179 < local169; local179++) { - this.recolorDestination[local179] = (short) arg0.g2(); - this.recolorSource[local179] = (short) arg0.g2(); + @Pc(169) int count; + @Pc(179) int i; + if (opcode == Opcodes.recol) { // 40 + count = buffer.g1(); + this.recol_s = new short[count]; + this.recol_d = new short[count]; + for (i = 0; i < count; i++) { + this.recol_d[i] = (short) buffer.g2(); + this.recol_s[i] = (short) buffer.g2(); } - } else if (arg1 == 41) { - local169 = arg0.g1(); - this.retextureDestination = new short[local169]; - this.retextureSource = new short[local169]; - for (local179 = 0; local179 < local169; local179++) { - this.retextureSource[local179] = (short) arg0.g2(); - this.retextureDestination[local179] = (short) arg0.g2(); + } else if (opcode == Opcodes.retex) { // 41 + count = buffer.g1(); + this.retex_s = new short[count]; + this.retex_d = new short[count]; + for (i = 0; i < count; i++) { + this.retex_d[i] = (short) buffer.g2(); + this.retex_s[i] = (short) buffer.g2(); } - } else if (arg1 == 42) { - local169 = arg0.g1(); - this.recolorDestinationPalette = new byte[local169]; - for (local179 = 0; local179 < local169; local179++) { - this.recolorDestinationPalette[local179] = arg0.g1b(); + } else if (opcode == 42) { + count = buffer.g1(); + this.recolorDestinationPalette = new byte[count]; + for (i = 0; i < count; i++) { + this.recolorDestinationPalette[i] = buffer.g1b(); } - } else if (arg1 == 65) { + } else if (opcode == Opcodes.stockmarket_yes) { // 65 this.stockMarket = true; - } else if (arg1 == 78) { - this.manWear3 = arg0.g2(); - } else if (arg1 == 79) { - this.womanWear3 = arg0.g2(); - } else if (arg1 == 90) { - this.manHead = arg0.g2(); - } else if (arg1 == 91) { - this.womanHead = arg0.g2(); - } else if (arg1 == 92) { - this.manHead2 = arg0.g2(); - } else if (arg1 == 93) { - this.womanHead2 = arg0.g2(); - } else if (arg1 == 95) { - this.zAngle2d = arg0.g2(); - } else if (arg1 == 96) { - this.dummyItem = arg0.g1(); - } else if (arg1 == 97) { - this.certificateLink = arg0.g2(); - } else if (arg1 == 98) { - this.certificateTemplate = arg0.g2(); - } else if (arg1 >= 100 && arg1 < 110) { - if (this.countObj == null) { - this.countObj = new int[10]; - this.countCount = new int[10]; + } else if (opcode == Opcodes.manwear3) { // 78 + this.manwear3 = buffer.g2(); + } else if (opcode == Opcodes.womanwear3) { // 79 + this.womanwear3 = buffer.g2(); + } else if (opcode == Opcodes.manhead) { // 90 + this.manhead = buffer.g2(); + } else if (opcode == Opcodes.womanhead) { // 91 + this.womanhead = buffer.g2(); + } else if (opcode == Opcodes.manhead2) { // 92 + this.manhead2 = buffer.g2(); + } else if (opcode == Opcodes.womanhead2) { // 93 + this.womanhead2 = buffer.g2(); + } else if (opcode == Opcodes.zan2d) { // 95 + this.zAngle2D = buffer.g2(); + } else if (opcode == 96) { + this.dummyItem = buffer.g1(); + } else if (opcode == Opcodes.certlink) { // 97 + this.certlink = buffer.g2(); + } else if (opcode == Opcodes.certtemplate) { // 98 + this.certtemplate = buffer.g2(); + } else if (opcode >= Opcodes.countobj1 && opcode <= Opcodes.countobj10) { // 100-109 + if (this.countobj == null) { + this.countobj = new int[10]; + this.countco = new int[10]; } - this.countObj[arg1 - 100] = arg0.g2(); - this.countCount[arg1 - 100] = arg0.g2(); - } else if (arg1 == 110) { - this.resizeX = arg0.g2(); - } else if (arg1 == 111) { - this.resizeY = arg0.g2(); - } else if (arg1 == 112) { - this.resizeZ = arg0.g2(); - } else if (arg1 == 113) { - this.ambient = arg0.g1b(); - } else if (arg1 == 114) { - this.contrast = arg0.g1b() * 5; - } else if (arg1 == 115) { - this.team = arg0.g1(); - } else if (arg1 == 121) { - this.lentLink = arg0.g2(); - } else if (arg1 == 122) { - this.lentTemplate = arg0.g2(); - } else if (arg1 == 125) { - this.manWearXOff = arg0.g1b(); - this.manWearYOff = arg0.g1b(); - this.manWearZOff = arg0.g1b(); - } else if (arg1 == 126) { - this.womanWearXOff = arg0.g1b(); - this.womanWearYOff = arg0.g1b(); - this.womanWearZOff = arg0.g1b(); - } else if (arg1 == 127) { - this.cursor1Op = arg0.g1(); - this.cursor1 = arg0.g2(); - } else if (arg1 == 128) { - this.cursor2Op = arg0.g1(); - this.cursor2 = arg0.g2(); - } else if (arg1 == 129) { - arg0.g1(); - arg0.g2(); - } else if (arg1 == 130) { - arg0.g1(); - arg0.g2(); - } else if (arg1 == 249) { - local169 = arg0.g1(); + this.countobj[opcode - Opcodes.countobj1] = buffer.g2(); + this.countco[opcode - Opcodes.countobj1] = buffer.g2(); + } else if (opcode == Opcodes.resizex) { // 110 + this.resizeX = buffer.g2(); + } else if (opcode == Opcodes.resizey) { // 111 + this.resizeY = buffer.g2(); + } else if (opcode == Opcodes.resizez) { // 112 + this.resizeZ = buffer.g2(); + } else if (opcode == Opcodes.ambient) { // 113 + this.ambient = buffer.g1b(); + } else if (opcode == Opcodes.contrast) { // 114 + this.contrast = buffer.g1b() * 5; + } else if (opcode == Opcodes.team) { // 115 + this.team = buffer.g1(); + } else if (opcode == 121) { + this.lentLink = buffer.g2(); + } else if (opcode == 122) { + this.lentTemplate = buffer.g2(); + } else if (opcode == 125) { + this.manWearXOff = buffer.g1b(); + this.manWearYOff = buffer.g1b(); + this.manWearZOff = buffer.g1b(); + } else if (opcode == 126) { + this.womanWearXOff = buffer.g1b(); + this.womanWearYOff = buffer.g1b(); + this.womanWearZOff = buffer.g1b(); + } else if (opcode == 127) { + this.cursor1Op = buffer.g1(); + this.cursor1 = buffer.g2(); + } else if (opcode == 128) { + this.cursor2Op = buffer.g1(); + this.cursor2 = buffer.g2(); + } else if (opcode == 129) { + buffer.g1(); + buffer.g2(); + } else if (opcode == 130) { + buffer.g1(); + buffer.g2(); + } else if (opcode == Opcodes.params) { + int size = buffer.g1(); if (this.params == null) { - local179 = Static165.clp2(local169); - this.params = new HashTable(local179); + i = IntUtils.clp2(size); + this.params = new HashTable(i); } - for (local179 = 0; local179 < local169; local179++) { - @Pc(510) boolean local510 = arg0.g1() == 1; - @Pc(514) int id = arg0.g3(); + for (i = 0; i < size; i++) { + @Pc(510) boolean string = buffer.g1() == 1; + @Pc(514) int id = buffer.g3(); @Pc(523) Node node; - if (local510) { - node = new StringNode(arg0.gjstr()); + if (string) { + node = new StringNode(buffer.gjstr()); } else { - node = new IntNode(arg0.g4()); + node = new IntNode(buffer.g4()); } - this.params.put(node, (long) id); + this.params.put(node, id); } } } } @OriginalMember(owner = "client!h", name = "a", descriptor = "(III)I") - public final int getParam(@OriginalArg(0) int arg0, @OriginalArg(2) int arg1) { + public final int getParam(@OriginalArg(0) int defaultValue, @OriginalArg(2) int id) { if (this.params == null) { - return arg0; + return defaultValue; } else { - @Pc(25) IntNode local25 = (IntNode) this.params.get((long) arg1); - return local25 == null ? arg0 : local25.value; + @Pc(25) IntNode node = (IntNode) this.params.get(id); + return node == null ? defaultValue : node.value; } } @OriginalMember(owner = "client!h", name = "a", descriptor = "(ZB)Lclient!gb;") - public final RawModel getHeadModel(@OriginalArg(0) boolean arg0) { - @Pc(4) int local4 = this.manHead2; - @Pc(17) int local17 = this.manHead; - if (arg0) { - local4 = this.womanHead2; - local17 = this.womanHead; + public final RawModel getHeadModel(@OriginalArg(0) boolean female) { + @Pc(4) int head2 = this.manhead2; + @Pc(17) int head = this.manhead; + if (female) { + head2 = this.womanhead2; + head = this.womanhead; } - if (local17 == -1) { + if (head == -1) { return null; } - @Pc(36) RawModel local36 = RawModel.create(ObjTypeList.modelsArchive, local17); - if (local4 != -1) { - @Pc(44) RawModel local44 = RawModel.create(ObjTypeList.modelsArchive, local4); - @Pc(55) RawModel[] local55 = new RawModel[] { local36, local44 }; - local36 = new RawModel(local55, 2); + @Pc(36) RawModel model = RawModel.create(ObjTypeList.modelsArchive, head); + if (head2 != -1) { + @Pc(44) RawModel model2 = RawModel.create(ObjTypeList.modelsArchive, head2); + @Pc(55) RawModel[] models = new RawModel[] { model, model2 }; + model = new RawModel(models, 2); } - @Pc(66) int local66; - if (this.recolorDestination != null) { - for (local66 = 0; local66 < this.recolorDestination.length; local66++) { - local36.recolor(this.recolorDestination[local66], this.recolorSource[local66]); + @Pc(66) int i; + if (this.recol_d != null) { + for (i = 0; i < this.recol_d.length; i++) { + model.recolor(this.recol_d[i], this.recol_s[i]); } } - if (this.retextureSource != null) { - for (local66 = 0; local66 < this.retextureSource.length; local66++) { - local36.retexture(this.retextureSource[local66], this.retextureDestination[local66]); + if (this.retex_d != null) { + for (i = 0; i < this.retex_d.length; i++) { + model.retexture(this.retex_d[i], this.retex_s[i]); } } - return local36; + return model; } @OriginalMember(owner = "client!h", name = "a", descriptor = "(ZI)Lclient!gb;") - public final RawModel getBodyModel(@OriginalArg(0) boolean arg0) { - @Pc(4) int local4 = this.manWear1; - @Pc(18) int local18 = this.manWear2; - @Pc(21) int local21 = this.manWear3; - if (arg0) { - local21 = this.womanWear3; - local4 = this.womanWear1; - local18 = this.womanWear2; + public final RawModel getBodyModel(@OriginalArg(0) boolean female) { + @Pc(4) int wear1 = this.manwear; + @Pc(18) int wear2 = this.manwear2; + @Pc(21) int wear3 = this.manwear3; + if (female) { + wear3 = this.womanwear3; + wear1 = this.womanwear; + wear2 = this.womanwear2; } - if (local4 == -1) { + if (wear1 == -1) { return null; } - @Pc(43) RawModel local43 = RawModel.create(ObjTypeList.modelsArchive, local4); - if (local18 != -1) { - @Pc(54) RawModel local54 = RawModel.create(ObjTypeList.modelsArchive, local18); - if (local21 == -1) { - @Pc(68) RawModel[] local68 = new RawModel[] { local43, local54 }; - local43 = new RawModel(local68, 2); + @Pc(43) RawModel model = RawModel.create(ObjTypeList.modelsArchive, wear1); + if (wear2 != -1) { + @Pc(54) RawModel model2 = RawModel.create(ObjTypeList.modelsArchive, wear2); + if (wear3 == -1) { + @Pc(68) RawModel[] models = new RawModel[] { model, model2 }; + model = new RawModel(models, 2); } else { - @Pc(81) RawModel local81 = RawModel.create(ObjTypeList.modelsArchive, local21); - @Pc(96) RawModel[] local96 = new RawModel[] { local43, local54, local81 }; - local43 = new RawModel(local96, 3); + @Pc(81) RawModel model3 = RawModel.create(ObjTypeList.modelsArchive, wear3); + @Pc(96) RawModel[] models = new RawModel[] { model, model2, model3 }; + model = new RawModel(models, 3); } } - if (!arg0 && (this.manWearXOff != 0 || this.manWearYOff != 0 || this.manWearZOff != 0)) { - local43.translate(this.manWearXOff, this.manWearYOff, this.manWearZOff); + if (!female && (this.manWearXOff != 0 || this.manWearYOff != 0 || this.manWearZOff != 0)) { + model.translate(this.manWearXOff, this.manWearYOff, this.manWearZOff); } - if (arg0 && (this.womanWearXOff != 0 || this.womanWearYOff != 0 || this.womanWearZOff != 0)) { - local43.translate(this.womanWearXOff, this.womanWearYOff, this.womanWearZOff); + if (female && (this.womanWearXOff != 0 || this.womanWearYOff != 0 || this.womanWearZOff != 0)) { + model.translate(this.womanWearXOff, this.womanWearYOff, this.womanWearZOff); } - @Pc(165) int local165; - if (this.recolorDestination != null) { - for (local165 = 0; local165 < this.recolorDestination.length; local165++) { - local43.recolor(this.recolorDestination[local165], this.recolorSource[local165]); + @Pc(165) int i; + if (this.recol_d != null) { + for (i = 0; i < this.recol_d.length; i++) { + model.recolor(this.recol_d[i], this.recol_s[i]); } } - if (this.retextureSource != null) { - for (local165 = 0; local165 < this.retextureSource.length; local165++) { - local43.retexture(this.retextureSource[local165], this.retextureDestination[local165]); + if (this.retex_d != null) { + for (i = 0; i < this.retex_d.length; i++) { + model.retexture(this.retex_d[i], this.retex_s[i]); } } - return local43; + return model; } @OriginalMember(owner = "client!h", name = "a", descriptor = "(Lclient!h;Lclient!h;Z)V") public final void generateCertificate(@OriginalArg(0) ObjType link, @OriginalArg(1) ObjType template) { this.name = link.name; this.zoom2d = template.zoom2d; - this.recolorDestination = template.recolorDestination; - this.recolorSource = template.recolorSource; - this.xAngle2d = template.xAngle2d; - this.yAngle2d = template.yAngle2d; - this.retextureDestination = template.retextureDestination; + this.recol_d = template.recol_d; + this.recol_s = template.recol_s; + this.xAngle2D = template.xAngle2D; + this.yAngle2D = template.yAngle2D; + this.retex_s = template.retex_s; this.model = template.model; this.recolorDestinationPalette = template.recolorDestinationPalette; - this.zAngle2d = template.zAngle2d; + this.zAngle2D = template.zAngle2D; this.cost = link.cost; this.stackable = 1; - this.yOffset2d = template.yOffset2d; - this.xOffset2d = template.xOffset2d; - this.retextureSource = template.retextureSource; + this.yOffset2D = template.yOffset2D; + this.xOffset2D = template.xOffset2D; + this.retex_d = template.retex_d; this.members = link.members; } @OriginalMember(owner = "client!h", name = "d", descriptor = "(I)Lclient!w;") public final SoftwareModel getInvModel() { - @Pc(11) RawModel local11 = RawModel.create(ObjTypeList.modelsArchive, this.model); - if (local11 == null) { + @Pc(11) RawModel model = RawModel.create(ObjTypeList.modelsArchive, this.model); + if (model == null) { return null; } - @Pc(21) int local21; - if (this.recolorDestination != null) { - for (local21 = 0; local21 < this.recolorDestination.length; local21++) { - if (this.recolorDestinationPalette == null || local21 >= this.recolorDestinationPalette.length) { - local11.recolor(this.recolorDestination[local21], this.recolorSource[local21]); + @Pc(21) int i; + if (this.recol_d != null) { + for (i = 0; i < this.recol_d.length; i++) { + if (this.recolorDestinationPalette == null || i >= this.recolorDestinationPalette.length) { + model.recolor(this.recol_d[i], this.recol_s[i]); } else { - local11.recolor(this.recolorDestination[local21], client.aShortArray87[this.recolorDestinationPalette[local21] & 0xFF]); + model.recolor(this.recol_d[i], client.aShortArray87[this.recolorDestinationPalette[i] & 0xFF]); } } } - if (this.retextureSource != null) { - for (local21 = 0; local21 < this.retextureSource.length; local21++) { - local11.retexture(this.retextureSource[local21], this.retextureDestination[local21]); + if (this.retex_d != null) { + for (i = 0; i < this.retex_d.length; i++) { + model.retexture(this.retex_d[i], this.retex_s[i]); } } - @Pc(107) SoftwareModel local107 = local11.createSoftwareModel(this.ambient + 64, 768 - -this.contrast); + @Pc(107) SoftwareModel softwareModel = model.createSoftwareModel(this.ambient + 64, 768 - -this.contrast); if (this.resizeX != 128 || this.resizeY != 128 || this.resizeZ != 128) { - local107.resize(this.resizeX, this.resizeY, this.resizeZ); + softwareModel.resize(this.resizeX, this.resizeY, this.resizeZ); } - return local107; + return softwareModel; } } diff --git a/client/src/main/java/rt4/ObjTypeList.java b/client/src/main/java/rt4/ObjTypeList.java index 5127689..fe0fd6e 100644 --- a/client/src/main/java/rt4/ObjTypeList.java +++ b/client/src/main/java/rt4/ObjTypeList.java @@ -46,21 +46,21 @@ public class ObjTypeList { } @Pc(25) byte[] local25 = archive.fetchFile(Static18.method554(arg0), Static247.method4247(arg0)); local6 = new ObjType(); - local6.anInt2354 = arg0; + local6.id = arg0; if (local25 != null) { local6.decode(new Buffer(local25)); } - local6.method1826(); - if (local6.certificateTemplate != -1) { - local6.generateCertificate(get(local6.certificateLink), get(local6.certificateTemplate)); + local6.postDecode(); + if (local6.certtemplate != -1) { + local6.generateCertificate(get(local6.certlink), get(local6.certtemplate)); } if (local6.lentTemplate != -1) { - local6.method1823(get(local6.lentLink), get(local6.lentTemplate)); + local6.generateLent(get(local6.lentLink), get(local6.lentTemplate)); } if (!aBoolean276 && local6.members) { local6.name = LocalizedText.MEMBERS_OBJECT; local6.team = 0; - local6.inventoryOps = aClass100Array104; + local6.iops = aClass100Array104; local6.stockMarket = false; local6.ops = aClass100Array87; } diff --git a/client/src/main/java/rt4/PlayerSkillXpTable.java b/client/src/main/java/rt4/PlayerSkillXpTable.java index a52f39f..c59f1f8 100644 --- a/client/src/main/java/rt4/PlayerSkillXpTable.java +++ b/client/src/main/java/rt4/PlayerSkillXpTable.java @@ -1,18 +1,36 @@ package rt4; import org.openrs2.deob.annotation.OriginalMember; +import org.openrs2.deob.annotation.Pc; public class PlayerSkillXpTable { + @OriginalMember(owner = "client!ud", name = "T", descriptor = "[I") public static final int[] updatedStats = new int[32]; + @OriginalMember(owner = "client!lb", name = "p", descriptor = "[I") public static final int[] baseLevels = new int[25]; + @OriginalMember(owner = "client!hk", name = "fb", descriptor = "[I") public static final int[] boostedLevels = new int[25]; + @OriginalMember(owner = "client!sg", name = "b", descriptor = "[I") public static final int[] experience = new int[25]; + @OriginalMember(owner = "client!h", name = "S", descriptor = "[I") public static final int[] xpLevelLookup = new int[99]; + @OriginalMember(owner = "client!ha", name = "m", descriptor = "I") public static int updatedStatsWriterIndex = 0; + + static { + @Pc(4) int local4 = 0; + for (@Pc(6) int local6 = 0; local6 < 99; local6++) { + @Pc(13) int local13 = local6 + 1; + @Pc(26) int local26 = (int) (Math.pow(2.0D, (double) local13 / 7.0D) * 300.0D + (double) local13); + local4 += local26; + PlayerSkillXpTable.xpLevelLookup[local6] = local4 / 4; + } + } + } diff --git a/client/src/main/java/rt4/Protocol.java b/client/src/main/java/rt4/Protocol.java index 066a51c..8c10f50 100644 --- a/client/src/main/java/rt4/Protocol.java +++ b/client/src/main/java/rt4/Protocol.java @@ -2203,19 +2203,19 @@ public class Protocol { if (component.if3) { DelayedStateChange.method3707(id, slot, itemId); objType = ObjTypeList.get(itemId); - DelayedStateChange.updateView(objType.zoom2d, id, objType.yAngle2d, objType.xAngle2d); - DelayedStateChange.method2745(id, objType.zAngle2d, objType.yOffset2d, objType.xOffset2d); + DelayedStateChange.updateView(objType.zoom2d, id, objType.yAngle2D, objType.xAngle2D); + DelayedStateChange.method2745(id, objType.zAngle2D, objType.yOffset2D, objType.xOffset2D); } else if (itemId == -1) { component.modelType = 0; opcode = -1; return true; } else { objType = ObjTypeList.get(itemId); - component.modelXAngle = objType.xAngle2d; + component.modelXAngle = objType.xAngle2D; component.modelZoom = objType.zoom2d * 100 / slot; component.modelType = 4; component.modelId = itemId; - component.modelYAngle = objType.yAngle2d; + component.modelYAngle = objType.yAngle2D; InterfaceList.redraw(component); } opcode = -1; diff --git a/client/src/main/java/rt4/Rasteriser.java b/client/src/main/java/rt4/Rasteriser.java index c2e3074..4499441 100644 --- a/client/src/main/java/rt4/Rasteriser.java +++ b/client/src/main/java/rt4/Rasteriser.java @@ -3246,7 +3246,7 @@ public final class Rasteriser { height = bottom - top; prepareOffsets(); if (offsets.length < height) { - offsets = new int[Static165.clp2(height)]; + offsets = new int[IntUtils.clp2(height)]; } @Pc(23) int x = top * SoftwareRaster.width + left; for (@Pc(25) int y = 0; y < height; y++) { diff --git a/client/src/main/java/rt4/ScriptRunner.java b/client/src/main/java/rt4/ScriptRunner.java index c70b6aa..0f93b21 100644 --- a/client/src/main/java/rt4/ScriptRunner.java +++ b/client/src/main/java/rt4/ScriptRunner.java @@ -1055,11 +1055,11 @@ public final class ScriptRunner { component.objId = int3; component.objCount = int2; @Pc(13416) ObjType local13416 = ObjTypeList.get(int3); - component.modelYOffset = local13416.zAngle2d; - component.modelXOffset = local13416.xOffset2d; - component.modelXAngle = local13416.xAngle2d; - component.modelZOffset = local13416.yOffset2d; - component.modelYAngle = local13416.yAngle2d; + component.modelYOffset = local13416.zAngle2D; + component.modelXOffset = local13416.xOffset2D; + component.modelXAngle = local13416.xAngle2D; + component.modelZOffset = local13416.yOffset2D; + component.modelYAngle = local13416.yAngle2D; component.modelZoom = local13416.zoom2d; if (component.anInt451 > 0) { component.modelZoom = component.modelZoom * 32 / component.anInt451; @@ -2418,8 +2418,8 @@ public final class ScriptRunner { int1 = intStack[isp]; int3 = intStack[isp + 1]; local11269 = ObjTypeList.get(int1); - if (int3 >= 1 && int3 <= 5 && local11269.inventoryOps[int3 - 1] != null) { - stringStack[ssp++] = local11269.inventoryOps[int3 - 1]; + if (int3 >= 1 && int3 <= 5 && local11269.iops[int3 - 1] != null) { + stringStack[ssp++] = local11269.iops[int3 - 1]; continue; } stringStack[ssp++] = EMPTY_STRING; @@ -2442,8 +2442,8 @@ public final class ScriptRunner { isp--; int1 = intStack[isp]; local11417 = ObjTypeList.get(int1); - if (local11417.certificateTemplate == -1 && local11417.certificateLink >= 0) { - intStack[isp++] = local11417.certificateLink; + if (local11417.certtemplate == -1 && local11417.certlink >= 0) { + intStack[isp++] = local11417.certlink; continue; } intStack[isp++] = int1; @@ -2453,8 +2453,8 @@ public final class ScriptRunner { isp--; int1 = intStack[isp]; local11417 = ObjTypeList.get(int1); - if (local11417.certificateTemplate >= 0 && local11417.certificateLink >= 0) { - intStack[isp++] = local11417.certificateLink; + if (local11417.certtemplate >= 0 && local11417.certlink >= 0) { + intStack[isp++] = local11417.certlink; continue; } intStack[isp++] = int1; diff --git a/client/src/main/java/rt4/Static165.java b/client/src/main/java/rt4/Static165.java index 0f95016..83e04e0 100644 --- a/client/src/main/java/rt4/Static165.java +++ b/client/src/main/java/rt4/Static165.java @@ -63,17 +63,6 @@ public final class Static165 { } } - @OriginalMember(owner = "client!nb", name = "a", descriptor = "(BI)I") - public static int clp2(@OriginalArg(1) int arg0) { - @Pc(0) int local0 = arg0 - 1; - @Pc(6) int local6 = local0 | local0 >>> 1; - @Pc(22) int local22 = local6 | local6 >>> 2; - @Pc(28) int local28 = local22 | local22 >>> 4; - @Pc(34) int local34 = local28 | local28 >>> 8; - @Pc(40) int local40 = local34 | local34 >>> 16; - return local40 + 1; - } - @OriginalMember(owner = "client!nb", name = "a", descriptor = "(II)Lclient!na;") public static JagString method3165() { @Pc(21) JagString local21 = new JagString(); diff --git a/client/src/main/java/rt4/StructType.java b/client/src/main/java/rt4/StructType.java index 2353416..2525399 100644 --- a/client/src/main/java/rt4/StructType.java +++ b/client/src/main/java/rt4/StructType.java @@ -29,7 +29,7 @@ public final class StructType extends SecondaryNode { @Pc(17) int local17 = arg0.g1(); @Pc(25) int local25; if (this.params == null) { - local25 = Static165.clp2(local17); + local25 = IntUtils.clp2(local17); this.params = new HashTable(local25); } for (local25 = 0; local25 < local17; local25++) {