|
@@ -104,7 +104,7 @@ static bool quest_read_db(char *split[], int columns, int current);
|
|
|
static bool instance_readdb_sub(char* str[], int columns, int current);
|
|
|
|
|
|
// Constants for conversion
|
|
|
-std::unordered_map<uint16, std::string> aegis_itemnames;
|
|
|
+std::unordered_map<t_itemid, std::string> aegis_itemnames;
|
|
|
std::unordered_map<uint16, uint16> aegis_itemviewid;
|
|
|
std::unordered_map<uint16, std::string> aegis_mobnames;
|
|
|
std::unordered_map<uint16, std::string> aegis_skillnames;
|
|
@@ -770,49 +770,49 @@ static bool pet_read_db( const char* file ){
|
|
|
body << YAML::BeginMap;
|
|
|
body << YAML::Key << "Mob" << YAML::Value << *mob_name;
|
|
|
|
|
|
- uint16 tame_item_id = (uint16)atoi( str[3] );
|
|
|
+ t_itemid tame_item_id = strtoul( str[3], nullptr, 10 );
|
|
|
|
|
|
if( tame_item_id > 0 ){
|
|
|
std::string* tame_item_name = util::umap_find( aegis_itemnames, tame_item_id );
|
|
|
|
|
|
if( tame_item_name == nullptr ){
|
|
|
- ShowError( "Item name for item id %hu is not known.\n", tame_item_id );
|
|
|
+ ShowError( "Item name for item id %u is not known.\n", tame_item_id );
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
body << YAML::Key << "TameItem" << YAML::Value << *tame_item_name;
|
|
|
}
|
|
|
|
|
|
- uint16 egg_item_id = (uint16)atoi( str[4] );
|
|
|
+ t_itemid egg_item_id = strtoul( str[4], nullptr, 10 );
|
|
|
std::string* egg_item_name = util::umap_find( aegis_itemnames, egg_item_id );
|
|
|
|
|
|
if( egg_item_name == nullptr ){
|
|
|
- ShowError( "Item name for item id %hu is not known.\n", egg_item_id );
|
|
|
+ ShowError( "Item name for item id %u is not known.\n", egg_item_id );
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
body << YAML::Key << "EggItem" << YAML::Value << *egg_item_name;
|
|
|
|
|
|
- uint16 equip_item_id = (uint16)atoi( str[5] );
|
|
|
+ t_itemid equip_item_id = strtoul( str[5], nullptr, 10 );
|
|
|
|
|
|
if( equip_item_id > 0 ){
|
|
|
std::string* equip_item_name = util::umap_find( aegis_itemnames, equip_item_id );
|
|
|
|
|
|
if( equip_item_name == nullptr ){
|
|
|
- ShowError( "Item name for item id %hu is not known.\n", equip_item_id );
|
|
|
+ ShowError( "Item name for item id %u is not known.\n", equip_item_id );
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
body << YAML::Key << "EquipItem" << YAML::Value << *equip_item_name;
|
|
|
}
|
|
|
|
|
|
- uint16 food_item_id = (uint16)atoi( str[6] );
|
|
|
+ t_itemid food_item_id = strtoul( str[6], nullptr, 10 );
|
|
|
|
|
|
if( food_item_id > 0 ){
|
|
|
std::string* food_item_name = util::umap_find( aegis_itemnames, food_item_id );
|
|
|
|
|
|
if( food_item_name == nullptr ){
|
|
|
- ShowError( "Item name for item id %hu is not known.\n", food_item_id );
|
|
|
+ ShowError( "Item name for item id %u is not known.\n", food_item_id );
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -936,11 +936,11 @@ static bool skill_parse_row_spellbookdb(char* split[], int columns, int current)
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- uint16 nameid = atoi(split[2]);
|
|
|
+ t_itemid nameid = strtoul(split[2], nullptr, 10);
|
|
|
std::string *book_name = util::umap_find(aegis_itemnames, nameid);
|
|
|
|
|
|
if (book_name == nullptr) {
|
|
|
- ShowError("Book name for item ID %hu is not known.\n", nameid);
|
|
|
+ ShowError("Book name for item ID %u is not known.\n", nameid);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -998,11 +998,11 @@ static bool mob_readdb_mobavail(char* str[], int columns, int current) {
|
|
|
body << YAML::Key << "ClothColor" << YAML::Value << atoi(str[11]);
|
|
|
|
|
|
if (atoi(str[5]) != 0) {
|
|
|
- uint16 weapon_item_id = atoi(str[5]);
|
|
|
+ t_itemid weapon_item_id = strtoul( str[5], nullptr, 10 );
|
|
|
std::string *weapon_item_name = util::umap_find(aegis_itemnames, weapon_item_id);
|
|
|
|
|
|
if (weapon_item_name == nullptr) {
|
|
|
- ShowError("Item name for item ID %hu (weapon) is not known.\n", weapon_item_id);
|
|
|
+ ShowError("Item name for item ID %u (weapon) is not known.\n", weapon_item_id);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -1010,11 +1010,11 @@ static bool mob_readdb_mobavail(char* str[], int columns, int current) {
|
|
|
}
|
|
|
|
|
|
if (atoi(str[6]) != 0) {
|
|
|
- uint16 shield_item_id = atoi(str[6]);
|
|
|
+ t_itemid shield_item_id = strtoul( str[6], nullptr, 10 );
|
|
|
std::string *shield_item_name = util::umap_find(aegis_itemnames, shield_item_id);
|
|
|
|
|
|
if (shield_item_name == nullptr) {
|
|
|
- ShowError("Item name for item ID %hu (shield) is not known.\n", shield_item_id);
|
|
|
+ ShowError("Item name for item ID %u (shield) is not known.\n", shield_item_id);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -1029,7 +1029,7 @@ static bool mob_readdb_mobavail(char* str[], int columns, int current) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- std::string *headtop_item_name = util::umap_find(aegis_itemnames, *headtop_item_id);
|
|
|
+ std::string *headtop_item_name = util::umap_find(aegis_itemnames, (t_itemid)*headtop_item_id);
|
|
|
|
|
|
if (headtop_item_name == nullptr) {
|
|
|
ShowError("Item name for item ID %hu (head top) is not known.\n", *headtop_item_id);
|
|
@@ -1047,7 +1047,7 @@ static bool mob_readdb_mobavail(char* str[], int columns, int current) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- std::string *headmid_item_name = util::umap_find(aegis_itemnames, *headmid_item_id);
|
|
|
+ std::string *headmid_item_name = util::umap_find(aegis_itemnames, (t_itemid)*headmid_item_id);
|
|
|
|
|
|
if (headmid_item_name == nullptr) {
|
|
|
ShowError("Item name for item ID %hu (head mid) is not known.\n", *headmid_item_id);
|
|
@@ -1065,7 +1065,7 @@ static bool mob_readdb_mobavail(char* str[], int columns, int current) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- std::string *headlow_item_name = util::umap_find(aegis_itemnames, *headlow_item_id);
|
|
|
+ std::string *headlow_item_name = util::umap_find(aegis_itemnames, (t_itemid)*headlow_item_id);
|
|
|
|
|
|
if (headlow_item_name == nullptr) {
|
|
|
ShowError("Item name for item ID %hu (head low) is not known.\n", *headlow_item_id);
|
|
@@ -1167,11 +1167,11 @@ static bool mob_readdb_mobavail(char* str[], int columns, int current) {
|
|
|
}
|
|
|
} else if (columns == 3) {
|
|
|
if (atoi(str[5]) != 0) {
|
|
|
- uint16 peteq_item_id = atoi(str[5]);
|
|
|
+ t_itemid peteq_item_id = strtoul( str[5], nullptr, 10 );
|
|
|
std::string *peteq_item_name = util::umap_find(aegis_itemnames, peteq_item_id);
|
|
|
|
|
|
if (peteq_item_name == nullptr) {
|
|
|
- ShowError("Item name for item ID %hu (pet equip) is not known.\n", peteq_item_id);
|
|
|
+ ShowError("Item name for item ID %u (pet equip) is not known.\n", peteq_item_id);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -1268,11 +1268,11 @@ static bool skill_parse_row_requiredb(char* split[], int columns, int current)
|
|
|
|
|
|
for (int i = 0; i < MAX_SKILL_ITEM_REQUIRE; i++) {
|
|
|
if (atoi(split[13 + 2 * i]) > 0) {
|
|
|
- uint16 item_id = atoi(split[13 + 2 * i]);
|
|
|
+ t_itemid item_id = strtoul( split[13 + 2 * i], nullptr, 10 );
|
|
|
std::string *item_name = util::umap_find(aegis_itemnames, item_id);
|
|
|
|
|
|
if (item_name == nullptr) {
|
|
|
- ShowError("Item name for item id %hu is not known.\n", item_id);
|
|
|
+ ShowError("Item name for item id %u is not known.\n", item_id);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -2224,7 +2224,7 @@ static bool skill_parse_row_skilldb(char* split[], int columns, int current) {
|
|
|
if (it_req->second.itemid[i] > 0) {
|
|
|
body << YAML::BeginMap;
|
|
|
|
|
|
- std::string *item_name = util::umap_find(aegis_itemnames, static_cast<uint16>(it_req->second.itemid[i]));
|
|
|
+ std::string *item_name = util::umap_find(aegis_itemnames, it_req->second.itemid[i]);
|
|
|
|
|
|
if (item_name == nullptr) {
|
|
|
ShowError("Item name for item id %hu is not known (itemcost).\n", it_req->second.itemid[i]);
|
|
@@ -2245,10 +2245,10 @@ static bool skill_parse_row_skilldb(char* split[], int columns, int current) {
|
|
|
body << YAML::BeginMap;
|
|
|
|
|
|
for (const auto &it : it_req->second.eqItem) {
|
|
|
- std::string *item_name = util::umap_find(aegis_itemnames, static_cast<uint16>(it));
|
|
|
+ std::string *item_name = util::umap_find(aegis_itemnames, it);
|
|
|
|
|
|
if (item_name == nullptr) {
|
|
|
- ShowError("Item name for item id %hu is not known (equipment).\n", it);
|
|
|
+ ShowError("Item name for item id %u is not known (equipment).\n", it);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -2490,7 +2490,8 @@ static bool quest_read_db(char *split[], int columns, int current) {
|
|
|
body << YAML::BeginSeq;
|
|
|
|
|
|
for (size_t i = 0; i < MAX_QUEST_DROPS; i++) {
|
|
|
- int32 mob_id = (int32)atoi(split[3 * i + (2 * MAX_QUEST_OBJECTIVES + 2)]), nameid = (uint16)atoi(split[3 * i + (2 * MAX_QUEST_OBJECTIVES + 3)]);
|
|
|
+ int32 mob_id = (int32)atoi(split[3 * i + (2 * MAX_QUEST_OBJECTIVES + 2)]);
|
|
|
+ t_itemid nameid = strtoul(split[3 * i + (2 * MAX_QUEST_OBJECTIVES + 3)], nullptr, 10);
|
|
|
|
|
|
if (!mob_id || !nameid)
|
|
|
continue;
|
|
@@ -2502,10 +2503,10 @@ static bool quest_read_db(char *split[], int columns, int current) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- std::string *item_name = util::umap_find(aegis_itemnames, static_cast<uint16>(nameid));
|
|
|
+ std::string *item_name = util::umap_find(aegis_itemnames, nameid);
|
|
|
|
|
|
if (!item_name) {
|
|
|
- ShowError("quest_read_db: Invalid item name %hu, drop not read.\n", nameid);
|
|
|
+ ShowError("quest_read_db: Invalid item name %u, drop not read.\n", nameid);
|
|
|
return false;
|
|
|
}
|
|
|
|