RuneScape 2 Development > RS Client Hacking
[CHEAPHAX]Adding God Wars map
(1/33) >>>
cocoa:
FIXED


Make a new Java file named "ModelDecompressor.java"

Put this into it:

--- Code: ---import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.DataOutputStream;
import java.io.FileOutputStream;


public class ModelDecompressor {

public static void loadModels() {
try {
DataInputStream indexFile = new DataInputStream(new FileInputStream("./cache/GodWarsModels.idx"));
DataInputStream dataFile = new DataInputStream(new FileInputStream("./cache/GodWarsModels.dat"));
int length = indexFile.readInt();
for(int i = 0; i < length; i++) {
int id = indexFile.readInt();
int invlength = indexFile.readInt();
byte[] data = new byte[invlength];
dataFile.readFully(data);
Class30_Sub2_Sub4_Sub6.method460(data, -4036, id);
}
indexFile.close();
dataFile.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
--- End code ---

Open your client class and find:

--- Code: ---Class30_Sub2_Sub4_Sub6.method459(aClass42_Sub1_1068.method555(79, 0), aClass42_Sub1_1068);
--- End code ---

Under that put:

--- Code: ---     System.out.println("Loading GodWars Model Cache.");
    ModelDecompressor.loadModels();
    System.out.println("GodWars Model Cache loaded.");

--- End code ---

Search for:

--- Code: ---method13(75, (byte)4, "Requesting maps");

--- End code ---

Put:

--- Code: ---     System.out.println("Loading New Maps.");
    setNewMaps();
    System.out.println("New Maps Loaded.");
--- End code ---

The println is just in case you an unpacking error or something right after that prints out, you'll know it's because of that.


Declare these in your client class

--- Code: --- public int positions[] = new int[2000];
public int landScapes[] = new int[2000];
public int objects[] = new int[2000];

public void setNewMaps() {
try {
BufferedReader in = new BufferedReader(new FileReader("./cache/mapConfig.txt"));
String s;
int D = 0;
while ((s = in.readLine()) != null)  {
positions[D] = Integer.parseInt(s.substring(s.indexOf("=")+1,s.indexOf("(")));
landScapes[D] = Integer.parseInt(s.substring(s.indexOf("(")+1,s.indexOf(")")));
objects[D] = Integer.parseInt(s.substring(s.indexOf("[")+1,s.indexOf("]")));
D++;
}
System.out.println("Total of "+D+" Maps added onto the world map!");
} catch (IOException e) {
e.printStackTrace();
}
}
--- End code ---

In your client class search for "method22"

Replace your entire method22 void with this:

http://pastebin.com/rthk9M4T

It's on pastebin because the amount of code was ridiculous.



You're done with the client class so close that and save it.


Now open up Class46 and find:

--- Code: ---class46.method582(true, aClass30_Sub2_Sub2_753);
--- End code ---

Under that add:

--- Code: --- if(i >= 25000 && i <= 26862){
try {
BufferedReader in = new BufferedReader(new FileReader("./cache/ObjectConfigs/"+i+".txt"));
String s;
class46.aBoolean769 = false;//Model isn't black
while ((s = in.readLine()) != null) {
if(s.startsWith("aString739=")) {
if(s.substring(s.indexOf("=")+1).startsWith("null")) {
class46.aBoolean778 = false;//can't be right clicked
} else {
class46.aString739 = s.substring(s.indexOf("=")+1);//writes name
}
}
 
if(s.startsWith("maxi="))
class46.anIntArray773 =  new int[Integer.parseInt(s.substring(s.indexOf("=")+1))];
for(int j1 = 0; j1 < 200; j1++)
if(s.startsWith("anIntArray773["+j1+"]="))
class46.anIntArray773[j1] = Integer.parseInt(s.substring(s.indexOf("=")+1));
if(s.startsWith("anInt744="))//absX Length
class46.anInt744 = Integer.parseInt(s.substring(s.indexOf("=")+1));
if(s.startsWith("anInt761="))//absY Length
class46.anInt761 = Integer.parseInt(s.substring(s.indexOf("=")+1));
if(s.startsWith("anInt772="))
class46.anInt772 = Integer.parseInt(s.substring(s.indexOf("=")+1));
if(s.startsWith("aStringArray786="))
class46.aStringArray786[0] = s.substring(s.indexOf("=")+1);
if(s.startsWith("anInt748="))
class46.anInt748 = Integer.parseInt(s.substring(s.indexOf("=")+1));
if(s.startsWith("anInt740="))
class46.anInt740 = Integer.parseInt(s.substring(s.indexOf("=")+1));
if(s.startsWith("test="))
class46.anInt745 = Integer.parseInt(s.substring(s.indexOf("=")+1));
if(s.startsWith("maxj="))
class46.anIntArray776 =  new int[Integer.parseInt(s.substring(s.indexOf("=")+1))];
for(int j1 = 0; j1 < 200; j1++)
if(s.startsWith("type["+j1+"]=")){
class46.anIntArray776[j1] = Integer.parseInt(s.substring(s.indexOf("=")+1));
if(Integer.parseInt(s.substring(s.indexOf("=")+1)) == 22)
class46.aBoolean767 = false;
      class46.aBoolean762 = true;
}
    class46.anInt775 = 0;
}
in.close();
return class46;
} catch (IOException e) {
e.printStackTrace();
}
}
--- End code ---

At the top of class46 add:

--- Code: ---import java.io.*;
--- End code ---

Close that and save it.

Make sure that you have a folder named "cache" or else none of this will work.


Now in the cache folder add all of these files.

Mirror 1-Mediafire[/url]
If someone can upload it to another site, I'll post it up here put uppit and megaupload won't let me atm. So only 1 mirror sorry.

Credits: Rixi, SWAT, Ben, PeterbjornX, Me I guess for just using what they gave us :D


Video Tour



mager pk:
OMFG!!!!!!!!!!!!!!!!!!!!!!!!! DUDE!!!! NICE!!!! BUT WHY RELEASE?!?!?!
cocoa:
A lot of people were having trouble adding it plus it's not really the CORRECT way to do it, well actually, it's definitely not the correct way to do it but meh.
Pouch:
make dis for refractored :P
mager pk:
i was having trouble. :\

i had the floormaps working but then i couldnt get the fudgeing object maps loading. >.> i tried everything.

EDIT: i got 4 errors.



Class46.java:24: cannot find symbol
symbol  : class BufferedReader
location: class Class46
                BufferedReader in = new BufferedReader(new FileReader("./cache/O
bjectConfigs/"+i+".txt"));
                ^
Class46.java:24: cannot find symbol
symbol  : class BufferedReader
location: class Class46
                BufferedReader in = new BufferedReader(new FileReader("./cache/O
bjectConfigs/"+i+".txt"));
                                        ^
Class46.java:24: cannot find symbol
symbol  : class FileReader
location: class Class46
                BufferedReader in = new BufferedReader(new FileReader("./cache/O
bjectConfigs/"+i+".txt"));
                                                           ^
Class46.java:68: cannot find symbol
symbol  : class IOException
location: class Class46
                } catch (IOException e) {
                         ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 errors
Press any key to continue . . .
Navigation
Message Index
Next page

Go to full version
Powered by SMFPacks SEO Pro Mod |