OK I'm going to make my first tutorial, I know there's lots of Dragon Claw tutorials out there but i thought I would make one that will help people get "Add Model" working or fix the invisible Claws after Adding Model issue.
To start create a New Folder in your client folder, and name it "Raw"
Now download the Claw Models.
UPLOAD.EE - Download Dragon_Claws.zip
After downloading the Claws model unzip them into your Raw folder.
Now go into ItemDef.java and Look for.
Code:
/* Hardcoded items start here */
/**/
Under that add.
Code:
if(i == 14484) {
itemDef.actions = new String[5];
itemDef.actions[1] = "Wield";
itemDef.modelID = 44590;
itemDef.maleEquip1 = 43660;//anInt165
itemDef.femaleEquip1 = 43660;//anInt200
itemDef.modelZoom = 789;
itemDef.modelRotation1 = 240;
itemDef.modelRotation2 = 60;
itemDef.modelOffset1 = -1;
itemDef.modelOffset2 = -23;
itemDef.name = "Dragon claws";
itemDef.description = "A set of fighting claws.".getBytes();
}
return itemDef;
}
Save that and now go into Client.java.
Search for.
Code:
public byte[] getModel(int Index) {
Now you should see.
Code:
public byte[] getModel(int Index) {
try {
File Model = new File("./models/"+Index+".gz");
byte[] aByte = new byte[(int)Model.length()];
FileInputStream fis = new FileInputStream(Model);
fis.read(aByte);
pushMessage("aByte = ["+aByte+"]!", 0, "");
fis.close();
return aByte;
}
catch(Exception e)
{return null;}
}
Change the "./models/" to ./Raw/ and next to the that ".gz" to ".dat"
Now find.
Code:
public void preloadModels() {
You should see.
Code:
public void preloadModels() {
File file = new File("./Raw/");
File[] fileArray = file.listFiles();
for(int y = 0; y < fileArray.length; y++) {
String s = fileArray[y].getName();
byte[] buffer = ReadFile("./Raw/"+s);
Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
}
}
Just make sure you have "./Raw/" in both the locations shown.
Now look for.
change too.
Save and Compile.
Log into your client and type "Add Model" and type in 43660 and do it again but type 44590
Now restart and Enjoy.
Please tell me if I missed anything out, thanks.