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 !
This commit is contained in:
Atemo 2022-08-29 13:28:09 +02:00 committed by GitHub
parent 5f4fd5c98b
commit 17751aa4d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 232 additions and 2 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

File diff suppressed because it is too large Load Diff

View File

@ -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)

View File

@ -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)

View File

@ -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.
---------------------------------------

View File

@ -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)

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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 ){

View File

@ -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);

View File

@ -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);

View File

@ -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))