Fix grade upgrade fail announcement (#7189)
Co-authored-by: Aleos <aleos89@users.noreply.github.com> Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
parent
5549ad2ac2
commit
7bfae25c74
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 );
|
||||
}
|
||||
|
||||
|
@ -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") ){
|
||||
|
@ -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<uint16, s_enchantgrade>{
|
||||
public:
|
||||
EnchantgradeDatabase() : TypesafeYamlDatabase( "ENCHANTGRADE_DB", 1 ){
|
||||
EnchantgradeDatabase() : TypesafeYamlDatabase( "ENCHANTGRADE_DB", 2, 1 ){
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user