* forgot to apply zone code changes to stuffextract
* extract some more fields from AreaTable.dbc
This commit is contained in:
parent
de4821f80a
commit
abff02ac19
@ -234,6 +234,9 @@ static const char *MapFormat =
|
|||||||
enum AreaTableEnum
|
enum AreaTableEnum
|
||||||
{
|
{
|
||||||
AREATABLE_ID = 0,
|
AREATABLE_ID = 0,
|
||||||
|
AREATABLE_PARENTMAP = 2,
|
||||||
|
AREATABLE_FLAGS = 4, // 64 in normal (?) areas
|
||||||
|
AREATABLE_LEVEL = 10,
|
||||||
AREATABLE_NAME1 = 11,
|
AREATABLE_NAME1 = 11,
|
||||||
AREATABLE_NAME2,
|
AREATABLE_NAME2,
|
||||||
AREATABLE_NAME3,
|
AREATABLE_NAME3,
|
||||||
@ -242,19 +245,20 @@ enum AreaTableEnum
|
|||||||
AREATABLE_NAME6,
|
AREATABLE_NAME6,
|
||||||
AREATABLE_NAME7,
|
AREATABLE_NAME7,
|
||||||
AREATABLE_NAME8,
|
AREATABLE_NAME8,
|
||||||
|
AREATABLE_FACTION = 20, // 2 (alliance?) or 4 (horde?)
|
||||||
AREATABLE_END = 27,
|
AREATABLE_END = 27,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *AreaTableFieldNames[] = {
|
static const char *AreaTableFieldNames[] = {
|
||||||
"","","","","","","","","","",
|
"","","map","","flags","","","","","", // 0-9
|
||||||
"name","name","name","name","name","name","name","name","","",
|
"level","name","name","name","name","name","name","name","name","", // 10-19
|
||||||
"","","","","","",
|
"faction","","","","","", // 20-26
|
||||||
""
|
""
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *AreaTableFormat = {
|
static const char *AreaTableFormat = {
|
||||||
"ixxxxxxxxx"
|
"ixixixxxxx"
|
||||||
"xssssssssx"
|
"issssssssx"
|
||||||
"xxxxxxx"
|
"xxxxxxx"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -164,11 +164,11 @@ void PrintHelp(void)
|
|||||||
|
|
||||||
|
|
||||||
// be careful using this, that you supply correct format string
|
// be careful using this, that you supply correct format string
|
||||||
std::string AutoGetDataString(DBCFile::Iterator& it, const char* format, uint32 field)
|
std::string AutoGetDataString(DBCFile::Iterator& it, const char* format, uint32 field, bool skip_null = true)
|
||||||
{
|
{
|
||||||
if(format[field]=='i')
|
if(format[field]=='i')
|
||||||
{
|
{
|
||||||
if((*it).getInt(field) == 0)
|
if((*it).getInt(field) == 0 && skip_null)
|
||||||
return ""; // do not explicitly write int fields that are 0
|
return ""; // do not explicitly write int fields that are 0
|
||||||
std::stringstream s;
|
std::stringstream s;
|
||||||
s << (*it).getInt(field);
|
s << (*it).getInt(field);
|
||||||
@ -176,7 +176,7 @@ std::string AutoGetDataString(DBCFile::Iterator& it, const char* format, uint32
|
|||||||
}
|
}
|
||||||
else if(format[field]=='f')
|
else if(format[field]=='f')
|
||||||
{
|
{
|
||||||
if((*it).getFloat(field) == 0)
|
if((*it).getFloat(field) == 0 && skip_null)
|
||||||
return ""; // do not explicitly write float fields that are 0
|
return ""; // do not explicitly write float fields that are 0
|
||||||
std::stringstream s;
|
std::stringstream s;
|
||||||
s << (*it).getFloat(field);
|
s << (*it).getFloat(field);
|
||||||
@ -249,7 +249,7 @@ void OutMD5(char *path, MD5FileMap& fm)
|
|||||||
bool ConvertDBC(void)
|
bool ConvertDBC(void)
|
||||||
{
|
{
|
||||||
std::map<uint8,std::string> racemap; // needed to extract other dbc files correctly
|
std::map<uint8,std::string> racemap; // needed to extract other dbc files correctly
|
||||||
SCPStorageMap EmoteDataStorage,RaceDataStorage,SoundDataStorage,MapDataStorage,AreaDataStorage,ItemDisplayInfoStorage; // will store the converted data from dbc files
|
SCPStorageMap EmoteDataStorage,RaceDataStorage,SoundDataStorage,MapDataStorage,ZoneDataStorage,ItemDisplayInfoStorage; // will store the converted data from dbc files
|
||||||
DBCFile EmotesText,EmotesTextData,EmotesTextSound,ChrRaces,SoundEntries,Map,AreaTable,ItemDisplayInfo;
|
DBCFile EmotesText,EmotesTextData,EmotesTextSound,ChrRaces,SoundEntries,Map,AreaTable,ItemDisplayInfo;
|
||||||
printf("Opening DBC archive...\n");
|
printf("Opening DBC archive...\n");
|
||||||
MPQHelper mpq("dbc");
|
MPQHelper mpq("dbc");
|
||||||
@ -378,7 +378,7 @@ bool ConvertDBC(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("area..");
|
printf("zonedata..");
|
||||||
for(DBCFile::Iterator it = AreaTable.begin(); it != AreaTable.end(); ++it)
|
for(DBCFile::Iterator it = AreaTable.begin(); it != AreaTable.end(); ++it)
|
||||||
{
|
{
|
||||||
uint32 id = it->getUInt(MAP_ID);
|
uint32 id = it->getUInt(MAP_ID);
|
||||||
@ -386,9 +386,9 @@ bool ConvertDBC(void)
|
|||||||
{
|
{
|
||||||
if(strlen(AreaTableFieldNames[field]))
|
if(strlen(AreaTableFieldNames[field]))
|
||||||
{
|
{
|
||||||
std::string value = AutoGetDataString(it,AreaTableFormat,field);
|
std::string value = AutoGetDataString(it,AreaTableFormat,field,false);
|
||||||
if(value.size()) // only store if not null
|
if(value.size()) // only store if not null
|
||||||
AreaDataStorage[id].push_back(std::string(AreaTableFieldNames[field]) + "=" + value);
|
ZoneDataStorage[id].push_back(std::string(AreaTableFieldNames[field]) + "=" + value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -421,7 +421,7 @@ bool ConvertDBC(void)
|
|||||||
printf("race.."); OutSCP(SCPDIR "/race.scp",RaceDataStorage, "race");
|
printf("race.."); OutSCP(SCPDIR "/race.scp",RaceDataStorage, "race");
|
||||||
printf("sound.."); OutSCP(SCPDIR "/sound.scp",SoundDataStorage, "sound");
|
printf("sound.."); OutSCP(SCPDIR "/sound.scp",SoundDataStorage, "sound");
|
||||||
printf("map.."); OutSCP(SCPDIR "/map.scp",MapDataStorage, "map");
|
printf("map.."); OutSCP(SCPDIR "/map.scp",MapDataStorage, "map");
|
||||||
printf("area.."); OutSCP(SCPDIR "/area.scp",AreaDataStorage, "area");
|
printf("area.."); OutSCP(SCPDIR "/zone.scp",ZoneDataStorage, "zone");
|
||||||
printf("itemdisplayinfo."); OutSCP(SCPDIR "/itemdisplayinfo.scp",ItemDisplayInfoStorage, "itemdisplayinfo");
|
printf("itemdisplayinfo."); OutSCP(SCPDIR "/itemdisplayinfo.scp",ItemDisplayInfoStorage, "itemdisplayinfo");
|
||||||
//...
|
//...
|
||||||
printf("DONE!\n");
|
printf("DONE!\n");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user