diff --git a/db/enchantgrade.yml b/db/enchantgrade.yml index c5bf69b5a8..4b5140f6fd 100644 --- a/db/enchantgrade.yml +++ b/db/enchantgrade.yml @@ -30,7 +30,9 @@ # Refine Required refine level. # Chance Base chance of success out of 0~10000. # Bonus Enchantgrade bonus. (Default: 0) -# Announce Announce if someone tries to increase the enchantgrade. (Default: true) +# AnnounceSuccess Announce on upgrade success. (Default: true) +# AnnounceFail Announce on upgrade failure. (Default: false) +# Announce Announce on upgrade success and failure. # Catalyst: Catalyst item to increase chance of success. # Item The item that can be used. # AmountPerStep Amount of Item needed. @@ -49,7 +51,7 @@ Header: Type: ENCHANTGRADE_DB - Version: 1 + Version: 2 Footer: Imports: diff --git a/db/import-tmpl/enchantgrade.yml b/db/import-tmpl/enchantgrade.yml index 22727a2d07..eff8cfbf3f 100644 --- a/db/import-tmpl/enchantgrade.yml +++ b/db/import-tmpl/enchantgrade.yml @@ -30,7 +30,9 @@ # Refine Required refine level. # Chance Base chance of success out of 0~10000. # Bonus Enchantgrade bonus. (Default: 0) -# Announce Announce if someone tries to increase the enchantgrade. (Default: true) +# AnnounceSuccess Announce on upgrade success. (Default: true) +# AnnounceFail Announce on upgrade failure. (Default: false) +# Announce Announce on upgrade success and failure. # Catalyst: Catalyst item to increase chance of success. # Item The item that can be used. # AmountPerStep Amount of Item needed. @@ -49,4 +51,4 @@ Header: Type: ENCHANTGRADE_DB - Version: 1 + Version: 2 diff --git a/db/re/enchantgrade.yml b/db/re/enchantgrade.yml index 98daddd8a2..d02008f814 100644 --- a/db/re/enchantgrade.yml +++ b/db/re/enchantgrade.yml @@ -30,7 +30,9 @@ # Refine Required refine level. # Chance Base chance of success out of 0~10000. # Bonus Enchantgrade bonus. (Default: 0) -# Announce Announce if someone tries to increase the enchantgrade. (Default: true) +# AnnounceSuccess Announce on upgrade success. (Default: true) +# AnnounceFail Announce on upgrade failure. (Default: false) +# Announce Announce on upgrade success and failure. # Catalyst: Catalyst item to increase chance of success. # Item The item that can be used. # AmountPerStep Amount of Item needed. @@ -49,7 +51,7 @@ Header: Type: ENCHANTGRADE_DB - Version: 1 + Version: 2 Body: - Type: Armor @@ -98,6 +100,7 @@ Body: Refine: 11 Chance: 5000 Bonus: 50 + AnnounceFail: true Catalyst: Item: Blessed_Etel_Dust AmountPerStep: 5 @@ -117,6 +120,7 @@ Body: Refine: 11 Chance: 4000 Bonus: 100 + AnnounceFail: true Catalyst: Item: Blessed_Etel_Dust AmountPerStep: 7 @@ -178,6 +182,7 @@ Body: Refine: 11 Chance: 5000 Bonus: 50 + AnnounceFail: true Catalyst: Item: Blessed_Etel_Dust AmountPerStep: 5 @@ -197,6 +202,7 @@ Body: Refine: 11 Chance: 4000 Bonus: 100 + AnnounceFail: true Catalyst: Item: Blessed_Etel_Dust AmountPerStep: 7 diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 6dd1dec4cc..2fa94d52cc 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -23636,12 +23636,12 @@ void clif_parse_enchantgrade_start( int fd, struct map_session_data* sd ){ clif_enchantgrade_result( *sd, index, ENCHANTGRADE_UPGRADE_SUCCESS ); // Check if it has to be announced - if( enchantgradelevel->announce ){ + if( enchantgradelevel->announceSuccess ){ clif_enchantgrade_announce( *sd, sd->inventory.u.items_inventory[index], true ); } }else{ // Check if it has to be announced (has to be done before deleting the item from inventory) - if( enchantgradelevel->announce ){ + if( enchantgradelevel->announceFail ){ clif_enchantgrade_announce( *sd, sd->inventory.u.items_inventory[index], false ); } diff --git a/src/map/status.cpp b/src/map/status.cpp index 87bb260fa2..2c8338efc7 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -700,6 +700,34 @@ uint64 EnchantgradeDatabase::parseBodyNode( const ryml::NodeRef& node ){ } } + if( this->nodeExists( gradeNode, "AnnounceSuccess" ) ){ + bool announce; + + if( !this->asBool( gradeNode, "AnnounceSuccess", announce ) ){ + return 0; + } + + grade->announceSuccess = announce; + }else{ + if( !gradeExists ){ + grade->announceSuccess = true; + } + } + + if( this->nodeExists( gradeNode, "AnnounceFail" ) ){ + bool announce; + + if( !this->asBool( gradeNode, "AnnounceFail", announce) ){ + return 0; + } + + grade->announceFail = announce; + }else{ + if( !gradeExists ){ + grade->announceFail = false; + } + } + if( this->nodeExists( gradeNode, "Announce" ) ){ bool announce; @@ -707,11 +735,8 @@ uint64 EnchantgradeDatabase::parseBodyNode( const ryml::NodeRef& node ){ return 0; } - grade->announce = announce; - }else{ - if( !gradeExists ){ - grade->announce = true; - } + grade->announceSuccess = announce; + grade->announceFail = announce; } if( this->nodeExists( gradeNode, "Catalyst") ){ diff --git a/src/map/status.hpp b/src/map/status.hpp index 856f5cce38..c0378043df 100644 --- a/src/map/status.hpp +++ b/src/map/status.hpp @@ -168,7 +168,8 @@ struct s_enchantgradelevel{ uint16 refine; uint16 chance; uint16 bonus; - bool announce; + bool announceSuccess; + bool announceFail; struct{ t_itemid item; uint16 amountPerStep; @@ -185,7 +186,7 @@ struct s_enchantgrade{ class EnchantgradeDatabase : public TypesafeYamlDatabase{ public: - EnchantgradeDatabase() : TypesafeYamlDatabase( "ENCHANTGRADE_DB", 1 ){ + EnchantgradeDatabase() : TypesafeYamlDatabase( "ENCHANTGRADE_DB", 2, 1 ){ }