Ricky92 Hi man, let me explain.
Ragnarok Online handles 2 types of -monsters-. Sprite mobs and 3D mobs.
After Installing Ragnarok Online, they stores the gr2 resources at these paths when installing:
"data/model/3dmob/" <-- Common gr2 files which includes the default animaton. The default last gr2 in the game installacion is named as "sguardian90_9.gr2". This "_9" is the id of this model.
"data/model/3dmob/bone" <-- Aditional gr2 files which has only bones of the previous gr2 listed. The max amount is 4 per monster. To our previous example, the animations are named as "9_attack.gr2", "9_damage,gr2","9_dead.gr2","9_move,gr2".
Additional, the "sguardian90_9.gr2" file is listed easily and handy (thanks by a previous decompiler of these lua files, made by our community) at;
data/lua files/datainfo/jobname.lua <-- Basically its function is about giving a name of the files listed, in our case "sguardian90_9.gr2" to only "SOLDIER_GUARDIAN".
data/lua files/datainfo/npcidentity.lua <-- Asigns an additional ID to this "SOLDIER_GUARDIAN" . This ID is used at the rAthena server emulator database, which it is asked at summonning the monster.
When "sguardian90_9.gr2" is summoned in the game, the monster appears by first in its "default standing animation", which is the one included by default in this gr2 file (as you see we are not changing this, it is just as how you said that the default animation is included in the gr2). Then, if it is asked to attack , move, or die (by our server instructions) the client reads, the corresponding id bones animations of this monster id.gr2 files And, shows it.
This Ragnarok game has 9 reserved ID monsters as the example I said, installed by default. Which they all follow this same structure of working. All these time doing our examples has been by replacing one of those 9 ID monsters.
Until some days we have been only testing our custom GR2 monsters thanks by your exporter, by naming our GR2 files just by replacing one of the installed by default. And all tests regarding this are good.
==================================
From this, we are moving onwards to the second part of this project:
It is about, using our custom gr2 files without having to replace one of these IDs. This is not new to us, since we are allready able to do it by only adding the new entries in the lua files I listed before. So as adding the new entry in the rAthena server database.
Our concern is, that, by doing this. this same GR2 monster that we have tested all these time and works pretty well by replacing an existing ID, now, as a new custom entry ID, it is summoned sucessfully in the Game, however,
it appears as a static model when you are standing. So as when you are walking, it continues to be static.
What is happening is that the Game Client, the exe, has a hardcoded function which tell what gr2 monster will have animation, and what not. At this point, This member: Curiosity accepted to give a try to this, and by looking at the client (for what we use IDA Interactive Dissambler) he found this function:
int __thiscall getGrannyModel(void *this, int a_id, int a_type)
{
void *v3; // ebx@1
char *v4; // ebp@1
int v5; // eax@5
v3 = this;
v4 = (char *)this + 4 * (a_type + 4 * (5 * a_id + 40));
if ( *(_DWORD *)v4 )
return *(_DWORD *)v4;
modelResPath = 0;
if ( (unsigned int)a_id <= 9 )
{
if ( (unsigned int)a_type <= 4 )
{
if ( a_type )
{
sprintf(&modelResPath, "model\\3dmob_bone\\%d_%s.gr2", a_id, animTypeStringTable[a_type]);
}
else
{
v5 = sub_6E6000(dword_7CAA8C[a_id]);
sprintf(&modelResPath, "model\\3dmob\\%s", v5);
}
if ( modelResPath && (unsigned __int8)fileExists(&modelResPath) )
{
if ( a_id != 1 )
readGrannyModelFromDisk(v3, &modelResPath, a_id, a_type);
return *(_DWORD *)v4;
}
}
}
return 0;
}
Exactly quoting this line of the previous code, this is what limits the "Sguardian90_9.gr2". being the last "9" ID reserved to be readed as an animated monster.
"if ( (unsigned int)a_id <= 9 )"
Increasing this value hardcoded in the Game Client, overrides this limit, and makes possible that now, it reads additional gr2 files,and shows its animation by custom gr2 IDs besides the lastest listed as "_9" . What it has no sense until now, is, that it only shows the animations under "data/model/3dmob_bone/" So when the monster is standing it continues to be static, but when moving/attacking/etc, it is showing animation.
I thought that it was good to explain it all. (Since Ricky92 doesn't has to do with our emu, our client or data files it uses) But in short:
That is!