Updated Classes field in item_db.yml (#6362)

* Updated Classes field in item_db.yml to include ITEMJ_FOURTH
This commit is contained in:
Atemo 2021-11-18 18:30:13 +01:00 committed by GitHub
parent da82fea633
commit acac89eeca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 21 additions and 3 deletions

View File

@ -158,6 +158,7 @@ Third_Baby - Third-Baby classes.
All_Upper - All Transcedent classes
All_Baby - All baby classes
All_Third - Applies to all Third classes.
Fourth - Fourth classes.
---------------------------------------

View File

@ -53,6 +53,7 @@ CREATE TABLE `item_db2_re` (
`class_third` tinyint(1) unsigned DEFAULT NULL,
`class_third_upper` tinyint(1) unsigned DEFAULT NULL,
`class_third_baby` tinyint(1) unsigned DEFAULT NULL,
`class_fourth` tinyint(1) unsigned DEFAULT NULL,
`gender` varchar(10) DEFAULT NULL,
`location_head_top` tinyint(1) unsigned DEFAULT NULL,
`location_head_mid` tinyint(1) unsigned DEFAULT NULL,

View File

@ -53,6 +53,7 @@ CREATE TABLE `item_db_re` (
`class_third` tinyint(1) unsigned DEFAULT NULL,
`class_third_upper` tinyint(1) unsigned DEFAULT NULL,
`class_third_baby` tinyint(1) unsigned DEFAULT NULL,
`class_fourth` tinyint(1) unsigned DEFAULT NULL,
`gender` varchar(10) DEFAULT NULL,
`location_head_top` tinyint(1) unsigned DEFAULT NULL,
`location_head_mid` tinyint(1) unsigned DEFAULT NULL,

View File

@ -0,0 +1,6 @@
ALTER TABLE `item_db_re`
ADD COLUMN `class_fourth` tinyint unsigned DEFAULT NULL
;
ALTER TABLE `item_db2_re`
ADD COLUMN `class_fourth` tinyint unsigned DEFAULT NULL
;

View File

@ -367,7 +367,7 @@ uint64 ItemDatabase::parseBodyNode(const YAML::Node &node) {
int64 constant;
if (!script_get_constant(className_constant.c_str(), &constant)) {
this->invalidWarning(classNode[className], "Invalid class upper %s, defaulting to All.\n", className.c_str());
this->invalidWarning(classNode[className], "Invalid class %s, defaulting to All.\n", className.c_str());
item->class_upper |= ITEMJ_ALL;
break;
}
@ -2428,6 +2428,8 @@ static bool itemdb_read_sqldb_sub(std::vector<std::string> str) {
classes["Third_Upper"] = std::stoi(str[index]) ? "true" : "false";
if (!str[++index].empty())
classes["Third_Baby"] = std::stoi(str[index]) ? "true" : "false";
if (!str[++index].empty())
classes["Fourth"] = std::stoi(str[index]) ? "true" : "false";
if (!str[++index].empty())
jobs["KagerouOboro"] = std::stoi(str[index]) ? "true" : "false";
if (!str[++index].empty())
@ -2464,7 +2466,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`,`job_kagerouoboro`,`job_rebellion`,`job_summoner`"
",`magic_attack`,`class_third`,`class_third_upper`,`class_third_baby`,`class_fourth`,`job_kagerouoboro`,`job_rebellion`,`job_summoner`"
#endif
" FROM `%s`", item_db_name[fi]) ) {
Sql_ShowDebug(mmysql_handle);

View File

@ -227,6 +227,7 @@ enum e_item_job : uint16
ITEMJ_THIRD = 0x08,
ITEMJ_THIRD_UPPER = 0x10,
ITEMJ_THIRD_BABY = 0x20,
ITEMJ_FOURTH = 0x40,
ITEMJ_MAX = 0xFF,
ITEMJ_ALL_UPPER = ITEMJ_UPPER | ITEMJ_THIRD_UPPER,
@ -234,7 +235,7 @@ enum e_item_job : uint16
ITEMJ_ALL_THIRD = ITEMJ_THIRD | ITEMJ_THIRD_UPPER | ITEMJ_THIRD_BABY,
#ifdef RENEWAL
ITEMJ_ALL = ITEMJ_NORMAL | ITEMJ_UPPER | ITEMJ_BABY | ITEMJ_THIRD | ITEMJ_THIRD_UPPER | ITEMJ_THIRD_BABY,
ITEMJ_ALL = ITEMJ_NORMAL | ITEMJ_UPPER | ITEMJ_BABY | ITEMJ_THIRD | ITEMJ_THIRD_UPPER | ITEMJ_THIRD_BABY | ITEMJ_FOURTH,
#else
ITEMJ_ALL = ITEMJ_NORMAL | ITEMJ_UPPER | ITEMJ_BABY,
#endif

View File

@ -1430,6 +1430,9 @@ static bool pc_isItemClass (struct map_session_data *sd, struct item_data* item)
//third-baby classes
if (item->class_upper&ITEMJ_THIRD_BABY && sd->class_&JOBL_THIRD && sd->class_&JOBL_BABY)
break;
//fourth classes
if (item->class_upper&ITEMJ_FOURTH && sd->class_&JOBL_FOURTH)
break;
#endif
return false;
}

View File

@ -8172,6 +8172,7 @@
export_constant(ITEMJ_ALL_UPPER);
export_constant(ITEMJ_ALL_BABY);
export_constant(ITEMJ_ALL_THIRD);
export_constant(ITEMJ_FOURTH);
/* item drop effects */
export_constant(DROPEFFECT_NONE);

View File

@ -520,6 +520,8 @@ static bool item_db_yaml2sql(const std::string &file, const std::string &table)
value.append(",");
column.append("`class_third_baby`,");
}
if (appendEntry(classes["Fourth"], value))
column.append("`class_fourth`,");
#endif
}