cache: rename additional npc definition fields

This commit is contained in:
Adam
2018-06-25 19:44:36 -04:00
parent e85ba88d3a
commit e7574b4ff5
3 changed files with 32 additions and 32 deletions

View File

@@ -34,7 +34,7 @@ public class NpcDefinition
public final int id; public final int id;
public short[] recolorToFind; public short[] recolorToFind;
public int anInt2156 = 32; public int rotation = 32;
public String name = "null"; public String name = "null";
public short[] recolorToReplace; public short[] recolorToReplace;
public int[] models; public int[] models;
@@ -49,7 +49,7 @@ public class NpcDefinition
public int resizeX = 128; public int resizeX = 128;
public int contrast = 0; public int contrast = 0;
public int rotate180Animation = -1; public int rotate180Animation = -1;
public int anInt2174 = -1; public int varbitIndex = -1;
public String[] options = new String[5]; public String[] options = new String[5];
public boolean renderOnMinimap = true; public boolean renderOnMinimap = true;
public int combatLevel = -1; public int combatLevel = -1;
@@ -58,9 +58,9 @@ public class NpcDefinition
public boolean hasRenderPriority = false; public boolean hasRenderPriority = false;
public int ambient = 0; public int ambient = 0;
public int headIcon = -1; public int headIcon = -1;
public int[] anIntArray2185; public int[] configs;
public short[] retextureToFind; public short[] retextureToFind;
public int anInt2187 = -1; public int varpIndex = -1;
public boolean isClickable = true; public boolean isClickable = true;
public int anInt2189 = -1; public int anInt2189 = -1;
public boolean aBool2190 = false; public boolean aBool2190 = false;

View File

@@ -179,35 +179,35 @@ public class NpcLoader
} }
else if (opcode == 103) else if (opcode == 103)
{ {
def.anInt2156 = stream.readUnsignedShort(); def.rotation = stream.readUnsignedShort();
} }
else if (opcode == 106) else if (opcode == 106)
{ {
def.anInt2174 = stream.readUnsignedShort(); def.varbitIndex = stream.readUnsignedShort();
if ('\uffff' == def.anInt2174) if ('\uffff' == def.varbitIndex)
{ {
def.anInt2174 = -1; def.varbitIndex = -1;
} }
def.anInt2187 = stream.readUnsignedShort(); def.varpIndex = stream.readUnsignedShort();
if ('\uffff' == def.anInt2187) if ('\uffff' == def.varpIndex)
{ {
def.anInt2187 = -1; def.varpIndex = -1;
} }
length = stream.readUnsignedByte(); length = stream.readUnsignedByte();
def.anIntArray2185 = new int[length + 2]; def.configs = new int[length + 2];
for (index = 0; index <= length; ++index) for (index = 0; index <= length; ++index)
{ {
def.anIntArray2185[index] = stream.readUnsignedShort(); def.configs[index] = stream.readUnsignedShort();
if (def.anIntArray2185[index] == '\uffff') if (def.configs[index] == '\uffff')
{ {
def.anIntArray2185[index] = -1; def.configs[index] = -1;
} }
} }
def.anIntArray2185[length + 1] = -1; def.configs[length + 1] = -1;
} }
else if (opcode == 107) else if (opcode == 107)
@@ -224,16 +224,16 @@ public class NpcLoader
} }
else if (opcode == 118) else if (opcode == 118)
{ {
def.anInt2174 = stream.readUnsignedShort(); def.varbitIndex = stream.readUnsignedShort();
if ('\uffff' == def.anInt2174) if ('\uffff' == def.varbitIndex)
{ {
def.anInt2174 = -1; def.varbitIndex = -1;
} }
def.anInt2187 = stream.readUnsignedShort(); def.varpIndex = stream.readUnsignedShort();
if ('\uffff' == def.anInt2187) if ('\uffff' == def.varpIndex)
{ {
def.anInt2187 = -1; def.varpIndex = -1;
} }
int var = stream.readUnsignedShort(); int var = stream.readUnsignedShort();
@@ -243,18 +243,18 @@ public class NpcLoader
} }
length = stream.readUnsignedByte(); length = stream.readUnsignedByte();
def.anIntArray2185 = new int[length + 2]; def.configs = new int[length + 2];
for (index = 0; index <= length; ++index) for (index = 0; index <= length; ++index)
{ {
def.anIntArray2185[index] = stream.readUnsignedShort(); def.configs[index] = stream.readUnsignedShort();
if (def.anIntArray2185[index] == '\uffff') if (def.configs[index] == '\uffff')
{ {
def.anIntArray2185[index] = -1; def.configs[index] = -1;
} }
} }
def.anIntArray2185[length + 1] = var; def.configs[length + 1] = var;
} }
else if (opcode == 249) else if (opcode == 249)
{ {

View File

@@ -144,7 +144,7 @@ public class NpcSaver
out.writeShort(npc.headIcon); out.writeShort(npc.headIcon);
} }
out.writeByte(103); out.writeByte(103);
out.writeShort(npc.anInt2156); out.writeShort(npc.rotation);
if (!npc.isClickable) if (!npc.isClickable)
{ {
out.writeByte(107); out.writeByte(107);
@@ -157,13 +157,13 @@ public class NpcSaver
{ {
out.writeByte(111); out.writeByte(111);
} }
if (npc.anIntArray2185 != null) if (npc.configs != null)
{ {
out.writeByte(118); out.writeByte(118);
out.writeShort(npc.anInt2174); out.writeShort(npc.varbitIndex);
out.writeShort(npc.anInt2187); out.writeShort(npc.varpIndex);
int[] c = npc.anIntArray2185; int[] c = npc.configs;
out.writeShort(c[c.length - 1]); out.writeShort(c[c.length - 1]);
out.writeByte(c.length - 2); out.writeByte(c.length - 2);
for (int i = 0; i <= c.length - 2; ++i) for (int i = 0; i <= c.length - 2; ++i)