Add more script opcodes

This commit is contained in:
Lucwousin
2019-07-09 19:43:27 +02:00
parent 4fb58a484f
commit 5244775148
11 changed files with 79 additions and 16 deletions

View File

@@ -156,7 +156,7 @@ public class GrandExchangeEvents {
} else if (var0 == 2613) {
Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.rectangleMode.rsOrdinal();
return 1;
} else if (var0 == 2614) {
} else if (var0 == ScriptOpcodes.IF_GETMODELTRANSPARENT) {
Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.modelTransparency ? 1 : 0;
return 1;
} else {

View File

@@ -156,7 +156,7 @@ public class ScriptEvent extends Node {
} else if (var0 == 1613) {
Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.rectangleMode.rsOrdinal();
return 1;
} else if (var0 == 1614) {
} else if (var0 == ScriptOpcodes.CC_GETMODELTRANSPARENT) {
Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = var3.modelTransparency ? 1 : 0;
return 1;
} else {

View File

@@ -276,7 +276,7 @@ public class StructDefinition extends DualNode {
var6 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1;
var4.field961 = var6;
return 1;
} else if (var0 == 1127) {
} else if (var0 == ScriptOpcodes.CC_SETMODELTRANSPARENT) {
var6 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize] == 1;
var4.modelTransparency = var6;
return 1;

View File

@@ -177,16 +177,16 @@ public class WorldMapAreaData extends WorldMapArea {
} else {
int var7;
byte[] var8;
if (var0 != 1350) {
if (var0 != ScriptOpcodes.CC_SETOPKEY) {
byte var11;
if (var0 == 1351) {
if (var0 == ScriptOpcodes.CC_SETOPTKEY) {
RouteStrategy.Interpreter_intStackSize -= 2;
var11 = 10;
var8 = new byte[]{(byte)Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize]};
byte[] var10 = new byte[]{(byte)Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1]};
BufferedSink.method3595(var4, var11, var8, var10);
return 1;
} else if (var0 == 1352) {
} else if (var0 == ScriptOpcodes.CC_SETOPKEYRATE) {
RouteStrategy.Interpreter_intStackSize -= 3;
var5 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize] - 1;
var6 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize + 1];
@@ -197,13 +197,13 @@ public class WorldMapAreaData extends WorldMapArea {
} else {
throw new RuntimeException();
}
} else if (var0 == 1353) {
} else if (var0 == ScriptOpcodes.CC_SETOPTKEYRATE) {
var11 = 10;
var6 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize];
var7 = Interpreter.Interpreter_intStack[--RouteStrategy.Interpreter_intStackSize];
Varcs.method2168(var4, var11, var6, var7);
return 1;
} else if (var0 == 1354) {
} else if (var0 == ScriptOpcodes.CC_SETOPKEYIGNOREHELD) {
--RouteStrategy.Interpreter_intStackSize;
var5 = Interpreter.Interpreter_intStack[RouteStrategy.Interpreter_intStackSize] - 1;
if (var5 >= 0 && var5 <= 9) {
@@ -212,7 +212,7 @@ public class WorldMapAreaData extends WorldMapArea {
} else {
throw new RuntimeException();
}
} else if (var0 == 1355) {
} else if (var0 == ScriptOpcodes.CC_SETOPTKEYIGNOREHELD) {
var11 = 10;
WorldMapSection1.method345(var4, var11);
return 1;

View File

@@ -202,7 +202,7 @@ public class class31 {
return 1;
} else if (var0 == 6520) {
return 1;
} else if (var0 == 6521) {
} else if (var0 == ScriptOpcodes.MOBILE_KEYBOARDHIDE) {
return 1;
} else if (var0 == 6522) {
--Interpreter.Interpreter_stringStackSize;

View File

@@ -241,12 +241,12 @@ final class class4 implements class0 {
Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = SoundCache.canvasWidth;
Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = Huffman.canvasHeight;
return 1;
} else if (var0 == 3133) {
} else if (var0 == ScriptOpcodes.MOBILE_SETFPS) {
--RouteStrategy.Interpreter_intStackSize;
return 1;
} else if (var0 == 3134) {
} else if (var0 == ScriptOpcodes.MOBILE_OPENSTORE) {
return 1;
} else if (var0 == 3135) {
} else if (var0 == ScriptOpcodes.MOBILE_OPENSTORECATEGORY) {
RouteStrategy.Interpreter_intStackSize -= 2;
return 1;
} else if (var0 == 3136) {

View File

@@ -959,13 +959,13 @@ public final class class54 {
}
return 1;
} else if (var0 == 6697) {
} else if (var0 == ScriptOpcodes.WORLDMAP_ELEMENT) {
Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class15.worldMapEvent.mapElement;
return 1;
} else if (var0 == 6698) {
Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class15.worldMapEvent.coord1.packed();
return 1;
} else if (var0 == 6699) {
} else if (var0 == ScriptOpcodes.WORLDMAP_ELEMENTCOORD) {
Interpreter.Interpreter_intStack[++RouteStrategy.Interpreter_intStackSize - 1] = class15.worldMapEvent.coord2.packed();
return 1;
} else {

View File

@@ -67,6 +67,7 @@ public class ScriptOpcodes {
public static final int CC_RESUME_PAUSEBUTTON = 1121;
public static final int CC_SETFILLCOLOUR = 1123;
public static final int CC_SETLINEDIRECTION = 1126;
public static final int CC_SETMODELTRANSPARENT = 1127;
public static final int CC_SETOBJECT = 1200;
public static final int CC_SETNPCHEAD = 1201;
public static final int CC_SETPLAYERHEAD_SELF = 1202;
@@ -80,6 +81,12 @@ public class ScriptOpcodes {
public static final int CC_SETOPBASE = 1305;
public static final int CC_SETTARGETVERB = 1306;
public static final int CC_CLEAROPS = 1307;
public static final int CC_SETOPKEY = 1350;
public static final int CC_SETOPTKEY = 1351;
public static final int CC_SETOPKEYRATE = 1352;
public static final int CC_SETOPTKEYRATE = 1353;
public static final int CC_SETOPKEYIGNOREHELD = 1354;
public static final int CC_SETOPTKEYIGNOREHELD = 1355;
public static final int CC_SETONCLICK = 1400;
public static final int CC_SETONHOLD = 1401;
public static final int CC_SETONRELEASE = 1402;
@@ -124,6 +131,7 @@ public class ScriptOpcodes {
public static final int CC_GETTRANS = 1609;
public static final int CC_GETCOLOUR = 1611;
public static final int CC_GETFILLCOLOUR = 1612;
public static final int CC_GETMODELTRANSPARENT = 1614;
public static final int CC_GETINVOBJECT = 1700;
public static final int CC_GETINVCOUNT = 1701;
public static final int CC_GETID = 1702;
@@ -159,6 +167,7 @@ public class ScriptOpcodes {
public static final int IF_RESUME_PAUSEBUTTON = 2121;
public static final int IF_SETFILLCOLOUR = 2123;
public static final int IF_SETLINEDIRECTION = 2126;
public static final int IF_SETMODELTRANSPARENT = 2127;
public static final int IF_SETOBJECT = 2200;
public static final int IF_SETNPCHEAD = 2201;
public static final int IF_SETPLAYERHEAD_SELF = 2202;
@@ -222,6 +231,7 @@ public class ScriptOpcodes {
public static final int IF_GETTRANS = 2609;
public static final int IF_GETCOLOUR = 2611;
public static final int IF_GETFILLCOLOUR = 2612;
public static final int IF_GETMODELTRANSPARENT = 2614;
public static final int IF_GETINVOBJECT = 2700;
public static final int IF_GETINVCOUNT = 2701;
public static final int IF_HASSUB = 2702;
@@ -254,6 +264,9 @@ public class ScriptOpcodes {
public static final int GETTAPTODROP = 3128;
public static final int SETOCULUSORBSPEED = 3129;
public static final int GETCANVASSIZE = 3132;
public static final int MOBILE_SETFPS = 3133;
public static final int MOBILE_OPENSTORE = 3134;
public static final int MOBILE_OPENSTORECATEGORY = 3135;
public static final int SETHIDEUSERNAME = 3141;
public static final int GETHIDEUSERNAME = 3142;
public static final int SETREMEMBERUSERNAME = 3143;
@@ -438,6 +451,7 @@ public class ScriptOpcodes {
public static final int STRUCT_PARAM = 6516;
public static final int ON_MOBILE = 6518;
public static final int CLIENTTYPE = 6519;
public static final int MOBILE_KEYBOARDHIDE = 6521;
public static final int BATTERYLEVEL = 6524;
public static final int BATTERYCHARGING = 6525;
public static final int WIFIAVAILABLE = 6526;
@@ -475,4 +489,6 @@ public class ScriptOpcodes {
public static final int MEC_TEXTSIZE = 6694;
public static final int MEC_CATEGORY = 6695;
public static final int MEC_SPRITE = 6696;
public static final int WORLDMAP_ELEMENT = 6697;
public static final int WORLDMAP_ELEMENTCOORD = 6699;
}