From 4b7c1e88e369361dd7ca89dde162a1367101bc23 Mon Sep 17 00:00:00 2001 From: Jordan Date: Sun, 28 Apr 2024 01:28:12 -0400 Subject: [PATCH] refactor: Updated some field names to match server discoveries --- src/js/client.ts | 31 ++--- src/js/game.ts | 126 ++++++++++---------- src/js/jagex2/config/LocType.ts | 44 +++---- src/js/jagex2/config/NpcType.ts | 28 ++--- src/js/jagex2/config/ObjType.ts | 28 ++--- src/js/jagex2/config/SeqType.ts | 18 +-- src/js/jagex2/dash3d/World.ts | 12 +- src/js/jagex2/dash3d/entity/NpcEntity.ts | 2 +- src/js/jagex2/dash3d/entity/PlayerEntity.ts | 10 +- 9 files changed, 151 insertions(+), 148 deletions(-) diff --git a/src/js/client.ts b/src/js/client.ts index 41b9e9fc..3b8ce60b 100644 --- a/src/js/client.ts +++ b/src/js/client.ts @@ -59,21 +59,22 @@ export abstract class Client extends GameShell { static readonly exponent: bigint = 58778699976184461502525193738213253649000149147835990136706041084440742975821n; static readonly modulus: bigint = 7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n; - static updateCounter: number = 0; - static update2Counter: number = 0; - static sidebarInputCounter: number = 0; - static opHeld1Counter: number = 0; - static opLoc4Counter: number = 0; - static opNpc5Counter: number = 0; - static drawCounter: number = 0; - static opHeld4Counter: number = 0; - static opLoc5Counter: number = 0; - static opNpc3Counter: number = 0; - static opHeld9Counter: number = 0; - static opPlayer2Counter: number = 0; - static updatePlayersCounter: number = 0; - static ifButton5Counter: number = 0; - static updateLocCounter: number = 0; + static cyclelogic1: number = 0; + static cyclelogic2: number = 0; + static cyclelogic3: number = 0; + static cyclelogic4: number = 0; + static cyclelogic5: number = 0; + static cyclelogic6: number = 0; + + static oplogic1: number = 0; + static oplogic2: number = 0; + static oplogic3: number = 0; + static oplogic4: number = 0; + static oplogic5: number = 0; + static oplogic6: number = 0; + static oplogic7: number = 0; + static oplogic8: number = 0; + static oplogic9: number = 0; static setHighMemory = (): void => { World3D.lowMemory = false; diff --git a/src/js/game.ts b/src/js/game.ts index 533b55f9..d62c72ed 100644 --- a/src/js/game.ts +++ b/src/js/game.ts @@ -949,15 +949,15 @@ class Game extends Client { for (let i: number = 0; i < 5; i++) { this.designColors[i] = 0; } - Client.opLoc4Counter = 0; - Client.opNpc3Counter = 0; - Client.opHeld4Counter = 0; - Client.opNpc5Counter = 0; - Client.opHeld1Counter = 0; - Client.opLoc5Counter = 0; - Client.ifButton5Counter = 0; - Client.opPlayer2Counter = 0; - Client.opHeld9Counter = 0; + Client.oplogic1 = 0; + Client.oplogic2 = 0; + Client.oplogic3 = 0; + Client.oplogic4 = 0; + Client.oplogic5 = 0; + Client.oplogic6 = 0; + Client.oplogic7 = 0; + Client.oplogic8 = 0; + Client.oplogic9 = 0; this.prepareGameScreen(); return; } @@ -1215,9 +1215,9 @@ class Game extends Client { } } - Client.updateCounter++; - if (Client.updateCounter > 127) { - Client.updateCounter = 0; + Client.cyclelogic3++; + if (Client.cyclelogic3 > 127) { + Client.cyclelogic3 = 0; this.out.p1isaac(ClientProt.ANTICHEAT_CYCLELOGIC3); this.out.p3(4991788); } @@ -1332,9 +1332,9 @@ class Game extends Client { this.minimapZoomModifier = -1; } - Client.update2Counter++; - if (Client.update2Counter > 110) { - Client.update2Counter = 0; + Client.cyclelogic4++; + if (Client.cyclelogic4 > 110) { + Client.cyclelogic4 = 0; this.out.p1isaac(ClientProt.ANTICHEAT_CYCLELOGIC4); this.out.p4(0); } @@ -1649,9 +1649,9 @@ class Game extends Client { this.orbitCamera(this.orbitCameraX, this.getHeightmapY(this.currentLevel, this.localPlayer.x, this.localPlayer.z) - 50, this.orbitCameraZ, yaw, pitch, pitch * 3 + 600); } - Client.drawCounter++; - if (Client.drawCounter > 1802) { - Client.drawCounter = 0; + Client.cyclelogic2++; + if (Client.cyclelogic2 > 1802) { + Client.cyclelogic2 = 0; this.out.p1isaac(ClientProt.ANTICHEAT_CYCLELOGIC2); this.out.p1(0); const start: number = this.out.pos; @@ -2487,7 +2487,7 @@ class Game extends Client { for (let i: number = 0; i < this.npcCount; i++) { const npc: NpcEntity | null = this.npcs[this.npcIds[i]]; - if (npc && npc.isVisible() && npc.type && npc.type.visonmap) { + if (npc && npc.isVisible() && npc.type && npc.type.minimap) { anchorX = ((npc.x / 32) | 0) - ((this.localPlayer.x / 32) | 0); anchorY = ((npc.z / 32) | 0) - ((this.localPlayer.z / 32) | 0); this.drawOnMinimap(anchorY, this.imageMapdot1, anchorX); @@ -3088,10 +3088,10 @@ class Game extends Client { } else if (action === 405 || action === 38 || action === 422 || action === 478 || action === 347) { if (action === 478) { if ((b & 0x3) === 0) { - Client.opHeld1Counter++; + Client.oplogic5++; } - if (Client.opHeld1Counter >= 90) { + if (Client.oplogic5 >= 90) { // ANTICHEAT_OPLOGIC5 this.out.p1isaac(ClientProt.ANTICHEAT_OPLOGIC5); } @@ -3105,8 +3105,8 @@ class Game extends Client { // OPHELD3 this.out.p1isaac(ClientProt.OPHELD3); } else if (action === 405) { - Client.opHeld4Counter += a; - if (Client.opHeld4Counter >= 97) { + Client.oplogic3 += a; + if (Client.oplogic3 >= 97) { // ANTICHEAT_OPLOGIC3 this.out.p1isaac(ClientProt.ANTICHEAT_OPLOGIC3); this.out.p3(14953816); @@ -3149,10 +3149,10 @@ class Game extends Client { this.out.p1isaac(ClientProt.OPNPC2); } else if (action === 6) { if ((a & 0x3) === 0) { - Client.opNpc3Counter++; + Client.oplogic2++; } - if (Client.opNpc3Counter >= 124) { + if (Client.oplogic2 >= 124) { // ANTICHEAT_OPLOGIC2 this.out.p1isaac(ClientProt.ANTICHEAT_OPLOGIC2); this.out.p4(0); @@ -3168,10 +3168,10 @@ class Game extends Client { this.out.p1isaac(ClientProt.OPNPC1); } else if (action === 245) { if ((a & 0x3) === 0) { - Client.opNpc5Counter++; + Client.oplogic4++; } - if (Client.opNpc5Counter >= 85) { + if (Client.oplogic4 >= 85) { // ANTICHEAT_OPLOGIC4 this.out.p1isaac(ClientProt.ANTICHEAT_OPLOGIC4); this.out.p2(39596); @@ -3327,8 +3327,8 @@ class Game extends Client { // OPPLAYER1 this.out.p1isaac(ClientProt.OPPLAYER1); } else if (action === 151) { - Client.opPlayer2Counter++; - if (Client.opPlayer2Counter >= 90) { + Client.oplogic8++; + if (Client.oplogic8 >= 90) { // ANTICHEAT_OPLOGIC8 this.out.p1isaac(ClientProt.ANTICHEAT_OPLOGIC8); this.out.p2(31114); @@ -3484,10 +3484,10 @@ class Game extends Client { this.out.p1isaac(ClientProt.INV_BUTTON3); } else if (action === 415) { if ((c & 0x3) === 0) { - Client.ifButton5Counter++; + Client.oplogic7++; } - if (Client.ifButton5Counter >= 55) { + if (Client.oplogic7 >= 55) { // ANTICHEAT_OPLOGIC7 this.out.p1isaac(ClientProt.ANTICHEAT_OPLOGIC7); this.out.p4(0); @@ -3500,10 +3500,10 @@ class Game extends Client { this.out.p1isaac(ClientProt.INV_BUTTON1); } else if (action === 892) { if ((b & 0x3) === 0) { - Client.opHeld9Counter++; + Client.oplogic9++; } - if (Client.opHeld9Counter >= 130) { + if (Client.oplogic9 >= 130) { // ANTICHEAT_OPLOGIC9 this.out.p1isaac(ClientProt.ANTICHEAT_OPLOGIC9); this.out.p1(177); @@ -3534,10 +3534,10 @@ class Game extends Client { } } else if (action === 581) { if ((a & 0x3) === 0) { - Client.opLoc4Counter++; + Client.oplogic1++; } - if (Client.opLoc4Counter >= 99) { + if (Client.oplogic1 >= 99) { // ANTICHEAT_OPLOGIC1 this.out.p1isaac(ClientProt.ANTICHEAT_OPLOGIC1); this.out.p4(0); @@ -3564,8 +3564,8 @@ class Game extends Client { this.out.p2(this.activeSpellId); } } else if (action === 1501) { - Client.opLoc5Counter += this.sceneBaseTileZ; - if (Client.opLoc5Counter >= 92) { + Client.oplogic6 += this.sceneBaseTileZ; + if (Client.oplogic6 >= 92) { // ANTICHEAT_OPLOGIC6 this.out.p1isaac(ClientProt.ANTICHEAT_OPLOGIC6); this.out.p4(0); @@ -3951,9 +3951,9 @@ class Game extends Client { this.redrawSideicons = true; } - Client.sidebarInputCounter++; - if (Client.sidebarInputCounter > 150) { - Client.sidebarInputCounter = 0; + Client.cyclelogic1++; + if (Client.cyclelogic1 > 150) { + Client.cyclelogic1 = 0; this.out.p1isaac(ClientProt.ANTICHEAT_CYCLELOGIC1); this.out.p1(43); } @@ -6258,8 +6258,8 @@ class Game extends Client { } else { if (child.interactable) { for (let op: number = 4; op >= 3; op--) { - if (obj.iops && obj.iops[op]) { - this.menuOption[this.menuSize] = obj.iops[op] + ' @lre@' + obj.name; + if (obj.iop && obj.iop[op]) { + this.menuOption[this.menuSize] = obj.iop[op] + ' @lre@' + obj.name; if (op === 3) { this.menuAction[this.menuSize] = 478; } else if (op === 4) { @@ -6289,10 +6289,10 @@ class Game extends Client { this.menuSize++; } - if (child.interactable && obj.iops) { + if (child.interactable && obj.iop) { for (let op: number = 2; op >= 0; op--) { - if (obj.iops[op]) { - this.menuOption[this.menuSize] = obj.iops[op] + ' @lre@' + obj.name; + if (obj.iop[op]) { + this.menuOption[this.menuSize] = obj.iop[op] + ' @lre@' + obj.name; if (op === 0) { this.menuAction[this.menuSize] = 405; } else if (op === 1) { @@ -6451,10 +6451,10 @@ class Game extends Client { this.menuParamC[this.menuSize] = z; this.menuSize++; } else if (this.spellSelected !== 1) { - if (loc.ops) { + if (loc.op) { for (let op: number = 4; op >= 0; op--) { - if (loc.ops[op]) { - this.menuOption[this.menuSize] = loc.ops[op] + ' @cya@' + loc.name; + if (loc.op[op]) { + this.menuOption[this.menuSize] = loc.op[op] + ' @cya@' + loc.name; if (op === 0) { this.menuAction[this.menuSize] = 285; } @@ -6561,8 +6561,8 @@ class Game extends Client { this.menuSize++; } else if (this.spellSelected !== 1) { for (let op: number = 4; op >= 0; op--) { - if (type.ops && type.ops[op]) { - this.menuOption[this.menuSize] = type.ops[op] + ' @lre@' + type.name; + if (type.op && type.op[op]) { + this.menuOption[this.menuSize] = type.op[op] + ' @lre@' + type.name; if (op === 0) { this.menuAction[this.menuSize] = 224; } @@ -6638,10 +6638,10 @@ class Game extends Client { this.menuSize++; } else if (this.spellSelected !== 1) { let type: number; - if (npc.ops) { + if (npc.op) { for (type = 4; type >= 0; type--) { - if (npc.ops[type] && npc.ops[type]?.toLowerCase() !== 'attack') { - this.menuOption[this.menuSize] = npc.ops[type] + ' @yel@' + tooltip; + if (npc.op[type] && npc.op[type]?.toLowerCase() !== 'attack') { + this.menuOption[this.menuSize] = npc.op[type] + ' @yel@' + tooltip; if (type === 0) { this.menuAction[this.menuSize] = 728; @@ -6663,15 +6663,15 @@ class Game extends Client { } } - if (npc.ops) { + if (npc.op) { for (type = 4; type >= 0; type--) { - if (npc.ops[type] && npc.ops[type]?.toLowerCase() === 'attack') { + if (npc.op[type] && npc.op[type]?.toLowerCase() === 'attack') { let action: number = 0; if (this.localPlayer && npc.vislevel > this.localPlayer.combatLevel) { action = 2000; } - this.menuOption[this.menuSize] = npc.ops[type] + ' @yel@' + tooltip; + this.menuOption[this.menuSize] = npc.op[type] + ' @yel@' + tooltip; if (type === 0) { this.menuAction[this.menuSize] = action + 728; @@ -7824,9 +7824,9 @@ class Game extends Client { } } - Client.updatePlayersCounter++; - if (Client.updatePlayersCounter > 1406) { - Client.updatePlayersCounter = 0; + Client.cyclelogic6++; + if (Client.cyclelogic6 > 1406) { + Client.cyclelogic6 = 0; // ANTICHEAT_CYCLELOGIC6 this.out.p1isaac(ClientProt.ANTICHEAT_CYCLELOGIC6); this.out.p1(0); @@ -8157,9 +8157,9 @@ class Game extends Client { } } - Client.updateLocCounter++; - if (Client.updateLocCounter > 85) { - Client.updateLocCounter = 0; + Client.cyclelogic5++; + if (Client.cyclelogic5 > 85) { + Client.cyclelogic5 = 0; // ANTICHEAT_CYCLELOGIC5 this.out.p1isaac(ClientProt.ANTICHEAT_CYCLELOGIC5); } @@ -8365,7 +8365,7 @@ class Game extends Client { if (entity.primarySeqId !== -1 && entity.primarySeqDelay === 0) { const seq: SeqType = SeqType.instances[entity.primarySeqId]; - if (!seq.labelGroups) { + if (!seq.walkmerge) { entity.seqTrigger++; return; } diff --git a/src/js/jagex2/config/LocType.ts b/src/js/jagex2/config/LocType.ts index 4f2318f6..9cfb1171 100644 --- a/src/js/jagex2/config/LocType.ts +++ b/src/js/jagex2/config/LocType.ts @@ -64,7 +64,7 @@ export default class LocType extends ConfigType { if (loc.active2 === -1 && loc.shapes) { loc.active = loc.shapes.length > 0 && loc.shapes[0] === LocShape.CENTREPIECE_STRAIGHT.id; - if (loc.ops) { + if (loc.op) { loc.active = true; } } @@ -98,10 +98,10 @@ export default class LocType extends ConfigType { occlude: boolean = false; anim: number = -1; disposeAlpha: boolean = false; - walloff: number = 16; + wallwidth: number = 16; ambient: number = 0; contrast: number = 0; - ops: (string | null)[] | null = null; + op: (string | null)[] | null = null; mapfunction: number = -1; mapscene: number = -1; mirror: boolean = false; @@ -110,9 +110,9 @@ export default class LocType extends ConfigType { resizey: number = 128; resizez: number = 128; forceapproach: number = 0; - xoff: number = 0; - yoff: number = 0; - zoff: number = 0; + offsetx: number = 0; + offsety: number = 0; + offsetz: number = 0; forcedecor: boolean = false; decode(code: number, dat: Packet): void { @@ -157,19 +157,19 @@ export default class LocType extends ConfigType { } else if (code === 25) { this.disposeAlpha = true; } else if (code === 28) { - this.walloff = dat.g1; + this.wallwidth = dat.g1; } else if (code === 29) { this.ambient = dat.g1b; } else if (code === 39) { this.contrast = dat.g1b; } else if (code >= 30 && code < 39) { - if (!this.ops) { - this.ops = new TypedArray1d(5, null); + if (!this.op) { + this.op = new TypedArray1d(5, null); } - this.ops[code - 30] = dat.gjstr; - if (this.ops[code - 30]?.toLowerCase() === 'hidden') { - this.ops[code - 30] = null; + this.op[code - 30] = dat.gjstr; + if (this.op[code - 30]?.toLowerCase() === 'hidden') { + this.op[code - 30] = null; } } else if (code === 40) { const count: number = dat.g1; @@ -197,11 +197,11 @@ export default class LocType extends ConfigType { } else if (code === 69) { this.forceapproach = dat.g1; } else if (code === 70) { - this.xoff = dat.g2b; + this.offsetx = dat.g2b; } else if (code === 71) { - this.yoff = dat.g2b; + this.offsety = dat.g2b; } else if (code === 72) { - this.zoff = dat.g2b; + this.offsetz = dat.g2b; } else if (code === 73) { this.forcedecor = true; } @@ -287,7 +287,7 @@ export default class LocType extends ConfigType { } const scaled: boolean = this.resizex !== 128 || this.resizey !== 128 || this.resizez !== 128; - const translated: boolean = this.xoff !== 0 || this.yoff !== 0 || this.zoff !== 0; + const translated: boolean = this.offsetx !== 0 || this.offsety !== 0 || this.offsetz !== 0; let modified: Model = Model.modelShareColored(model, !this.recol_s, !this.disposeAlpha, angle === LocAngle.WEST && transformId === -1 && !scaled && !translated); if (transformId !== -1) { @@ -312,7 +312,7 @@ export default class LocType extends ConfigType { } if (translated) { - modified.translate(this.yoff, this.xoff, this.zoff); + modified.translate(this.offsety, this.offsetx, this.offsetz); } modified.calculateNormals((this.ambient & 0xff) + 64, (this.contrast & 0xff) * 5 + 768, -50, -10, -50, !this.sharelight); @@ -364,10 +364,10 @@ export default class LocType extends ConfigType { this.sharelight = false; this.occlude = false; this.anim = -1; - this.walloff = 16; + this.wallwidth = 16; this.ambient = 0; this.contrast = 0; - this.ops = null; + this.op = null; this.disposeAlpha = false; this.mapfunction = -1; this.mapscene = -1; @@ -377,9 +377,9 @@ export default class LocType extends ConfigType { this.resizey = 128; this.resizez = 128; this.forceapproach = 0; - this.xoff = 0; - this.yoff = 0; - this.zoff = 0; + this.offsetx = 0; + this.offsety = 0; + this.offsetz = 0; this.forcedecor = false; } } diff --git a/src/js/jagex2/config/NpcType.ts b/src/js/jagex2/config/NpcType.ts index 09d6391d..74124f6a 100644 --- a/src/js/jagex2/config/NpcType.ts +++ b/src/js/jagex2/config/NpcType.ts @@ -76,11 +76,11 @@ export default class NpcType extends ConfigType { walkanim_l: number = -1; recol_s: Uint16Array | null = null; recol_d: Uint16Array | null = null; - ops: (string | null)[] | null = null; - code90: number = -1; - code91: number = -1; - code92: number = -1; - visonmap: boolean = true; + op: (string | null)[] | null = null; + resizex: number = -1; + resizey: number = -1; + resizez: number = -1; + minimap: boolean = true; vislevel: number = -1; resizeh: number = 128; resizev: number = 128; @@ -111,13 +111,13 @@ export default class NpcType extends ConfigType { this.walkanim_r = dat.g2; this.walkanim_l = dat.g2; } else if (code >= 30 && code < 40) { - if (!this.ops) { - this.ops = new TypedArray1d(5, null); + if (!this.op) { + this.op = new TypedArray1d(5, null); } - this.ops[code - 30] = dat.gjstr; - if (this.ops[code - 30]?.toLowerCase() === 'hidden') { - this.ops[code - 30] = null; + this.op[code - 30] = dat.gjstr; + if (this.op[code - 30]?.toLowerCase() === 'hidden') { + this.op[code - 30] = null; } } else if (code === 40) { const count: number = dat.g1; @@ -136,13 +136,13 @@ export default class NpcType extends ConfigType { this.heads[i] = dat.g2; } } else if (code === 90) { - this.code90 = dat.g2; + this.resizex = dat.g2; } else if (code === 91) { - this.code91 = dat.g2; + this.resizey = dat.g2; } else if (code === 92) { - this.code92 = dat.g2; + this.resizez = dat.g2; } else if (code === 93) { - this.visonmap = false; + this.minimap = false; } else if (code === 95) { this.vislevel = dat.g2; } else if (code === 97) { diff --git a/src/js/jagex2/config/ObjType.ts b/src/js/jagex2/config/ObjType.ts index d082d9f4..e3855c49 100644 --- a/src/js/jagex2/config/ObjType.ts +++ b/src/js/jagex2/config/ObjType.ts @@ -68,8 +68,8 @@ export default class ObjType extends ConfigType { if (!this.membersWorld && obj.members) { obj.name = 'Members Object'; obj.desc = "Login to a members' server to use this object."; - obj.ops = null; - obj.iops = null; + obj.op = null; + obj.iop = null; } return obj; @@ -210,8 +210,8 @@ export default class ObjType extends ConfigType { stackable: boolean = false; cost: number = 1; members: boolean = false; - ops: (string | null)[] | null = null; - iops: (string | null)[] | null = null; + op: (string | null)[] | null = null; + iop: (string | null)[] | null = null; manwear: number = -1; manwear2: number = -1; manwearOffsetY: number = 0; @@ -273,19 +273,19 @@ export default class ObjType extends ConfigType { } else if (code === 26) { this.womanwear2 = dat.g2; } else if (code >= 30 && code < 35) { - if (!this.ops) { - this.ops = new TypedArray1d(5, null); + if (!this.op) { + this.op = new TypedArray1d(5, null); } - this.ops[code - 30] = dat.gjstr; - if (this.ops[code - 30]?.toLowerCase() === 'hidden') { - this.ops[code - 30] = null; + this.op[code - 30] = dat.gjstr; + if (this.op[code - 30]?.toLowerCase() === 'hidden') { + this.op[code - 30] = null; } } else if (code >= 35 && code < 40) { - if (!this.iops) { - this.iops = new TypedArray1d(5, null); + if (!this.iop) { + this.iop = new TypedArray1d(5, null); } - this.iops[code - 35] = dat.gjstr; + this.iop[code - 35] = dat.gjstr; } else if (code === 40) { const count: number = dat.g1; this.recol_s = new Uint16Array(count); @@ -479,8 +479,8 @@ export default class ObjType extends ConfigType { this.stackable = false; this.cost = 1; this.members = false; - this.ops = null; - this.iops = null; + this.op = null; + this.iop = null; this.manwear = -1; this.manwear2 = -1; this.manwearOffsetY = 0; diff --git a/src/js/jagex2/config/SeqType.ts b/src/js/jagex2/config/SeqType.ts index 9f2195cf..b53aaaca 100644 --- a/src/js/jagex2/config/SeqType.ts +++ b/src/js/jagex2/config/SeqType.ts @@ -35,11 +35,11 @@ export default class SeqType extends ConfigType { iframes: Int16Array | null = null; delay: Int16Array | null = null; replayoff: number = -1; - labelGroups: Int32Array | null = null; + walkmerge: Int32Array | null = null; stretches: boolean = false; priority: number = 5; - mainhand: number = -1; - offhand: number = -1; + righthand: number = -1; + lefthand: number = -1; replaycount: number = 99; duration: number = 0; @@ -73,21 +73,23 @@ export default class SeqType extends ConfigType { this.replayoff = dat.g2; } else if (code === 3) { const count: number = dat.g1; - this.labelGroups = new Int32Array(count + 1); + this.walkmerge = new Int32Array(count + 1); for (let i: number = 0; i < count; i++) { - this.labelGroups[i] = dat.g1; + this.walkmerge[i] = dat.g1; } - this.labelGroups[count] = 9999999; + this.walkmerge[count] = 9999999; } else if (code === 4) { this.stretches = true; } else if (code === 5) { this.priority = dat.g1; } else if (code === 6) { - this.mainhand = dat.g2; + // later RS (think RS3) this becomes mainhand + this.righthand = dat.g2; } else if (code === 7) { - this.offhand = dat.g2; + // later RS (think RS3) this becomes offhand + this.lefthand = dat.g2; } else if (code === 8) { this.replaycount = dat.g1; } else { diff --git a/src/js/jagex2/dash3d/World.ts b/src/js/jagex2/dash3d/World.ts index ce110afb..fa1a4f51 100644 --- a/src/js/jagex2/dash3d/World.ts +++ b/src/js/jagex2/dash3d/World.ts @@ -210,7 +210,7 @@ export default class World { if (scene) { const width: number = scene.getWallBitset(level, x, z); if (width > 0) { - offset = LocType.get((width >> 14) & 0x7fff).walloff; + offset = LocType.get((width >> 14) & 0x7fff).wallwidth; } } @@ -1004,8 +1004,8 @@ export default class World { locs.addTail(new LocEntity(locId, level, 0, x, z, SeqType.instances[loc.anim], true)); } - if (loc.walloff !== 16) { - scene?.setWallDecorationOffset(level, x, z, loc.walloff); + if (loc.wallwidth !== 16) { + scene?.setWallDecorationOffset(level, x, z, loc.wallwidth); } } else if (shape === LocShape.WALL_DIAGONAL_CORNER.id) { scene?.addWall(level, x, z, y, World.ROTATION_WALL_CORNER_TYPE[angle], 0, loc.getModel(LocShape.WALL_DIAGONAL_CORNER.id, angle, heightSW, heightSE, heightNW, heightNE, -1), null, bitset, info); @@ -1069,8 +1069,8 @@ export default class World { locs.addTail(new LocEntity(locId, level, 0, x, z, SeqType.instances[loc.anim], true)); } - if (loc.walloff !== 16) { - scene?.setWallDecorationOffset(level, x, z, loc.walloff); + if (loc.wallwidth !== 16) { + scene?.setWallDecorationOffset(level, x, z, loc.wallwidth); } } else if (shape === LocShape.WALL_SQUARE_CORNER.id) { scene?.addWall(level, x, z, y, World.ROTATION_WALL_CORNER_TYPE[angle], 0, loc.getModel(LocShape.WALL_SQUARE_CORNER.id, angle, heightSW, heightSE, heightNW, heightNE, -1), null, bitset, info); @@ -1115,7 +1115,7 @@ export default class World { if (scene) { const width: number = scene.getWallBitset(level, x, z); if (width > 0) { - offset = LocType.get((width >> 14) & 0x7fff).walloff; + offset = LocType.get((width >> 14) & 0x7fff).wallwidth; } } diff --git a/src/js/jagex2/dash3d/entity/NpcEntity.ts b/src/js/jagex2/dash3d/entity/NpcEntity.ts index b5a8c638..8f464328 100644 --- a/src/js/jagex2/dash3d/entity/NpcEntity.ts +++ b/src/js/jagex2/dash3d/entity/NpcEntity.ts @@ -65,7 +65,7 @@ export default class NpcEntity extends PathingEntity { secondaryTransformId = secondFrames[this.secondarySeqFrame]; } } - return this.type.getSequencedModel(primaryTransformId, secondaryTransformId, SeqType.instances[this.primarySeqId].labelGroups); + return this.type.getSequencedModel(primaryTransformId, secondaryTransformId, SeqType.instances[this.primarySeqId].walkmerge); } } diff --git a/src/js/jagex2/dash3d/entity/PlayerEntity.ts b/src/js/jagex2/dash3d/entity/PlayerEntity.ts index be048ce1..2eab12e3 100644 --- a/src/js/jagex2/dash3d/entity/PlayerEntity.ts +++ b/src/js/jagex2/dash3d/entity/PlayerEntity.ts @@ -343,13 +343,13 @@ export default class PlayerEntity extends PathingEntity { } } - if (seq.mainhand >= 0) { - rightHandValue = seq.mainhand; + if (seq.righthand >= 0) { + rightHandValue = seq.righthand; hashCode += BigInt(rightHandValue - this.appearances[5]) << 8n; } - if (seq.offhand >= 0) { - leftHandValue = seq.offhand; + if (seq.lefthand >= 0) { + leftHandValue = seq.lefthand; hashCode += BigInt(leftHandValue - this.appearances[3]) << 16n; } } else if (this.secondarySeqId >= 0) { @@ -413,7 +413,7 @@ export default class PlayerEntity extends PathingEntity { const tmp: Model = Model.modelShareAlpha(model, true); if (primaryTransformId !== -1 && secondaryTransformId !== -1) { - tmp.applyTransforms(primaryTransformId, secondaryTransformId, SeqType.instances[this.primarySeqId].labelGroups); + tmp.applyTransforms(primaryTransformId, secondaryTransformId, SeqType.instances[this.primarySeqId].walkmerge); } else if (primaryTransformId !== -1) { tmp.applyTransform(primaryTransformId); }