I know what you are thinking. "Oh god, another tutorial on adding maps" I know there is several snippets on adding high revision maps but yet people still cannot add them. Even though they are not spoon fed snippets, it's pretty easy to add maps though. So this tutorial will guide you through every step.
Step 1: Things needed
Index repacking snippet by Galkon:
http://www.rune-server.org/runescape...repacking.html
Cache suite:
Toms Suite
Gzipper(Only download if the maps models/and or object models are gzipped already)
Download All.InOne.Zipper.jar @ UppIT
Maps/objects/index and data files
http://www.rune-server.org/runescape...-releases.html
Step 2: Editing the correct client files
PLEASE BACKUP YOU CACHE AND CLIENT FILES BEFORE DOING ANYTHING AFTER STEP 1!
ObjectDef/ObjectDefinition/ObjectType
Replace this:
Readvalues:
Code:
private void readValues(Buffer buffer) {
int i = -1;
label0: do {
int opcode;
do {
opcode = buffer.readUnsignedByte();
if (opcode == 0)
break label0;
if (opcode == 1) {
int k = buffer.readUnsignedByte();
if (k > 0)
if (anIntArray773 == null || lowMem) {
anIntArray776 = new int[k];
anIntArray773 = new int[k];
for (int k1 = 0; k1 < k; k1++) {
anIntArray773[k1] = buffer.readUnsignedWord();
anIntArray776[k1] = buffer.readUnsignedByte();
}
} else {
buffer.currentOffset += k * 3;
}
} else if (opcode == 2)
name = buffer.readString();
else if (opcode == 3)
description = buffer.readBytes();
else if (opcode == 5) {
int l = buffer.readUnsignedByte();
if (l > 0)
if (anIntArray773 == null || lowMem) {
anIntArray776 = null;
anIntArray773 = new int[l];
for (int l1 = 0; l1 < l; l1++)
anIntArray773[l1] = buffer.readUnsignedWord();
} else {
;//buffer.currentOffset += l * 2;
}
} else if (opcode == 14)
anInt744 = buffer.readUnsignedByte();
else if (opcode == 15)
anInt761 = buffer.readUnsignedByte();
else if (opcode == 17)
aBoolean767 = false;
else if (opcode == 18)
aBoolean757 = false;
else if (opcode == 19) {
i = buffer.readUnsignedByte();
if (i == 1)
hasActions = true;
} else if (opcode == 21)
aBoolean762 = true;
else if (opcode == 22)
aBoolean769 = false;//
else if (opcode == 23)
aBoolean764 = true;
else if (opcode == 24) {
anInt781 = buffer.readUnsignedWord();
if (anInt781 == 65535)
anInt781 = -1;
} else if (opcode == 28)
anInt775 = buffer.readUnsignedByte();
else if (opcode == 29)
aByte737 = buffer.readSignedByte();
else if (opcode == 39)
aByte742 = buffer.readSignedByte();
else if (opcode >= 30 && opcode < 39) {
if (actions == null)
actions = new String[10];
actions[opcode - 30] = buffer.readString();
if (actions[opcode - 30].equalsIgnoreCase("hidden"))
actions[opcode - 30] = null;
} else if (opcode == 40) {
int i1 = buffer.readUnsignedByte();
modifiedModelColors = new int[i1];
originalModelColors = new int[i1];
for (int i2 = 0; i2 < i1; i2++) {
modifiedModelColors[i2] = buffer.readUnsignedWord();
originalModelColors[i2] = buffer.readUnsignedWord();
}
} else if (opcode == 60)
anInt746 = buffer.readUnsignedWord();
else if (opcode == 62)
aBoolean751 = true;
else if (opcode == 64)
aBoolean779 = false;
else if (opcode == 65)
anInt748 = buffer.readUnsignedWord();
else if (opcode == 66)
anInt772 = buffer.readUnsignedWord();
else if (opcode == 67)
anInt740 = buffer.readUnsignedWord();
else if (opcode == 68)
anInt758 = buffer.readUnsignedWord();
else if (opcode == 69)
anInt768 = buffer.readUnsignedByte();
else if (opcode == 70)
anInt738 = buffer.readSignedWord();
else if (opcode == 71)
anInt745 = buffer.readSignedWord();
else if (opcode == 72)
anInt783 = buffer.readSignedWord();
else if (opcode == 73)
aBoolean736 = true;
else if (opcode == 74) {
aBoolean766 = true;
} else {
if (opcode != 75)
continue;
anInt760 = buffer.readUnsignedByte();
}
continue label0;
} while (opcode != 77);
anInt774 = buffer.readUnsignedWord();
if (anInt774 == 65535)
anInt774 = -1;
anInt749 = buffer.readUnsignedWord();
if (anInt749 == 65535)
anInt749 = -1;
int j1 = buffer.readUnsignedByte();
childrenIDs = new int[j1 + 1];
for (int j2 = 0; j2 <= j1; j2++) {
childrenIDs[j2] = buffer.readUnsignedWord();
if (childrenIDs[j2] == 65535)
childrenIDs[j2] = -1;
}
} while (true);
if (i == -1) {
hasActions = anIntArray773 != null && (anIntArray776 == null || anIntArray776[0] == 10);
if (actions != null)
hasActions = true;
}
if (aBoolean766) {
aBoolean767 = false;
aBoolean757 = false;
}
if (anInt760 == -1)
anInt760 = aBoolean767 ? 1 : 0;
}
forID/get
Code:
public static ObjectDefinition forID(int i) {
if (i > streamIndices.length)
i = streamIndices.length - 1;
for(int j = 0; j < 20; j++)
if(cache[j].type == i) {
return cache[j];
}
cacheIndex = (cacheIndex + 1) % 20;
ObjectDefinition objectDef = cache[cacheIndex];
try {
buffer.currentOffset = streamIndices[i];
} catch(Exception e) {
e.printStackTrace();
}
objectDef.type = i;
objectDef.setDefaults();
objectDef.readValues(buffer);
return objectDef;
}
OnDemandFetcher (You might have to rename few things,
mapIndex - mapIndices
CacheArchive - StreamLoader
Buffer - Stream
ectect
Code:
public void start(CacheArchive archive, Client client) {
byte[] data = archive.getFile("map_index");
Buffer stream2 = new Buffer(data);
int length = data.length / 7;
mapIndex1 = new int[length];
mapIndex2 = new int[length];
mapIndex3 = new int[length];
for (int i2 = 0; i2 < length; i2++) {
mapIndex1[i2] = stream2.getUShort();
mapIndex2[i2] = stream2.getUShort();
mapIndex3[i2] = stream2.getUShort();
}
System.out.println("Maps Loaded: " + length);
data = archive.getFile("anim_index");
stream2 = new Buffer(data);
length = data.length / 2;
animIndex = new int[length];
for (int i = 0; i < length; i++) {
animIndex[i] = stream2.getUShort();
}
data = archive.getFile("midi_index");
stream2 = new Buffer(data);
length = data.length;
midiIndex = new int[length];
for (int i = 0; i < length; i++) {
midiIndex[i] = stream2.getUByte();
}
this.client = client;
running = true;
client.startThread(this, 2);
}
Step 3: Packing the models/data/index files
Make 2 new folders in your cache named index1 and index4
extract the object models into index1, and the map models into index4
then in client.java, startUp method add
repackCacheIndex(1);
repackCacheIndex(4);
After you have done that, open up toms cache suite, load your cache,
then once it has loaded, click the tab "View/Edit JaGex Archives"
then choose the option config.jag
and replace loc.dat and loc.idx with the ones you downloaded, then click the button repack archive.
Once it has repacked, close down that itnerface and click Jagex archives again, but this time go to the tab, versionlist.jag
and replace map_index.dat with the one you downloaded.
Step 4: Finishing off.
After you have completed step 2 & 3 without getting any errors, run your client and wait for the objects and maps to pack into your cache, you will see in the cmd it spamming
"Repacking: #"
Credits:
Galkon
Poesy700
Hopefully this is enough to help a newbie add high revision maps to their client!
If you have any questions at all, feel free to PM me or leave a comment below.