Things like animations, items, objects, npcs, identikit, graphics, etc, have definitions. These definitions are packed (encoded, whatever you wanna call it) into a single .dat file (in 317s at least) inside the cache. So an example of this (probably forgetting some)
Animation -> seq.dat
Items -> obj.dat, obj.idx
Objects -> loc.dat, loc.idx
Npcs -> npc.dat, npc.idx
Identikit -> idk.dat
Graphics -> spotanim.dat
the .dat files have the definitions and i BELIEVE the idx files hold the count for said config and I think offsets. Anyways if you're going to add custom items, animations, npc or whatever you usually dont need to modify the packed form, instead you're going to need to pack the model/animation into the correct index
Index 0: Config files
Index 1: Models
Index 2: Animations
Index 3: Sound effect/Music (cant remember which one)
Index 4: Maps
and get the definition, which you refer to as 'ints', and hardcode it in. An example of unpacked definition would be
Code:
case 2:
objType.name = "Cannonball";
objType.xAngle2D = 156;
objType.yAngle2D = 1852;
objType.xOffset2D = 1;
objType.cost = 5;
objType.members = true;
objType.baseModel = 2413;
objType.stackable = ALWAYS;
objType.zoom2D = 1400;
objType.unnoted = true;
break;
That's an item from rs cache. To get definitions, you can either find some released on this forum or get it yourself. Definitions are just decoded data or w/e from the config file so the definition i just posted here is from obj.dat. Once you pack your model/animation file you just get your definition and add it in the right class so for the one I just posted you would go to what most clients has as "ItemDef" or "ItemDefinition" and in a method that looks like this (probably called forID in your client)
Code:
public static ItemDefinition lookup(int id) {
for (int i = 0; i < 10; i++) {
if (cache[i].id == id) {
return cache[i];
}
}
cacheIndex = (cacheIndex + 1) % 10;
ItemDefinition definition = cache[cacheIndex];
data.setPosition(offsets[id]);
definition.id = id;
definition.reset();
definition.decode(data);
if (definition.notedTemplateId != -1) {
definition.toNote();
}
if (!membersServer && definition.members) {
definition.name = "Members Object";
definition.description = "Login to a members' server to use this object.".getBytes();
definition.groundActions = null;
definition.widgetActions = null;
definition.team = 0;
}
return definition;
}
you add the definitions, so...
Code:
public static ItemDefinition lookup(int id) {
for (int i = 0; i < 10; i++) {
if (cache[i].id == id) {
return cache[i];
}
}
cacheIndex = (cacheIndex + 1) % 10;
ItemDefinition definition = cache[cacheIndex];
data.setPosition(offsets[id]);
definition.id = id;
definition.reset();
definition.decode(data);
if (definition.notedTemplateId != -1) {
definition.toNote();
}
if (!membersServer && definition.members) {
definition.name = "Members Object";
definition.description = "Login to a members' server to use this object.".getBytes();
definition.groundActions = null;
definition.widgetActions = null;
definition.team = 0;
}
switch (definition.id) {
case 2:
definition.name = "Cannonball";
definition.xAngle2D = 156;
definition.yAngle2D = 1852;
definition.xOffset2D = 1;
definition.cost = 5;
definition.members = true;
definition.baseModel = 2413;
definition.stackable = ALWAYS;
definition.zoom2D = 1400;
definition.unnoted = true;
break;
}
return definition;
}
Naming will of course be different in every client so you will have to edit that
Sorry for awkward wording and I might be wrong on some of this stuff so yeah, if anyone notices something i said wrong please point it out.
If you still have questions or I didnt answer you the way you wanted lmk
tl;dr when adding custom (hardcoded) items npcs or whatever you dont usually have to touch the .dat (config) file for it, just pack the model/anim/map files and hardcode the definition in the corresponding class
rep me plz