Fixed hidden statuses not being applied
* Follow up to a75133e. * Fixes #2111. Thanks to @Canoe, @Lemongrass3110, and @Jeybla!
This commit is contained in:
parent
07e1a670bc
commit
ef3ad997c7
@ -176,6 +176,11 @@ rental_mount_speed_boost: 25
|
||||
// Default (official): no
|
||||
show_status_katar_crit: no
|
||||
|
||||
// Display all status changes in the status window? (Note 1)
|
||||
// This setting only takes effect in renewal mode.
|
||||
// Default: no
|
||||
show_status_sc: no
|
||||
|
||||
//===================================
|
||||
// VIP system
|
||||
//===================================
|
||||
|
@ -8397,6 +8397,7 @@ static const struct _battle_data {
|
||||
{ "mvp_exp_reward_message", &battle_config.mvp_exp_reward_message, 0, 0, 1, },
|
||||
{ "can_damage_skill", &battle_config.can_damage_skill, 1, 0, BL_ALL, },
|
||||
{ "show_status_katar_crit", &battle_config.show_status_katar_crit, 0, 0, 1, },
|
||||
{ "show_status_sc", &battle_config.show_status_sc, 0, 0, 1, },
|
||||
{ "atcommand_levelup_events", &battle_config.atcommand_levelup_events, 0, 0, 1, },
|
||||
{ "block_account_in_same_party", &battle_config.block_account_in_same_party, 1, 0, 1, },
|
||||
{ "tarotcard_equal_chance", &battle_config.tarotcard_equal_chance, 0, 0, 1, },
|
||||
|
@ -612,6 +612,7 @@ extern struct Battle_Config
|
||||
int mvp_exp_reward_message;
|
||||
int can_damage_skill; //Which BL types can damage traps
|
||||
int show_status_katar_crit;
|
||||
int show_status_sc;
|
||||
int atcommand_levelup_events;
|
||||
int block_account_in_same_party;
|
||||
int tarotcard_equal_chance; //Official or equal chance for each card
|
||||
|
136
src/map/status.c
136
src/map/status.c
@ -5702,11 +5702,15 @@ unsigned short status_calc_batk(struct block_list *bl, struct status_change *sc,
|
||||
if(!sc || !sc->count)
|
||||
return cap_value(batk,0,USHRT_MAX);
|
||||
|
||||
if(!display) { // Status Changes that are hidden in the status window.
|
||||
if(sc->data[SC_ATKPOTION])
|
||||
batk += sc->data[SC_ATKPOTION]->val1;
|
||||
if(sc->data[SC_ATKPOTION])
|
||||
batk += sc->data[SC_ATKPOTION]->val1;
|
||||
|
||||
#ifdef RENEWAL
|
||||
// All other Status Changes are hidden in the status window.
|
||||
if(!display&&!battle_config.show_status_sc) {
|
||||
return (unsigned short)cap_value(batk,0,USHRT_MAX);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(sc->data[SC_BATKFOOD])
|
||||
batk += sc->data[SC_BATKFOOD]->val1;
|
||||
@ -5787,13 +5791,17 @@ unsigned short status_calc_watk(struct block_list *bl, struct status_change *sc,
|
||||
if(!sc || !sc->count)
|
||||
return (unsigned short)cap_value(watk,0,USHRT_MAX);
|
||||
|
||||
if(!display) { // Status Changes that are hidden in the status window.
|
||||
if(sc->data[SC_WATER_BARRIER])
|
||||
watk -= sc->data[SC_WATER_BARRIER]->val2;
|
||||
if(sc->data[SC_GT_CHANGE])
|
||||
watk += sc->data[SC_GT_CHANGE]->val2;
|
||||
if(sc->data[SC_WATER_BARRIER])
|
||||
watk -= sc->data[SC_WATER_BARRIER]->val2;
|
||||
if(sc->data[SC_GT_CHANGE])
|
||||
watk += sc->data[SC_GT_CHANGE]->val2;
|
||||
|
||||
#ifdef RENEWAL
|
||||
// All other Status Changes are hidden in the status window.
|
||||
if(!display&&!battle_config.show_status_sc) {
|
||||
return (unsigned short)cap_value(watk,0,USHRT_MAX);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef RENEWAL
|
||||
if(sc->data[SC_IMPOSITIO])
|
||||
@ -5938,11 +5946,15 @@ unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc,
|
||||
if(!sc || !sc->count)
|
||||
return (unsigned short)cap_value(matk,0,USHRT_MAX);
|
||||
|
||||
if(!display) { // Status Changes that are hidden in the status window.
|
||||
if(sc->data[SC_MINDBREAKER])
|
||||
matk += matk * sc->data[SC_MINDBREAKER]->val2 / 100;
|
||||
if(sc->data[SC_MINDBREAKER])
|
||||
matk += matk * sc->data[SC_MINDBREAKER]->val2 / 100;
|
||||
|
||||
#ifdef RENEWAL
|
||||
// All other Status Changes are hidden in the status window.
|
||||
if(!display&&!battle_config.show_status_sc) {
|
||||
return (unsigned short)cap_value(matk,0,USHRT_MAX);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef RENEWAL
|
||||
/// Take note fixed value first before % modifiers [PRE-RENEWAL]
|
||||
@ -6005,15 +6017,20 @@ signed short status_calc_critical(struct block_list *bl, struct status_change *s
|
||||
{
|
||||
if(!sc || !sc->count)
|
||||
return (short)cap_value(critical,10,SHRT_MAX);
|
||||
if(!display) { // Status Changes that are hidden in the status window.
|
||||
if (sc->data[SC_INCCRI]) {
|
||||
if (bl->type == BL_PC && ((TBL_PC*)bl)->status.weapon == W_KATAR) // Gives double critical rate when using Katar weapons [Limestone]
|
||||
critical += sc->data[SC_INCCRI]->val2 * 2;
|
||||
else
|
||||
critical += sc->data[SC_INCCRI]->val2;
|
||||
}
|
||||
|
||||
if (sc->data[SC_INCCRI]) {
|
||||
if (bl->type == BL_PC && ((TBL_PC*)bl)->status.weapon == W_KATAR) // Gives double critical rate when using Katar weapons [Limestone]
|
||||
critical += sc->data[SC_INCCRI]->val2 * 2;
|
||||
else
|
||||
critical += sc->data[SC_INCCRI]->val2;
|
||||
}
|
||||
|
||||
#ifdef RENEWAL
|
||||
// All other Status Changes are hidden in the status window.
|
||||
if(!display&&!battle_config.show_status_sc) {
|
||||
return (short)cap_value(critical,10,SHRT_MAX);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (sc->data[SC_CRIFOOD])
|
||||
critical += sc->data[SC_CRIFOOD]->val1;
|
||||
@ -6054,9 +6071,12 @@ signed short status_calc_hit(struct block_list *bl, struct status_change *sc, in
|
||||
if(!sc || !sc->count)
|
||||
return (short)cap_value(hit,1,SHRT_MAX);
|
||||
|
||||
if(!display) { // Status Changes that are hidden in the status window.
|
||||
#ifdef RENEWAL
|
||||
// All other Status Changes are hidden in the status window.
|
||||
if(!display&&!battle_config.show_status_sc) {
|
||||
return (short)cap_value(hit,1,SHRT_MAX);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(sc->data[SC_INCHIT])
|
||||
hit += sc->data[SC_INCHIT]->val1;
|
||||
@ -6116,9 +6136,12 @@ signed short status_calc_flee(struct block_list *bl, struct status_change *sc, i
|
||||
if(!sc || !sc->count)
|
||||
return (short)cap_value(flee,1,SHRT_MAX);
|
||||
|
||||
if(!display) { // Status Changes that are hidden in the status window.
|
||||
#ifdef RENEWAL
|
||||
// All other Status Changes are hidden in the status window.
|
||||
if(!display&&!battle_config.show_status_sc) {
|
||||
return (short)cap_value(flee,1,SHRT_MAX);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(sc->data[SC_OVERED_BOOST]) //Should be final and unmodifiable by any means
|
||||
return sc->data[SC_OVERED_BOOST]->val2;
|
||||
@ -6219,9 +6242,12 @@ signed short status_calc_flee2(struct block_list *bl, struct status_change *sc,
|
||||
if(!sc || !sc->count)
|
||||
return (short)cap_value(flee2,10,SHRT_MAX);
|
||||
|
||||
if(!display) { // Status Changes that are hidden in the status window.
|
||||
#ifdef RENEWAL
|
||||
// All other Status Changes are hidden in the status window.
|
||||
if(!display&&!battle_config.show_status_sc) {
|
||||
return (short)cap_value(flee2,10,SHRT_MAX);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(sc->data[SC_INCFLEE2])
|
||||
flee2 += sc->data[SC_INCFLEE2]->val2;
|
||||
@ -6246,21 +6272,25 @@ defType status_calc_def(struct block_list *bl, struct status_change *sc, int def
|
||||
if(!sc || !sc->count)
|
||||
return (defType)cap_value(def,DEFTYPE_MIN,DEFTYPE_MAX);
|
||||
|
||||
if(!display) { // Status Changes that are hidden in the status window.
|
||||
#ifdef RENEWAL
|
||||
if(sc->data[SC_ASSUMPTIO])
|
||||
def <<= 1; // only eDEF is doubled
|
||||
if(sc->data[SC_ASSUMPTIO])
|
||||
def <<= 1; // only eDEF is doubled
|
||||
#endif
|
||||
if(sc->data[SC_NEUTRALBARRIER])
|
||||
def += def * sc->data[SC_NEUTRALBARRIER]->val2 / 100;
|
||||
if(sc->data[SC_FORCEOFVANGUARD])
|
||||
def += def * 2 * sc->data[SC_FORCEOFVANGUARD]->val1 / 100;
|
||||
if(sc->data[SC_CAMOUFLAGE])
|
||||
def -= def * 5 * sc->data[SC_CAMOUFLAGE]->val3 / 100;
|
||||
if(sc->data[SC_OVERED_BOOST] && bl->type == BL_PC)
|
||||
def -= def * sc->data[SC_OVERED_BOOST]->val4 / 100;
|
||||
if(sc->data[SC_NEUTRALBARRIER])
|
||||
def += def * sc->data[SC_NEUTRALBARRIER]->val2 / 100;
|
||||
if(sc->data[SC_FORCEOFVANGUARD])
|
||||
def += def * 2 * sc->data[SC_FORCEOFVANGUARD]->val1 / 100;
|
||||
if(sc->data[SC_CAMOUFLAGE])
|
||||
def -= def * 5 * sc->data[SC_CAMOUFLAGE]->val3 / 100;
|
||||
if(sc->data[SC_OVERED_BOOST] && bl->type == BL_PC)
|
||||
def -= def * sc->data[SC_OVERED_BOOST]->val4 / 100;
|
||||
|
||||
#ifdef RENEWAL
|
||||
// All other Status Changes are hidden in the status window.
|
||||
if(!display&&!battle_config.show_status_sc) {
|
||||
return (defType)cap_value(def,DEFTYPE_MIN,DEFTYPE_MAX);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(sc->data[SC_BERSERK])
|
||||
return 0;
|
||||
@ -6353,17 +6383,17 @@ signed short status_calc_def2(struct block_list *bl, struct status_change *sc, i
|
||||
#endif
|
||||
}
|
||||
|
||||
if(!display) { // Status Changes that are hidden in the status window.
|
||||
if(sc->data[SC_CAMOUFLAGE])
|
||||
def2 -= def2 * 5 * sc->data[SC_CAMOUFLAGE]->val3 / 100;
|
||||
if(sc->data[SC_GT_REVITALIZE])
|
||||
def2 += sc->data[SC_GT_REVITALIZE]->val4;
|
||||
if(sc->data[SC_CAMOUFLAGE])
|
||||
def2 -= def2 * 5 * sc->data[SC_CAMOUFLAGE]->val3 / 100;
|
||||
if(sc->data[SC_GT_REVITALIZE])
|
||||
def2 += sc->data[SC_GT_REVITALIZE]->val4;
|
||||
|
||||
#ifdef RENEWAL
|
||||
// All other Status Changes are hidden in the status window.
|
||||
if(!display&&!battle_config.show_status_sc) {
|
||||
return (short)cap_value(def2,SHRT_MIN,SHRT_MAX);
|
||||
#else
|
||||
return (short)cap_value(def2,1,SHRT_MAX);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
if(sc->data[SC_BERSERK])
|
||||
return 0;
|
||||
@ -6432,15 +6462,19 @@ defType status_calc_mdef(struct block_list *bl, struct status_change *sc, int md
|
||||
if(!sc || !sc->count)
|
||||
return (defType)cap_value(mdef,DEFTYPE_MIN,DEFTYPE_MAX);
|
||||
|
||||
if(!display) { // Status Changes that are hidden in the status window.
|
||||
#ifdef RENEWAL
|
||||
if(sc->data[SC_ASSUMPTIO])
|
||||
mdef <<= 1; // only eMDEF is doubled
|
||||
if(sc->data[SC_ASSUMPTIO])
|
||||
mdef <<= 1; // only eMDEF is doubled
|
||||
#endif
|
||||
if(sc->data[SC_NEUTRALBARRIER])
|
||||
mdef += mdef * sc->data[SC_NEUTRALBARRIER]->val2 / 100;
|
||||
if(sc->data[SC_NEUTRALBARRIER])
|
||||
mdef += mdef * sc->data[SC_NEUTRALBARRIER]->val2 / 100;
|
||||
|
||||
#ifdef RENEWAL
|
||||
// All other Status Changes are hidden in the status window.
|
||||
if(!display&&!battle_config.show_status_sc) {
|
||||
return (defType)cap_value(mdef,DEFTYPE_MIN,DEFTYPE_MAX);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(sc->data[SC_BERSERK])
|
||||
return 0;
|
||||
@ -6499,15 +6533,15 @@ signed short status_calc_mdef2(struct block_list *bl, struct status_change *sc,
|
||||
#endif
|
||||
}
|
||||
|
||||
if(!display) { // Status Changes that are hidden in the status window.
|
||||
if(sc->data[SC_MINDBREAKER])
|
||||
mdef2 -= mdef2 * sc->data[SC_MINDBREAKER]->val3 / 100;
|
||||
if(sc->data[SC_MINDBREAKER])
|
||||
mdef2 -= mdef2 * sc->data[SC_MINDBREAKER]->val3 / 100;
|
||||
|
||||
#ifdef RENEWAL
|
||||
// All other Status Changes are hidden in the status window.
|
||||
if(!display&&!battle_config.show_status_sc) {
|
||||
return (short)cap_value(mdef2,SHRT_MIN,SHRT_MAX);
|
||||
#else
|
||||
return (short)cap_value(mdef2,1,SHRT_MAX);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
if(sc->data[SC_BERSERK])
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user