Adds drop effect to dropped random option items (#6278)

* Adds the official pillar effect on dropped items depending on how many random options were applied to them.
Thanks to @limitro, @Atemo, and @Lemongrass3110!
Co-authored-by: Atemo <Atemo@users.noreply.github.com>
This commit is contained in:
Aleos 2021-10-05 14:48:38 -04:00 committed by GitHub
parent 586f5a1239
commit 9114083d7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 3 deletions

View File

@ -189,3 +189,6 @@ idletime_mer_option: 0x1F
// If drop rate was below this amount and bonus is applied to it, the bonus can't make it exceed this amount.
drop_rate_cap: 9000
drop_rate_cap_vip: 9000
// Displays a colored pillar effect for items dropped by monsters that contain random options.
rndopt_drop_pillar: on

View File

@ -9128,6 +9128,7 @@ static const struct _battle_data {
{ "mer_idle_no_share" , &battle_config.mer_idle_no_share, 0, 0, INT_MAX, },
{ "idletime_mer_option", &battle_config.idletime_mer_option, 0x1F, 0x1, 0xFFF, },
{ "feature.refineui", &battle_config.feature_refineui, 1, 0, 1, },
{ "rndopt_drop_pillar", &battle_config.rndopt_drop_pillar, 1, 0, 1, },
#include "../custom/battle_config_init.inc"
};

View File

@ -689,6 +689,7 @@ struct Battle_Config
int mer_idle_no_share;
int idletime_mer_option;
int feature_refineui;
int rndopt_drop_pillar;
#include "../custom/battle_config_struct.inc"
};

View File

@ -878,13 +878,34 @@ void clif_dropflooritem( struct flooritem_data* fitem, bool canShowEffect ){
if( dropEffect > 0 ){
p.showdropeffect = 1;
p.dropeffectmode = dropEffect - 1;
}else{
}else if (battle_config.rndopt_drop_pillar != 0){
uint8 optionCount = 0;
for (uint8 i = 0; i < MAX_ITEM_RDM_OPT; i++) {
if (fitem->item.option[i].id != 0) {
optionCount++;
}
}
if (optionCount > 0) {
p.showdropeffect = 1;
if (optionCount == 1)
p.dropeffectmode = DROPEFFECT_BLUE_PILLAR - 1;
else if (optionCount == 2)
p.dropeffectmode = DROPEFFECT_YELLOW_PILLAR - 1;
else
p.dropeffectmode = DROPEFFECT_PURPLE_PILLAR - 1;
} else {
p.showdropeffect = 0;
p.dropeffectmode = DROPEFFECT_NONE;
}
} else {
p.showdropeffect = 0;
p.dropeffectmode = 0;
p.dropeffectmode = DROPEFFECT_NONE;
}
}else{
p.showdropeffect = 0;
p.dropeffectmode = 0;
p.dropeffectmode = DROPEFFECT_NONE;
}
#endif
clif_send( &p, sizeof(p), &fitem->bl, AREA );