Hallo, ich sitze nun schon seit mehreren Tagen an einem Programm, welches mir eine .rdb Datei ausliest.
Leider habe ich bis jetzt noch keine wirklich funktionierende Lösung gefunden.
Als Struktur, habe ich folgende Anhaltspunkte bekommen:
// Dependencies: db_item.ref
// The db_item.ref structure is the following:
// struct HEADER {
// int entries;
// int string_length;
// }header;
// struct MAIN {
// char filename[string_length];
// }main[header.entries];
//
// The numbers for model, icon_file_name, etc.
// are the position/index of the relevant "filename"
// in the db_item.ref. Remember: The index starts
// at 0, not 1!
//--------------------------------------
struct MAIN {
struct HEADER{
char signature[128];
int entries;
}header;
struct FILE{
int id;
int name_id;
int type;
int group;
int class;
int set_id;
int set_part_flag;
int rank;
int level;
int enhance;
int socket;
int status_flag;
int min_level;
int max_level;
int range;
float weight;
int price;
int huntaholic_point;
int ethereal_durability;
int endurance;
int wear_type;
int limit_flag;
int item_flag;
int material;
int summon_id;
int throw_range;
short base_type[4];
float base_var_1[4];
float base_var_2[4];
short opt_type[4];
float opt_var_1[4];
float opt_var_2[4];
int effect_id;
int enhance_id;
int skill_id;
int state_id;
int state_level;
int state_time;
int cool_time;
int available_period;
short cool_time_group;
short decrease_type;
short job_depth;
short unknown1;
char model_type[8]; // Only byte 0-3 and 5-7 is relevant
int deco_model_change;
int unknown2;
// See Info at the top of file
short model[18];
// See Info at the top of file
short texture_file_name;
// See Info at the top of file
short drop_type;
short icon_id;
// See Info at the top of file
short icon_file_name;
int tooltip_id;
int group_bit_set;
// Entry for EnhanceEffectResource
// sid is enhance_id
short effect_id_db[2]; // effect_id in EnhanceEffectResource
// value_01 - value_04 = value[0] OR value[10];
// value_05 - value_08 = value[1] OR value[11];
// value_09 - value_12 = value[2] OR value[12];
// value_13 - value_16 = value[3] OR value[13];
// value_17 - value_20 = value[4] OR value[14];
// value_21 = value[5] OR value[15];
// value_22 = value[6] OR value[16];
// value_23 = value[7] OR value[17];
// value_24 = value[8] OR value[18];
// value_25 = value[9] OR value[19];
// that depends on the sub_id
float value[20];
}file[header.entries];
}main;
Alles anzeigen
Wie man aus den Informationen entnehmen kann, handelt es sich bei den ersten 128 bytes um eine Signatur welches die Zeit im Format YYYYMMDD enthält. Danach folgt eine 4 byte zahl, welches die Anzahl an Einträge berreitstellt.
Nun soweit bin ich bereits gekommen:
void ItemResource::LoadEntitys( std::fstream& pRDBFile, eItemResource data[], int iEntitys)
{
for (int _i = 0; _i < iEntitys; ++_i)
{
pRDBFile.read((char*)&data[_i], sizeof(eItemResource));
}
}
Im erstem Eintrag müsste model[0] "sword009" sein.
Hat jemand von euch einen Ansatz / Lösung, was ich unternehmen könnte ?
Download der .rdb Datei:
https://mega.nz/#!MNYGHCID!Orq…kCMo-RVUVjmsw0A
PS: Die 128 bytes + 4 bytes sind zur Laufzeit der oben gezeigten Funktion berreits ausgelesen
Mit freundlichem Gruß
LuXorioN