浏览代码

Added 'Gradable' in item DB (#7218)

* Added 'Gradable' in item DB
** The field defines if the item can be graded (renewal). (Default: false)

Thanks to @attackjom, @Lemongrass3110 !
Atemo 2 年之前
父节点
当前提交
17751aa4d7

+ 1 - 0
db/import-tmpl/item_db.yml

@@ -44,6 +44,7 @@
 #   EquipLevelMin           Minimum required level to equip. (Default: 0)
 #   EquipLevelMax           Maximum level that can equip. (Default: 0)
 #   Refineable              If the item can be refined. (Default: false)
+#   Gradable                If the item can be graded. (Default: false)
 #   View                    View sprite of an item. (Default: 0)
 #   AliasName               Another item's AegisName that will be sent to the client instead of this item's AegisName. (Default: null)
 #   Flags:                  Item flags. (Default: null)

+ 1 - 0
db/item_db.yml

@@ -44,6 +44,7 @@
 #   EquipLevelMin           Minimum required level to equip. (Default: 0)
 #   EquipLevelMax           Maximum level that can equip. (Default: 0)
 #   Refineable              If the item can be refined. (Default: false)
+#   Gradable                If the item can be graded. (Default: false)
 #   View                    View sprite of an item. (Default: 0)
 #   AliasName               Another item's AegisName that will be sent to the client instead of this item's AegisName. (Default: null)
 #   Flags:                  Item flags. (Default: null)

+ 1 - 0
db/pre-re/item_db.yml

@@ -44,6 +44,7 @@
 #   EquipLevelMin           Minimum required level to equip. (Default: 0)
 #   EquipLevelMax           Maximum level that can equip. (Default: 0)
 #   Refineable              If the item can be refined. (Default: false)
+#   Gradable                If the item can be graded. (Default: false)
 #   View                    View sprite of an item. (Default: 0)
 #   AliasName               Another item's AegisName that will be sent to the client instead of this item's AegisName. (Default: null)
 #   Flags:                  Item flags. (Default: null)

+ 1 - 0
db/pre-re/item_db_equip.yml

@@ -44,6 +44,7 @@
 #   EquipLevelMin           Minimum required level to equip. (Default: 0)
 #   EquipLevelMax           Maximum level that can equip. (Default: 0)
 #   Refineable              If the item can be refined. (Default: false)
+#   Gradable                If the item can be graded. (Default: false)
 #   View                    View sprite of an item. (Default: 0)
 #   AliasName               Another item's AegisName that will be sent to the client instead of this item's AegisName. (Default: null)
 #   Flags:                  Item flags. (Default: null)

+ 1 - 0
db/pre-re/item_db_etc.yml

@@ -44,6 +44,7 @@
 #   EquipLevelMin           Minimum required level to equip. (Default: 0)
 #   EquipLevelMax           Maximum level that can equip. (Default: 0)
 #   Refineable              If the item can be refined. (Default: false)
+#   Gradable                If the item can be graded. (Default: false)
 #   View                    View sprite of an item. (Default: 0)
 #   AliasName               Another item's AegisName that will be sent to the client instead of this item's AegisName. (Default: null)
 #   Flags:                  Item flags. (Default: null)

+ 1 - 0
db/pre-re/item_db_usable.yml

@@ -44,6 +44,7 @@
 #   EquipLevelMin           Minimum required level to equip. (Default: 0)
 #   EquipLevelMax           Maximum level that can equip. (Default: 0)
 #   Refineable              If the item can be refined. (Default: false)
+#   Gradable                If the item can be graded. (Default: false)
 #   View                    View sprite of an item. (Default: 0)
 #   AliasName               Another item's AegisName that will be sent to the client instead of this item's AegisName. (Default: null)
 #   Flags:                  Item flags. (Default: null)

+ 1 - 0
db/re/item_db.yml

@@ -44,6 +44,7 @@
 #   EquipLevelMin           Minimum required level to equip. (Default: 0)
 #   EquipLevelMax           Maximum level that can equip. (Default: 0)
 #   Refineable              If the item can be refined. (Default: false)
+#   Gradable                If the item can be graded. (Default: false)
 #   View                    View sprite of an item. (Default: 0)
 #   AliasName               Another item's AegisName that will be sent to the client instead of this item's AegisName. (Default: null)
 #   Flags:                  Item flags. (Default: null)

文件差异内容过多而无法显示
+ 126 - 0
db/re/item_db_equip.yml


+ 1 - 0
db/re/item_db_etc.yml

@@ -44,6 +44,7 @@
 #   EquipLevelMin           Minimum required level to equip. (Default: 0)
 #   EquipLevelMax           Maximum level that can equip. (Default: 0)
 #   Refineable              If the item can be refined. (Default: false)
+#   Gradable                If the item can be graded. (Default: false)
 #   View                    View sprite of an item. (Default: 0)
 #   AliasName               Another item's AegisName that will be sent to the client instead of this item's AegisName. (Default: null)
 #   Flags:                  Item flags. (Default: null)

+ 1 - 0
db/re/item_db_usable.yml

@@ -44,6 +44,7 @@
 #   EquipLevelMin           Minimum required level to equip. (Default: 0)
 #   EquipLevelMax           Maximum level that can equip. (Default: 0)
 #   Refineable              If the item can be refined. (Default: false)
+#   Gradable                If the item can be graded. (Default: false)
 #   View                    View sprite of an item. (Default: 0)
 #   AliasName               Another item's AegisName that will be sent to the client instead of this item's AegisName. (Default: null)
 #   Flags:                  Item flags. (Default: null)

+ 4 - 0
doc/item_db.txt

@@ -219,6 +219,10 @@ Refineable: Defines if the item can be refined.
 
 ---------------------------------------
 
+Gradable: Defines if the item can be graded.
+
+---------------------------------------
+
 View: For normal items, defines a replacement view-sprite for the item.
 
 ---------------------------------------

+ 1 - 0
doc/yaml/db/item_db.yml

@@ -27,6 +27,7 @@
 #   EquipLevelMin           Minimum required level to equip. (Default: 0)
 #   EquipLevelMax           Maximum level that can equip. (Default: 0)
 #   Refineable              If the item can be refined. (Default: false)
+#   Gradable                If the item can be graded. (Default: false)
 #   View                    View sprite of an item. (Default: 0)
 #   AliasName               Another item's AegisName that will be sent to the client instead of this item's AegisName. (Default: null)
 #   Flags:                  Item flags. (Default: null)

+ 1 - 0
doc/yaml/sql/item_db2_re.sql

@@ -80,6 +80,7 @@ CREATE TABLE `item_db2_re` (
   `equip_level_min` tinyint(3) unsigned DEFAULT NULL,
   `equip_level_max` tinyint(3) unsigned DEFAULT NULL,
   `refineable` tinyint(1) unsigned DEFAULT NULL,
+  `gradable` tinyint(1) unsigned DEFAULT NULL,
   `view` smallint(5) unsigned DEFAULT NULL,
   `alias_name` varchar(50) DEFAULT NULL,
   `flag_buyingstore` tinyint(1) unsigned DEFAULT NULL,

+ 1 - 0
doc/yaml/sql/item_db_re.sql

@@ -80,6 +80,7 @@ CREATE TABLE `item_db_re` (
   `equip_level_min` tinyint(3) unsigned DEFAULT NULL,
   `equip_level_max` tinyint(3) unsigned DEFAULT NULL,
   `refineable` tinyint(1) unsigned DEFAULT NULL,
+  `gradable` tinyint(1) unsigned DEFAULT NULL,
   `view` smallint(5) unsigned DEFAULT NULL,
   `alias_name` varchar(50) DEFAULT NULL,
   `flag_buyingstore` tinyint(1) unsigned DEFAULT NULL,

+ 1 - 0
sql-files/item_db2_re.sql

@@ -82,6 +82,7 @@ CREATE TABLE `item_db2_re` (
   `equip_level_min` tinyint(3) unsigned DEFAULT NULL,
   `equip_level_max` tinyint(3) unsigned DEFAULT NULL,
   `refineable` tinyint(1) unsigned DEFAULT NULL,
+  `gradable` tinyint(1) unsigned DEFAULT NULL,
   `view` smallint(5) unsigned DEFAULT NULL,
   `alias_name` varchar(50) DEFAULT NULL,
   `flag_buyingstore` tinyint(1) unsigned DEFAULT NULL,

+ 1 - 0
sql-files/item_db_re.sql

@@ -82,6 +82,7 @@ CREATE TABLE `item_db_re` (
   `equip_level_min` tinyint(3) unsigned DEFAULT NULL,
   `equip_level_max` tinyint(3) unsigned DEFAULT NULL,
   `refineable` tinyint(1) unsigned DEFAULT NULL,
+  `gradable` tinyint(1) unsigned DEFAULT NULL,
   `view` smallint(5) unsigned DEFAULT NULL,
   `alias_name` varchar(50) DEFAULT NULL,
   `flag_buyingstore` tinyint(1) unsigned DEFAULT NULL,

+ 5 - 0
src/map/clif.cpp

@@ -23545,6 +23545,11 @@ void clif_parse_enchantgrade_add( int fd, struct map_session_data* sd ){
 		return;
 	}
 
+	// Item can't be enhanced
+	if( !sd->inventory_data[index]->flag.gradable ){
+		return;
+	}
+
 	uint16 level = 0;
 
 	if( sd->inventory_data[index]->type == IT_WEAPON ){

+ 15 - 1
src/map/itemdb.cpp

@@ -570,6 +570,18 @@ uint64 ItemDatabase::parseBodyNode(const ryml::NodeRef& node) {
 			item->flag.no_refine = true;
 	}
 
+	if (this->nodeExists(node, "Gradable")) {
+		bool gradable;
+
+		if (!this->asBool(node, "Gradable", gradable))
+			return 0;
+
+		item->flag.gradable = gradable;
+	} else {
+		if (!exists)
+			item->flag.gradable = false;
+	}
+
 	if (this->nodeExists(node, "View")) {
 		uint32 look;
 
@@ -3099,6 +3111,8 @@ static bool itemdb_read_sqldb_sub(std::vector<std::string> str) {
 		rootNode["EquipLevelMax"] << str[index];
 	if (!str[++index].empty())
 		rootNode["Refineable"] << (std::stoi(str[index]) ? "true" : "false");
+	if (!str[++index].empty())
+		rootNode["Gradable"] << (std::stoi(str[index]) ? "true" : "false");
 	if (!str[++index].empty())
 		rootNode["View"] << str[index];
 	if (!str[++index].empty())
@@ -3265,7 +3279,7 @@ static int itemdb_read_sqldb(void) {
 			"`delay_duration`,`delay_status`,`stack_amount`,`stack_inventory`,`stack_cart`,`stack_storage`,`stack_guildstorage`,`nouse_override`,`nouse_sitting`,"
 			"`trade_override`,`trade_nodrop`,`trade_notrade`,`trade_tradepartner`,`trade_nosell`,`trade_nocart`,`trade_nostorage`,`trade_noguildstorage`,`trade_nomail`,`trade_noauction`,`script`,`equip_script`,`unequip_script`"
 #ifdef RENEWAL
-			",`magic_attack`,`class_third`,`class_third_upper`,`class_third_baby`,`class_fourth`,`job_kagerouoboro`,`job_rebellion`,`job_summoner`,`job_spirit_handler`"
+			",`magic_attack`,`class_third`,`class_third_upper`,`class_third_baby`,`class_fourth`,`job_kagerouoboro`,`job_rebellion`,`job_summoner`,`job_spirit_handler`,`gradable`"
 #endif
 			" FROM `%s`", item_db_name[fi]) ) {
 			Sql_ShowDebug(mmysql_handle);

+ 1 - 1
src/map/itemdb.hpp

@@ -1246,6 +1246,7 @@ struct item_data
 		bool broadcast; ///< Will be broadcasted if someone obtain the item [Cydh]
 		bool bindOnEquip; ///< Set item as bound when equipped
 		e_item_drop_effect dropEffect; ///< Drop Effect Mode
+		unsigned gradable : 1;
 	} flag;
 	struct {// item stacking limitation
 		uint16 amount;
@@ -1443,7 +1444,6 @@ const char *itemdb_typename_ammo (e_ammo_type ammo);
 
 #define itemdb_value_buy(n) itemdb_search(n)->value_buy
 #define itemdb_value_sell(n) itemdb_search(n)->value_sell
-#define itemdb_canrefine(n) (!itemdb_search(n)->flag.no_refine)
 //Item trade restrictions [Skotlex]
 bool itemdb_isdropable_sub(struct item_data *itd, int gmlv, int unused);
 bool itemdb_cantrade_sub(struct item_data *itd, int gmlv, int gmlv2);

+ 2 - 0
src/tool/yaml2sql.cpp

@@ -626,6 +626,8 @@ static bool item_db_yaml2sql(const std::string &file, const std::string &table)
 			column.append("`equip_level_max`,");
 		if (appendEntry(input["Refineable"], value))
 			column.append("`refineable`,");
+		if (appendEntry(input["Gradable"], value))
+			column.append("`gradable`,");
 		if (appendEntry(input["View"], value))
 			column.append("`view`,");
 		if (appendEntry(input["AliasName"], value, true))

部分文件因为文件数量过多而无法显示