Originally Posted by
XTZGZoReX
@MaiN:
Code:
struct CreatureCache
{
int Id;
char *SubName;
char *IconName;
int TypeFlags;
int Type;
int Family;
int Rank;
int KillCredit1;
int KillCredit2;
int DisplayId1;
int DisplayId2;
int DisplayId3;
int DisplayId4;
float HpModifier;
float MpModifier;
char RacialLeader[4];
int QuestItem[6];
int MovementId;
char Name[4][1024];
char SubName[1024];
char IconName[1024];
};
That's the structure last I checked. I think yours is pre-3.1.x?
Anyway, just re-checked again, seems to comply with 3.3.2.
Code:
void __thiscall DbCreatureCache_Unpack(CreatureCacheEntry *this, CDataStore *data)
{
char **currentName; // ebx@1
CreatureCacheEntry *_this; // edi@1
CDataStore *_data; // esi@1
void *subName; // eax@8
void *v7; // eax@10
DWORD *v8; // ebx@12
char stringBuffer[1024]; // [sp+Ch] [bp-404h]@4
int v11; // [sp+40Ch] [bp-4h]@1
_data = data;
_this = this;
currentName = this->Names;
v11 = 4;
do
{
if ( *currentName )
SMemFree(*currentName, (int)".\\CreatureStats.cpp", 47, 0);
CDataStore__GetString(_data, stringBuffer, 0x400u);
if ( stringBuffer[0] )
*currentName = AllocateString(stringBuffer, ".\\CreatureStats.cpp", 50);
else
*currentName = 0;
++currentName;
}
while ( v11-- != 1 );
subName = _this->SubName;
if ( subName )
SMemFree(subName, (int)".\\CreatureStats.cpp", 54, 0);
CDataStore__GetString(_data, stringBuffer, 0x400u);
_this->SubName = AllocateString(stringBuffer, ".\\CreatureStats.cpp", 56);
v7 = _this->IconName;
if ( v7 )
SMemFree(v7, (int)".\\CreatureStats.cpp", 57, 0);
CDataStore__GetString(_data, stringBuffer, 0x400u);
_this->IconName = AllocateString(stringBuffer, ".\\CreatureStats.cpp", 59);
CDataStore__GetDWORD(_data, &_this->TypeFlags);
CDataStore__GetDWORD(_data, &_this->TypeID);
CDataStore__GetDWORD(_data, &_this->FamilyID);
CDataStore__GetDWORD(_data, &_this->Rank);
CDataStore__GetDWORD(_data, &_this->GroupID);
CDataStore__GetDWORD(_data, &_this->GroupID2);
CDataStore__GetDWORD(_data, &_this->SpellDataID);
CDataStore__GetDWORD(_data, &_this->ModelID1);
CDataStore__GetDWORD(_data, &_this->ModelID2);
CDataStore__GetDWORD(_data, &_this->ModelID3);
CDataStore_GetFloat(_data, &_this->TexOriginX);
CDataStore_GetFloat(_data, &_this->TexOriginY);
CDataStore__GetChar(_data, (unsigned __int8 *)&data->vtable + 3);
v8 = _this->QuestItems;
_this->RacialLeader = BYTE3(data->vtable) != 0;
v11 = 6;
do
{
CDataStore__GetDWORD(_data, v8);
++v8;
}
while ( v11-- != 1 );
CDataStore__GetDWORD(_data, &_this->MovementID);
}
So no, yours is wrong. It hasn't changed.
EDIT: To clarify, you're right about the health/mana modifiers.