Converted item database to YAML (#4335)

* Combines item_avail, item_buyingstore, item_delay, item_flag, item_nouse, item_stack, and item_trade databases into one.
* General cleanups and optimizations.
* Includes CSV2YAML conversion tool.
* Includes YAML2SQL conversion tool.
* Adjusts dummy_item from being created by malloc and now creates it by make_shared.
* Item combos are now stored as a STL.
Thanks to @Lemongrass3110, @Atemo, and @cydh!
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
Aleos
2020-10-21 19:02:11 -04:00
committed by GitHub
parent 323db7e661
commit 04cfe17b2b
96 changed files with 293974 additions and 56096 deletions

View File

@@ -2794,7 +2794,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
//A Rare Drop Global Announce by Lupus
if( mvp_sd && drop_rate <= battle_config.rare_drop_announce ) {
char message[128];
sprintf (message, msg_txt(NULL,541), mvp_sd->status.name, md->name, it->jname, (float)drop_rate/100);
sprintf (message, msg_txt(NULL,541), mvp_sd->status.name, md->name, it->ename.c_str(), (float)drop_rate/100);
//MSG: "'%s' won %s's %s (chance: %0.02f%%)"
intif_broadcast(message,strlen(message)+1,BC_DEFAULT);
}
@@ -2948,7 +2948,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
//A Rare MVP Drop Global Announce by Lupus
if(temp<=battle_config.rare_drop_announce) {
char message[128];
sprintf (message, msg_txt(NULL,541), mvp_sd->status.name, md->name, i_data->jname, temp/100.);
sprintf (message, msg_txt(NULL,541), mvp_sd->status.name, md->name, i_data->ename.c_str(), temp/100.);
//MSG: "'%s' won %s's %s (chance: %0.02f%%)"
intif_broadcast(message,strlen(message)+1,BC_DEFAULT);
}
@@ -4530,7 +4530,7 @@ uint64 MobAvailDatabase::parseBodyNode(const YAML::Node &node) {
if (!this->asString(node, "Weapon", weapon))
return 0;
struct item_data *item = itemdb_searchname(weapon.c_str());
struct item_data *item = itemdb_search_aegisname(weapon.c_str());
if (item == nullptr) {
this->invalidWarning(node["Weapon"], "Weapon %s is not a valid item.\n", weapon.c_str());
@@ -4551,7 +4551,7 @@ uint64 MobAvailDatabase::parseBodyNode(const YAML::Node &node) {
if (!this->asString(node, "Shield", shield))
return 0;
struct item_data *item = itemdb_searchname(shield.c_str());
struct item_data *item = itemdb_search_aegisname(shield.c_str());
if (item == nullptr) {
this->invalidWarning(node["Shield"], "Shield %s is not a valid item.\n", shield.c_str());
@@ -4574,7 +4574,7 @@ uint64 MobAvailDatabase::parseBodyNode(const YAML::Node &node) {
struct item_data *item;
if ((item = itemdb_searchname(head.c_str())) == nullptr) {
if ((item = itemdb_search_aegisname(head.c_str())) == nullptr) {
this->invalidWarning(node["HeadTop"], "HeadTop %s is not a valid item.\n", head.c_str());
return 0;
}
@@ -4593,7 +4593,7 @@ uint64 MobAvailDatabase::parseBodyNode(const YAML::Node &node) {
if (!this->asString(node, "HeadMid", head))
return 0;
struct item_data *item = itemdb_searchname(head.c_str());
struct item_data *item = itemdb_search_aegisname(head.c_str());
if (item == nullptr) {
this->invalidWarning(node["HeadMid"], "HeadMid %s is not a valid item.\n", head.c_str());
@@ -4614,7 +4614,7 @@ uint64 MobAvailDatabase::parseBodyNode(const YAML::Node &node) {
if (!this->asString(node, "HeadLow", head))
return 0;
struct item_data *item = itemdb_searchname(head.c_str());
struct item_data *item = itemdb_search_aegisname(head.c_str());
if (item == nullptr) {
this->invalidWarning(node["HeadLow"], "HeadLow %s is not a valid item.\n", head.c_str());
@@ -4637,7 +4637,7 @@ uint64 MobAvailDatabase::parseBodyNode(const YAML::Node &node) {
if (!this->asString(node, "PetEquip", equipment))
return 0;
struct item_data *item = itemdb_searchname(equipment.c_str());
struct item_data *item = itemdb_search_aegisname(equipment.c_str());
if (item == nullptr) {
this->invalidWarning(node["PetEquip"], "PetEquip %s is not a valid item.\n", equipment.c_str());