|
@@ -55,6 +55,43 @@ short current_equip_opt_index; /// Contains random option index of an equipped i
|
|
|
|
|
|
unsigned int SCDisabled[SC_MAX]; ///< List of disabled SC on map zones. [Cydh]
|
|
|
|
|
|
+static unsigned short status_calc_str(struct block_list *,struct status_change *,int);
|
|
|
+static unsigned short status_calc_agi(struct block_list *,struct status_change *,int);
|
|
|
+static unsigned short status_calc_vit(struct block_list *,struct status_change *,int);
|
|
|
+static unsigned short status_calc_int(struct block_list *,struct status_change *,int);
|
|
|
+static unsigned short status_calc_dex(struct block_list *,struct status_change *,int);
|
|
|
+static unsigned short status_calc_luk(struct block_list *,struct status_change *,int);
|
|
|
+static unsigned short status_calc_batk(struct block_list *,struct status_change *,int);
|
|
|
+static unsigned short status_calc_watk(struct block_list *,struct status_change *,int);
|
|
|
+static unsigned short status_calc_matk(struct block_list *,struct status_change *,int);
|
|
|
+static signed short status_calc_hit(struct block_list *,struct status_change *,int);
|
|
|
+static signed short status_calc_critical(struct block_list *,struct status_change *,int);
|
|
|
+static signed short status_calc_flee(struct block_list *,struct status_change *,int);
|
|
|
+static signed short status_calc_flee2(struct block_list *,struct status_change *,int);
|
|
|
+static defType status_calc_def(struct block_list *bl, struct status_change *sc, int);
|
|
|
+static signed short status_calc_def2(struct block_list *,struct status_change *,int);
|
|
|
+static defType status_calc_mdef(struct block_list *bl, struct status_change *sc, int);
|
|
|
+static signed short status_calc_mdef2(struct block_list *,struct status_change *,int);
|
|
|
+static unsigned short status_calc_speed(struct block_list *,struct status_change *,int);
|
|
|
+static short status_calc_aspd_rate(struct block_list *,struct status_change *,int);
|
|
|
+static unsigned short status_calc_dmotion(struct block_list *bl, struct status_change *sc, int dmotion);
|
|
|
+#ifdef RENEWAL_ASPD
|
|
|
+static short status_calc_aspd(struct block_list *bl, struct status_change *sc, bool fixed);
|
|
|
+#endif
|
|
|
+static short status_calc_fix_aspd(struct block_list *bl, struct status_change *sc, int);
|
|
|
+static unsigned int status_calc_maxhp(struct block_list *bl, uint64 maxhp);
|
|
|
+static unsigned int status_calc_maxsp(struct block_list *bl, uint64 maxsp);
|
|
|
+static unsigned char status_calc_element(struct block_list *bl, struct status_change *sc, int element);
|
|
|
+static unsigned char status_calc_element_lv(struct block_list *bl, struct status_change *sc, int lv);
|
|
|
+static enum e_mode status_calc_mode(struct block_list *bl, struct status_change *sc, enum e_mode mode);
|
|
|
+#ifdef RENEWAL
|
|
|
+static unsigned short status_calc_ematk(struct block_list *,struct status_change *,int);
|
|
|
+#endif
|
|
|
+static int status_get_hpbonus(struct block_list *bl, enum e_status_bonus type);
|
|
|
+static int status_get_spbonus(struct block_list *bl, enum e_status_bonus type);
|
|
|
+static unsigned int status_calc_maxhpsp_pc(struct map_session_data* sd, unsigned int stat, bool isHP);
|
|
|
+static int status_get_sc_interval(enum sc_type type);
|
|
|
+
|
|
|
static bool status_change_isDisabledOnMap_(sc_type type, bool mapIsVS, bool mapIsPVP, bool mapIsGVG, bool mapIsBG, unsigned int mapZone, bool mapIsTE);
|
|
|
#define status_change_isDisabledOnMap(type, m) ( status_change_isDisabledOnMap_((type), map_flag_vs2((m)), map[(m)].flag.pvp, map_flag_gvg2_no_te((m)), map[(m)].flag.battleground, map[(m)].zone << 3, map_flag_gvg2_te((m))) )
|
|
|
|
|
@@ -369,11 +406,10 @@ void initChangeTables(void)
|
|
|
set_sc( LK_BERSERK , SC_BERSERK , SI_BERSERK , SCB_DEF|SCB_DEF2|SCB_MDEF|SCB_MDEF2|SCB_FLEE|SCB_SPEED|SCB_ASPD|SCB_MAXHP|SCB_REGEN );
|
|
|
set_sc( HP_ASSUMPTIO , SC_ASSUMPTIO ,
|
|
|
#ifndef RENEWAL
|
|
|
- SI_ASSUMPTIO ,
|
|
|
+ SI_ASSUMPTIO , SCB_NONE );
|
|
|
#else
|
|
|
- SI_ASSUMPTIO2 ,
|
|
|
+ SI_ASSUMPTIO2 , SCB_NONE );
|
|
|
#endif
|
|
|
- SCB_NONE );
|
|
|
add_sc( HP_BASILICA , SC_BASILICA );
|
|
|
set_sc( HW_MAGICPOWER , SC_MAGICPOWER , SI_MAGICPOWER , SCB_MATK );
|
|
|
add_sc( PA_SACRIFICE , SC_SACRIFICE );
|
|
@@ -494,13 +530,7 @@ void initChangeTables(void)
|
|
|
|
|
|
set_sc( CASH_BLESSING , SC_BLESSING , SI_BLESSING , SCB_STR|SCB_INT|SCB_DEX );
|
|
|
set_sc( CASH_INCAGI , SC_INCREASEAGI , SI_INCREASEAGI , SCB_AGI|SCB_SPEED );
|
|
|
- set_sc( CASH_ASSUMPTIO , SC_ASSUMPTIO ,
|
|
|
-#ifndef RENEWAL
|
|
|
- SI_ASSUMPTIO ,
|
|
|
-#else
|
|
|
- SI_ASSUMPTIO2 ,
|
|
|
-#endif
|
|
|
- SCB_NONE );
|
|
|
+ set_sc( CASH_ASSUMPTIO , SC_ASSUMPTIO , SI_ASSUMPTIO , SCB_NONE );
|
|
|
|
|
|
set_sc( ALL_PARTYFLEE , SC_PARTYFLEE , SI_PARTYFLEE , SCB_NONE );
|
|
|
set_sc( ALL_ODINS_POWER , SC_ODINS_POWER , SI_ODINS_POWER , SCB_WATK|SCB_MATK|SCB_MDEF|SCB_DEF );
|
|
@@ -1194,13 +1224,13 @@ void initChangeTables(void)
|
|
|
StatusChangeFlagTable[SC_WEDDING] |= SCB_SPEED;
|
|
|
StatusChangeFlagTable[SC_ALL_RIDING] |= SCB_SPEED;
|
|
|
StatusChangeFlagTable[SC_PUSH_CART] |= SCB_SPEED;
|
|
|
- StatusChangeFlagTable[SC_MTF_ASPD] |= SCB_ASPD;
|
|
|
+ StatusChangeFlagTable[SC_MTF_ASPD] |= SCB_ASPD|SCB_HIT;
|
|
|
StatusChangeFlagTable[SC_MTF_MATK] |= SCB_MATK;
|
|
|
StatusChangeFlagTable[SC_MTF_MLEATKED] |= SCB_ALL;
|
|
|
StatusChangeFlagTable[SC_QUEST_BUFF1] |= SCB_BATK|SCB_MATK;
|
|
|
StatusChangeFlagTable[SC_QUEST_BUFF2] |= SCB_BATK|SCB_MATK;
|
|
|
StatusChangeFlagTable[SC_QUEST_BUFF3] |= SCB_BATK|SCB_MATK;
|
|
|
- StatusChangeFlagTable[SC_MTF_ASPD2] |= SCB_ASPD;
|
|
|
+ StatusChangeFlagTable[SC_MTF_ASPD2] |= SCB_ASPD|SCB_HIT;
|
|
|
StatusChangeFlagTable[SC_MTF_MATK2] |= SCB_MATK;
|
|
|
StatusChangeFlagTable[SC_2011RWC_SCROLL] |= SCB_BATK|SCB_MATK|SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK;
|
|
|
StatusChangeFlagTable[SC_MTF_HITFLEE] |= SCB_HIT|SCB_FLEE;
|
|
@@ -2851,7 +2881,7 @@ void status_calc_pet_(struct pet_data *pd, enum e_status_calc_opt opt)
|
|
|
* @return bonus: total bonus for HP
|
|
|
* @author [Cydh]
|
|
|
*/
|
|
|
-int status_get_hpbonus(struct block_list *bl, enum e_status_bonus type) {
|
|
|
+static int status_get_hpbonus(struct block_list *bl, enum e_status_bonus type) {
|
|
|
int bonus = 0;
|
|
|
|
|
|
if (type == STATUS_BONUS_FIX) {
|
|
@@ -2983,7 +3013,7 @@ int status_get_hpbonus(struct block_list *bl, enum e_status_bonus type) {
|
|
|
* @return bonus: total bonus for SP
|
|
|
* @author [Cydh]
|
|
|
*/
|
|
|
-int status_get_spbonus(struct block_list *bl, enum e_status_bonus type) {
|
|
|
+static int status_get_spbonus(struct block_list *bl, enum e_status_bonus type) {
|
|
|
int bonus = 0;
|
|
|
|
|
|
if (type == STATUS_BONUS_FIX) {
|
|
@@ -3076,7 +3106,7 @@ int status_get_spbonus(struct block_list *bl, enum e_status_bonus type) {
|
|
|
* @param isHP true - calculates Max HP, false - calculated Max SP
|
|
|
* @return max The max value of HP or SP
|
|
|
*/
|
|
|
-unsigned int status_calc_maxhpsp_pc(struct map_session_data* sd, unsigned int stat, bool isHP) {
|
|
|
+static unsigned int status_calc_maxhpsp_pc(struct map_session_data* sd, unsigned int stat, bool isHP) {
|
|
|
double dmax = 0;
|
|
|
uint16 idx, level, job_id;
|
|
|
|
|
@@ -4696,33 +4726,33 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
|
|
|
temp += status->batk;
|
|
|
status->batk = cap_value(temp, 0, USHRT_MAX);
|
|
|
}
|
|
|
- status->batk = status_calc_batk(bl, sc, status->batk, true);
|
|
|
+ status->batk = status_calc_batk(bl, sc, status->batk);
|
|
|
}
|
|
|
|
|
|
if(flag&SCB_WATK) {
|
|
|
#ifndef RENEWAL
|
|
|
- status->rhw.atk = status_calc_watk(bl, sc, b_status->rhw.atk, true);
|
|
|
+ status->rhw.atk = status_calc_watk(bl, sc, b_status->rhw.atk);
|
|
|
if (!sd) // Should not affect weapon refine bonus
|
|
|
- status->rhw.atk2 = status_calc_watk(bl, sc, b_status->rhw.atk2, true);
|
|
|
+ status->rhw.atk2 = status_calc_watk(bl, sc, b_status->rhw.atk2);
|
|
|
|
|
|
if (sd && sd->bonus.weapon_atk_rate)
|
|
|
status->rhw.atk += status->rhw.atk * sd->bonus.weapon_atk_rate / 100;
|
|
|
if(b_status->lhw.atk) {
|
|
|
if (sd) {
|
|
|
sd->state.lr_flag = 1;
|
|
|
- status->lhw.atk = status_calc_watk(bl, sc, b_status->lhw.atk, true);
|
|
|
+ status->lhw.atk = status_calc_watk(bl, sc, b_status->lhw.atk);
|
|
|
sd->state.lr_flag = 0;
|
|
|
} else {
|
|
|
- status->lhw.atk = status_calc_watk(bl, sc, b_status->lhw.atk, true);
|
|
|
- status->lhw.atk2= status_calc_watk(bl, sc, b_status->lhw.atk2, true);
|
|
|
+ status->lhw.atk = status_calc_watk(bl, sc, b_status->lhw.atk);
|
|
|
+ status->lhw.atk2= status_calc_watk(bl, sc, b_status->lhw.atk2);
|
|
|
}
|
|
|
}
|
|
|
#else
|
|
|
if(!b_status->watk) { // We only have left-hand weapon
|
|
|
status->watk = 0;
|
|
|
- status->watk2 = status_calc_watk(bl, sc, b_status->watk2, false);
|
|
|
- } else
|
|
|
- status->watk = status_calc_watk(bl, sc, b_status->watk, false);
|
|
|
+ status->watk2 = status_calc_watk(bl, sc, b_status->watk2);
|
|
|
+ }
|
|
|
+ else status->watk = status_calc_watk(bl, sc, b_status->watk);
|
|
|
#endif
|
|
|
}
|
|
|
|
|
@@ -4732,13 +4762,13 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
|
|
|
&& status->luk == b_status->luk
|
|
|
#endif
|
|
|
)
|
|
|
- status->hit = status_calc_hit(bl, sc, b_status->hit, true);
|
|
|
+ status->hit = status_calc_hit(bl, sc, b_status->hit);
|
|
|
else
|
|
|
status->hit = status_calc_hit(bl, sc, b_status->hit + (status->dex - b_status->dex)
|
|
|
#ifdef RENEWAL
|
|
|
+ (status->luk/3 - b_status->luk/3)
|
|
|
#endif
|
|
|
- , true);
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
if(flag&SCB_FLEE) {
|
|
@@ -4747,17 +4777,17 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
|
|
|
&& status->luk == b_status->luk
|
|
|
#endif
|
|
|
)
|
|
|
- status->flee = status_calc_flee(bl, sc, b_status->flee, true);
|
|
|
+ status->flee = status_calc_flee(bl, sc, b_status->flee);
|
|
|
else
|
|
|
status->flee = status_calc_flee(bl, sc, b_status->flee +(status->agi - b_status->agi)
|
|
|
#ifdef RENEWAL
|
|
|
+ (status->luk/5 - b_status->luk/5)
|
|
|
#endif
|
|
|
- , true);
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
if(flag&SCB_DEF) {
|
|
|
- status->def = status_calc_def(bl, sc, b_status->def, true);
|
|
|
+ status->def = status_calc_def(bl, sc, b_status->def);
|
|
|
|
|
|
if( bl->type&BL_HOM )
|
|
|
status->def += (status->vit/5 - b_status->vit/5);
|
|
@@ -4769,7 +4799,7 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
|
|
|
&& status->agi == b_status->agi
|
|
|
#endif
|
|
|
)
|
|
|
- status->def2 = status_calc_def2(bl, sc, b_status->def2, true);
|
|
|
+ status->def2 = status_calc_def2(bl, sc, b_status->def2);
|
|
|
else
|
|
|
status->def2 = status_calc_def2(bl, sc, b_status->def2
|
|
|
#ifdef RENEWAL
|
|
@@ -4777,11 +4807,11 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
|
|
|
#else
|
|
|
+ (status->vit - b_status->vit)
|
|
|
#endif
|
|
|
- , true);
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
if(flag&SCB_MDEF) {
|
|
|
- status->mdef = status_calc_mdef(bl, sc, b_status->mdef, true);
|
|
|
+ status->mdef = status_calc_mdef(bl, sc, b_status->mdef);
|
|
|
|
|
|
if( bl->type&BL_HOM )
|
|
|
status->mdef += (status->int_/5 - b_status->int_/5);
|
|
@@ -4793,7 +4823,7 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
|
|
|
&& status->dex == b_status->dex
|
|
|
#endif
|
|
|
)
|
|
|
- status->mdef2 = status_calc_mdef2(bl, sc, b_status->mdef2, true);
|
|
|
+ status->mdef2 = status_calc_mdef2(bl, sc, b_status->mdef2);
|
|
|
else
|
|
|
status->mdef2 = status_calc_mdef2(bl, sc, b_status->mdef2 +(status->int_ - b_status->int_)
|
|
|
#ifdef RENEWAL
|
|
@@ -4801,7 +4831,7 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
|
|
|
#else
|
|
|
+ ((status->vit - b_status->vit)>>1)
|
|
|
#endif
|
|
|
- , true);
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
if(flag&SCB_SPEED) {
|
|
@@ -4820,20 +4850,20 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
|
|
|
|
|
|
if(flag&SCB_CRI && b_status->cri) {
|
|
|
if (status->luk == b_status->luk)
|
|
|
- status->cri = status_calc_critical(bl, sc, b_status->cri, true);
|
|
|
+ status->cri = status_calc_critical(bl, sc, b_status->cri);
|
|
|
else
|
|
|
- status->cri = status_calc_critical(bl, sc, b_status->cri + 3*(status->luk - b_status->luk), true);
|
|
|
+ status->cri = status_calc_critical(bl, sc, b_status->cri + 3*(status->luk - b_status->luk));
|
|
|
|
|
|
/// After status_calc_critical so the bonus is applied despite if you have or not a sc bugreport:5240
|
|
|
- if (battle_config.show_status_katar_crit && bl->type == BL_PC && ((TBL_PC*)bl)->status.weapon == W_KATAR)
|
|
|
+ if( bl->type == BL_PC && ((TBL_PC*)bl)->status.weapon == W_KATAR )
|
|
|
status->cri <<= 1;
|
|
|
}
|
|
|
|
|
|
if(flag&SCB_FLEE2 && b_status->flee2) {
|
|
|
if (status->luk == b_status->luk)
|
|
|
- status->flee2 = status_calc_flee2(bl, sc, b_status->flee2, true);
|
|
|
+ status->flee2 = status_calc_flee2(bl, sc, b_status->flee2);
|
|
|
else
|
|
|
- status->flee2 = status_calc_flee2(bl, sc, b_status->flee2 +(status->luk - b_status->luk), true);
|
|
|
+ status->flee2 = status_calc_flee2(bl, sc, b_status->flee2 +(status->luk - b_status->luk));
|
|
|
}
|
|
|
|
|
|
if(flag&SCB_ATK_ELE) {
|
|
@@ -4984,8 +5014,8 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
- status->matk_max = status_calc_matk(bl, sc, status->matk_max, true);
|
|
|
- status->matk_min = status_calc_matk(bl, sc, status->matk_min, true);
|
|
|
+ status->matk_max = status_calc_matk(bl, sc, status->matk_max);
|
|
|
+ status->matk_min = status_calc_matk(bl, sc, status->matk_min);
|
|
|
}
|
|
|
|
|
|
if(flag&SCB_ASPD) {
|
|
@@ -5273,7 +5303,7 @@ void status_calc_bl_(struct block_list* bl, enum scb_flag flag, enum e_status_ca
|
|
|
* @param str: Initial str
|
|
|
* @return modified str with cap_value(str,0,USHRT_MAX)
|
|
|
*/
|
|
|
-unsigned short status_calc_str(struct block_list *bl, struct status_change *sc, int str)
|
|
|
+static unsigned short status_calc_str(struct block_list *bl, struct status_change *sc, int str)
|
|
|
{
|
|
|
if(!sc || !sc->count)
|
|
|
return cap_value(str,0,USHRT_MAX);
|
|
@@ -5347,7 +5377,7 @@ unsigned short status_calc_str(struct block_list *bl, struct status_change *sc,
|
|
|
* @param agi: Initial agi
|
|
|
* @return modified agi with cap_value(agi,0,USHRT_MAX)
|
|
|
*/
|
|
|
-unsigned short status_calc_agi(struct block_list *bl, struct status_change *sc, int agi)
|
|
|
+static unsigned short status_calc_agi(struct block_list *bl, struct status_change *sc, int agi)
|
|
|
{
|
|
|
if(!sc || !sc->count)
|
|
|
return cap_value(agi,0,USHRT_MAX);
|
|
@@ -5419,7 +5449,7 @@ unsigned short status_calc_agi(struct block_list *bl, struct status_change *sc,
|
|
|
* @param vit: Initial vit
|
|
|
* @return modified vit with cap_value(vit,0,USHRT_MAX)
|
|
|
*/
|
|
|
-unsigned short status_calc_vit(struct block_list *bl, struct status_change *sc, int vit)
|
|
|
+static unsigned short status_calc_vit(struct block_list *bl, struct status_change *sc, int vit)
|
|
|
{
|
|
|
if(!sc || !sc->count)
|
|
|
return cap_value(vit,0,USHRT_MAX);
|
|
@@ -5483,7 +5513,7 @@ unsigned short status_calc_vit(struct block_list *bl, struct status_change *sc,
|
|
|
* @param int_: Initial int
|
|
|
* @return modified int with cap_value(int_,0,USHRT_MAX)
|
|
|
*/
|
|
|
-unsigned short status_calc_int(struct block_list *bl, struct status_change *sc, int int_)
|
|
|
+static unsigned short status_calc_int(struct block_list *bl, struct status_change *sc, int int_)
|
|
|
{
|
|
|
if(!sc || !sc->count)
|
|
|
return cap_value(int_,0,USHRT_MAX);
|
|
@@ -5560,7 +5590,7 @@ unsigned short status_calc_int(struct block_list *bl, struct status_change *sc,
|
|
|
* @param dex: Initial dex
|
|
|
* @return modified dex with cap_value(dex,0,USHRT_MAX)
|
|
|
*/
|
|
|
-unsigned short status_calc_dex(struct block_list *bl, struct status_change *sc, int dex)
|
|
|
+static unsigned short status_calc_dex(struct block_list *bl, struct status_change *sc, int dex)
|
|
|
{
|
|
|
if(!sc || !sc->count)
|
|
|
return cap_value(dex,0,USHRT_MAX);
|
|
@@ -5634,7 +5664,7 @@ unsigned short status_calc_dex(struct block_list *bl, struct status_change *sc,
|
|
|
* @param luk: Initial luk
|
|
|
* @return modified luk with cap_value(luk,0,USHRT_MAX)
|
|
|
*/
|
|
|
-unsigned short status_calc_luk(struct block_list *bl, struct status_change *sc, int luk)
|
|
|
+static unsigned short status_calc_luk(struct block_list *bl, struct status_change *sc, int luk)
|
|
|
{
|
|
|
if(!sc || !sc->count)
|
|
|
return cap_value(luk,0,USHRT_MAX);
|
|
@@ -5694,20 +5724,15 @@ unsigned short status_calc_luk(struct block_list *bl, struct status_change *sc,
|
|
|
* @param bl: Object to change batk [PC|MOB|HOM|MER|ELEM]
|
|
|
* @param sc: Object's status change information
|
|
|
* @param batk: Initial batk
|
|
|
- * @param display: If the status change is displayed in the status window
|
|
|
* @return modified batk with cap_value(batk,0,USHRT_MAX)
|
|
|
*/
|
|
|
-unsigned short status_calc_batk(struct block_list *bl, struct status_change *sc, int batk, bool display)
|
|
|
+static unsigned short status_calc_batk(struct block_list *bl, struct status_change *sc, int batk)
|
|
|
{
|
|
|
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;
|
|
|
- return (unsigned short)cap_value(batk,0,USHRT_MAX);
|
|
|
- }
|
|
|
-
|
|
|
+ if(sc->data[SC_ATKPOTION])
|
|
|
+ batk += sc->data[SC_ATKPOTION]->val1;
|
|
|
if(sc->data[SC_BATKFOOD])
|
|
|
batk += sc->data[SC_BATKFOOD]->val1;
|
|
|
#ifndef RENEWAL
|
|
@@ -5779,21 +5804,12 @@ unsigned short status_calc_batk(struct block_list *bl, struct status_change *sc,
|
|
|
* @param bl: Object to change watk [PC]
|
|
|
* @param sc: Object's status change information
|
|
|
* @param watk: Initial watk
|
|
|
- * @param display: If the status change is displayed in the status window
|
|
|
* @return modified watk with cap_value(watk,0,USHRT_MAX)
|
|
|
*/
|
|
|
-unsigned short status_calc_watk(struct block_list *bl, struct status_change *sc, int watk, bool display)
|
|
|
+static unsigned short status_calc_watk(struct block_list *bl, struct status_change *sc, int watk)
|
|
|
{
|
|
|
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;
|
|
|
- return (unsigned short)cap_value(watk,0,USHRT_MAX);
|
|
|
- }
|
|
|
+ return cap_value(watk,0,USHRT_MAX);
|
|
|
|
|
|
#ifndef RENEWAL
|
|
|
if(sc->data[SC_IMPOSITIO])
|
|
@@ -5807,6 +5823,8 @@ unsigned short status_calc_watk(struct block_list *bl, struct status_change *sc,
|
|
|
watk += sc->data[SC_VOLCANO]->val2;
|
|
|
if(sc->data[SC_MERC_ATKUP])
|
|
|
watk += sc->data[SC_MERC_ATKUP]->val2;
|
|
|
+ if(sc->data[SC_WATER_BARRIER])
|
|
|
+ watk -= sc->data[SC_WATER_BARRIER]->val2;
|
|
|
#ifndef RENEWAL
|
|
|
if(sc->data[SC_NIBELUNGEN]) {
|
|
|
if (bl->type != BL_PC)
|
|
@@ -5842,6 +5860,8 @@ unsigned short status_calc_watk(struct block_list *bl, struct status_change *sc,
|
|
|
watk += (10 + 10 * sc->data[SC_BANDING]->val1) * sc->data[SC_BANDING]->val2;
|
|
|
if(sc->data[SC_INSPIRATION])
|
|
|
watk += 40 * sc->data[SC_INSPIRATION]->val1 + 3 * sc->data[SC_INSPIRATION]->val2;
|
|
|
+ if(sc->data[SC_GT_CHANGE])
|
|
|
+ watk += sc->data[SC_GT_CHANGE]->val2;
|
|
|
if(sc->data[SC__ENERVATION])
|
|
|
watk -= watk * sc->data[SC__ENERVATION]->val2 / 100;
|
|
|
if(sc->data[SC_STRIKING])
|
|
@@ -5883,10 +5903,10 @@ unsigned short status_calc_watk(struct block_list *bl, struct status_change *sc,
|
|
|
* @param matk: Initial matk
|
|
|
* @return modified matk with cap_value(matk,0,USHRT_MAX)
|
|
|
*/
|
|
|
-unsigned short status_calc_ematk(struct block_list *bl, struct status_change *sc, int matk)
|
|
|
+static unsigned short status_calc_ematk(struct block_list *bl, struct status_change *sc, int matk)
|
|
|
{
|
|
|
if (!sc || !sc->count)
|
|
|
- return (unsigned short)cap_value(matk,0,USHRT_MAX);
|
|
|
+ return cap_value(matk,0,USHRT_MAX);
|
|
|
|
|
|
if (sc->data[SC_MATKPOTION])
|
|
|
matk += sc->data[SC_MATKPOTION]->val1;
|
|
@@ -5930,20 +5950,12 @@ unsigned short status_calc_ematk(struct block_list *bl, struct status_change *sc
|
|
|
* @param bl: Object to change matk [PC|MOB|HOM|MER|ELEM]
|
|
|
* @param sc: Object's status change information
|
|
|
* @param matk: Initial matk
|
|
|
- * @param display: If the status change is displayed in the status window
|
|
|
* @return modified matk with cap_value(matk,0,USHRT_MAX)
|
|
|
*/
|
|
|
-unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc, int matk, bool display)
|
|
|
+static unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc, int matk)
|
|
|
{
|
|
|
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;
|
|
|
- return (unsigned short)cap_value(matk,0,USHRT_MAX);
|
|
|
- }
|
|
|
-
|
|
|
+ return cap_value(matk,0,USHRT_MAX);
|
|
|
#ifndef RENEWAL
|
|
|
/// Take note fixed value first before % modifiers [PRE-RENEWAL]
|
|
|
if (sc->data[SC_MATKPOTION])
|
|
@@ -5979,6 +5991,8 @@ unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc,
|
|
|
matk += sc->data[SC_QUEST_BUFF3]->val1;
|
|
|
if (sc->data[SC_MAGICPOWER] && sc->data[SC_MAGICPOWER]->val4)
|
|
|
matk += matk * sc->data[SC_MAGICPOWER]->val3/100;
|
|
|
+ if (sc->data[SC_MINDBREAKER])
|
|
|
+ matk += matk * sc->data[SC_MINDBREAKER]->val2/100;
|
|
|
if (sc->data[SC_INCMATKRATE])
|
|
|
matk += matk * sc->data[SC_INCMATKRATE]->val1/100;
|
|
|
if (sc->data[SC_MOONLITSERENADE])
|
|
@@ -5998,23 +6012,15 @@ unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc,
|
|
|
* @param bl: Object to change critical [PC|MOB|HOM|MER|ELEM]
|
|
|
* @param sc: Object's status change information
|
|
|
* @param critical: Initial critical
|
|
|
- * @param display: If the status change is displayed in the status window
|
|
|
* @return modified critical with cap_value(critical,10,USHRT_MAX)
|
|
|
*/
|
|
|
-signed short status_calc_critical(struct block_list *bl, struct status_change *sc, int critical, bool display)
|
|
|
+static signed short status_calc_critical(struct block_list *bl, struct status_change *sc, int critical)
|
|
|
{
|
|
|
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;
|
|
|
- }
|
|
|
- return (short)cap_value(critical,10,SHRT_MAX);
|
|
|
- }
|
|
|
+ return cap_value(critical,10,SHRT_MAX);
|
|
|
|
|
|
+ if (sc->data[SC_INCCRI])
|
|
|
+ critical += sc->data[SC_INCCRI]->val2;
|
|
|
if (sc->data[SC_CRIFOOD])
|
|
|
critical += sc->data[SC_CRIFOOD]->val1;
|
|
|
if (sc->data[SC_EXPLOSIONSPIRITS])
|
|
@@ -6046,17 +6052,12 @@ signed short status_calc_critical(struct block_list *bl, struct status_change *s
|
|
|
* @param bl: Object to change hit [PC|MOB|HOM|MER|ELEM]
|
|
|
* @param sc: Object's status change information
|
|
|
* @param hit: Initial hit
|
|
|
- * @param display: If the status change is displayed in the status window
|
|
|
* @return modified hit with cap_value(hit,1,USHRT_MAX)
|
|
|
*/
|
|
|
-signed short status_calc_hit(struct block_list *bl, struct status_change *sc, int hit, bool display)
|
|
|
+static signed short status_calc_hit(struct block_list *bl, struct status_change *sc, int hit)
|
|
|
{
|
|
|
if(!sc || !sc->count)
|
|
|
- return (short)cap_value(hit,1,SHRT_MAX);
|
|
|
-
|
|
|
- if(!display) { // Status Changes that are hidden in the status window.
|
|
|
- return (short)cap_value(hit,1,SHRT_MAX);
|
|
|
- }
|
|
|
+ return cap_value(hit,1,SHRT_MAX);
|
|
|
|
|
|
if(sc->data[SC_INCHIT])
|
|
|
hit += sc->data[SC_INCHIT]->val1;
|
|
@@ -6092,6 +6093,8 @@ signed short status_calc_hit(struct block_list *bl, struct status_change *sc, in
|
|
|
hit -= hit * 50 / 100;
|
|
|
if(sc->data[SC_ILLUSIONDOPING])
|
|
|
hit -= sc->data[SC_ILLUSIONDOPING]->val2;
|
|
|
+ if (sc->data[SC_MTF_ASPD])
|
|
|
+ hit += sc->data[SC_MTF_ASPD]->val2;
|
|
|
|
|
|
return (short)cap_value(hit,1,SHRT_MAX);
|
|
|
}
|
|
@@ -6101,10 +6104,9 @@ signed short status_calc_hit(struct block_list *bl, struct status_change *sc, in
|
|
|
* @param bl: Object to change flee [PC|MOB|HOM|MER|ELEM]
|
|
|
* @param sc: Object's status change information
|
|
|
* @param flee: Initial flee
|
|
|
- * @param display: If the status change is displayed in the status window
|
|
|
* @return modified flee with cap_value(flee,1,USHRT_MAX)
|
|
|
*/
|
|
|
-signed short status_calc_flee(struct block_list *bl, struct status_change *sc, int flee, bool display)
|
|
|
+static signed short status_calc_flee(struct block_list *bl, struct status_change *sc, int flee)
|
|
|
{
|
|
|
if( bl->type == BL_PC ) {
|
|
|
if( map_flag_gvg(bl->m) )
|
|
@@ -6114,12 +6116,7 @@ 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.
|
|
|
- return (short)cap_value(flee,1,SHRT_MAX);
|
|
|
- }
|
|
|
-
|
|
|
+ return cap_value(flee,1,SHRT_MAX);
|
|
|
if(sc->data[SC_OVERED_BOOST]) //Should be final and unmodifiable by any means
|
|
|
return sc->data[SC_OVERED_BOOST]->val2;
|
|
|
if(sc->data[SC_TINDER_BREAKER] || sc->data[SC_TINDER_BREAKER2])
|
|
@@ -6211,17 +6208,12 @@ signed short status_calc_flee(struct block_list *bl, struct status_change *sc, i
|
|
|
* @param bl: Object to change flee2 [PC|MOB|HOM|MER|ELEM]
|
|
|
* @param sc: Object's status change information
|
|
|
* @param flee2: Initial flee2
|
|
|
- * @param display: If the status change is displayed in the status window
|
|
|
* @return modified flee2 with cap_value(flee2,10,USHRT_MAX)
|
|
|
*/
|
|
|
-signed short status_calc_flee2(struct block_list *bl, struct status_change *sc, int flee2, bool display)
|
|
|
+static signed short status_calc_flee2(struct block_list *bl, struct status_change *sc, int flee2)
|
|
|
{
|
|
|
if(!sc || !sc->count)
|
|
|
- return (short)cap_value(flee2,10,SHRT_MAX);
|
|
|
-
|
|
|
- if(!display) { // Status Changes that are hidden in the status window.
|
|
|
- return (short)cap_value(flee2,10,SHRT_MAX);
|
|
|
- }
|
|
|
+ return cap_value(flee2,10,SHRT_MAX);
|
|
|
|
|
|
if(sc->data[SC_INCFLEE2])
|
|
|
flee2 += sc->data[SC_INCFLEE2]->val2;
|
|
@@ -6238,30 +6230,13 @@ signed short status_calc_flee2(struct block_list *bl, struct status_change *sc,
|
|
|
* @param bl: Object to change def [PC|MOB|HOM|MER|ELEM]
|
|
|
* @param sc: Object's status change information
|
|
|
* @param def: Initial def
|
|
|
- * @param display: If the status change is displayed in the status window
|
|
|
* @return modified def with cap_value(def,DEFTYPE_MIN,DEFTYPE_MAX)
|
|
|
*/
|
|
|
-defType status_calc_def(struct block_list *bl, struct status_change *sc, int def, bool display)
|
|
|
+static 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
|
|
|
-#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;
|
|
|
- return (defType)cap_value(def,DEFTYPE_MIN,DEFTYPE_MAX);
|
|
|
- }
|
|
|
-
|
|
|
if(sc->data[SC_BERSERK])
|
|
|
return 0;
|
|
|
if(sc->data[SC_BARRIER])
|
|
@@ -6311,6 +6286,8 @@ defType status_calc_def(struct block_list *bl, struct status_change *sc, int def
|
|
|
def -= def * 10 / 100;
|
|
|
if( sc->data[SC_ANALYZE] )
|
|
|
def -= def * (14 * sc->data[SC_ANALYZE]->val1) / 100;
|
|
|
+ if( sc->data[SC_NEUTRALBARRIER] )
|
|
|
+ def += def * sc->data[SC_NEUTRALBARRIER]->val2 / 100;
|
|
|
if( sc->data[SC_SHIELDSPELL_REF] && sc->data[SC_SHIELDSPELL_REF]->val1 == 2 )
|
|
|
def += sc->data[SC_SHIELDSPELL_REF]->val2;
|
|
|
if( sc->data[SC_PRESTIGE] )
|
|
@@ -6323,6 +6300,8 @@ defType status_calc_def(struct block_list *bl, struct status_change *sc, int def
|
|
|
def -= def * (10 + 10 * sc->data[SC_SATURDAYNIGHTFEVER]->val1) / 100;
|
|
|
if( sc->data[SC_EARTHDRIVE] )
|
|
|
def -= def * 25 / 100;
|
|
|
+ if( sc->data[SC_CAMOUFLAGE] )
|
|
|
+ def -= def * 5 * sc->data[SC_CAMOUFLAGE]->val3 / 100;
|
|
|
if( sc->data[SC_SOLID_SKIN_OPTION] )
|
|
|
def += def * sc->data[SC_SOLID_SKIN_OPTION]->val2 / 100;
|
|
|
if( sc->data[SC_ROCK_CRUSHER] )
|
|
@@ -6331,8 +6310,10 @@ defType status_calc_def(struct block_list *bl, struct status_change *sc, int def
|
|
|
def += def * sc->data[SC_POWER_OF_GAIA]->val2 / 100;
|
|
|
if(sc->data[SC_ASH])
|
|
|
def -= def * sc->data[SC_ASH]->val3/100;
|
|
|
+ if( sc->data[SC_OVERED_BOOST] && bl->type == BL_HOM )
|
|
|
+ def -= def * sc->data[SC_OVERED_BOOST]->val4 / 100;
|
|
|
|
|
|
- return (defType)cap_value(def,DEFTYPE_MIN,DEFTYPE_MAX);
|
|
|
+ return (defType)cap_value(def,DEFTYPE_MIN,DEFTYPE_MAX);;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -6340,30 +6321,16 @@ defType status_calc_def(struct block_list *bl, struct status_change *sc, int def
|
|
|
* @param bl: Object to change def2 [PC|MOB|HOM|MER|ELEM]
|
|
|
* @param sc: Object's status change information
|
|
|
* @param def2: Initial def2
|
|
|
- * @param display: If the status change is displayed in the status window
|
|
|
* @return modified def2 with cap_value(def2,SHRT_MIN,SHRT_MAX)
|
|
|
*/
|
|
|
-signed short status_calc_def2(struct block_list *bl, struct status_change *sc, int def2, bool display)
|
|
|
+static signed short status_calc_def2(struct block_list *bl, struct status_change *sc, int def2)
|
|
|
{
|
|
|
- if(!sc || !sc->count) {
|
|
|
-#ifdef RENEWAL
|
|
|
- return (short)cap_value(def2,SHRT_MIN,SHRT_MAX);
|
|
|
-#else
|
|
|
- return (short)cap_value(def2,1,SHRT_MAX);
|
|
|
-#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 || !sc->count)
|
|
|
#ifdef RENEWAL
|
|
|
return (short)cap_value(def2,SHRT_MIN,SHRT_MAX);
|
|
|
#else
|
|
|
return (short)cap_value(def2,1,SHRT_MAX);
|
|
|
#endif
|
|
|
- }
|
|
|
|
|
|
if(sc->data[SC_BERSERK])
|
|
|
return 0;
|
|
@@ -6411,6 +6378,8 @@ signed short status_calc_def2(struct block_list *bl, struct status_change *sc, i
|
|
|
def2 -= def2 * sc->data[SC_PARALYSIS]->val2 / 100;
|
|
|
if(sc->data[SC_EQC])
|
|
|
def2 -= def2 * sc->data[SC_EQC]->val2 / 100;
|
|
|
+ if( sc->data[SC_CAMOUFLAGE] )
|
|
|
+ def2 -= def2 * 5 * sc->data[SC_CAMOUFLAGE]->val3 / 100;
|
|
|
|
|
|
#ifdef RENEWAL
|
|
|
return (short)cap_value(def2,SHRT_MIN,SHRT_MAX);
|
|
@@ -6424,24 +6393,13 @@ signed short status_calc_def2(struct block_list *bl, struct status_change *sc, i
|
|
|
* @param bl: Object to change mdef [PC|MOB|HOM|MER|ELEM]
|
|
|
* @param sc: Object's status change information
|
|
|
* @param mdef: Initial mdef
|
|
|
- * @param display: If the status change is displayed in the status window
|
|
|
* @return modified mdef with cap_value(mdef,DEFTYPE_MIN,DEFTYPE_MAX)
|
|
|
*/
|
|
|
-defType status_calc_mdef(struct block_list *bl, struct status_change *sc, int mdef, bool display)
|
|
|
+static defType status_calc_mdef(struct block_list *bl, struct status_change *sc, int mdef)
|
|
|
{
|
|
|
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
|
|
|
-#endif
|
|
|
- if(sc->data[SC_NEUTRALBARRIER])
|
|
|
- mdef += mdef * sc->data[SC_NEUTRALBARRIER]->val2 / 100;
|
|
|
- return (defType)cap_value(mdef,DEFTYPE_MIN,DEFTYPE_MAX);
|
|
|
- }
|
|
|
-
|
|
|
if(sc->data[SC_BERSERK])
|
|
|
return 0;
|
|
|
if(sc->data[SC_BARRIER])
|
|
@@ -6466,6 +6424,8 @@ defType status_calc_mdef(struct block_list *bl, struct status_change *sc, int md
|
|
|
mdef += 25 * mdef / 100;
|
|
|
if(sc->data[SC_BURNING])
|
|
|
mdef -= 25 * mdef / 100;
|
|
|
+ if( sc->data[SC_NEUTRALBARRIER] )
|
|
|
+ mdef += mdef * sc->data[SC_NEUTRALBARRIER]->val2 / 100;
|
|
|
if(sc->data[SC_ANALYZE])
|
|
|
mdef -= mdef * ( 14 * sc->data[SC_ANALYZE]->val1 ) / 100;
|
|
|
if(sc->data[SC_SYMPHONYOFLOVER])
|
|
@@ -6486,28 +6446,16 @@ defType status_calc_mdef(struct block_list *bl, struct status_change *sc, int md
|
|
|
* @param bl: Object to change mdef2 [PC|MOB|HOM|MER|ELEM]
|
|
|
* @param sc: Object's status change information
|
|
|
* @param mdef2: Initial mdef2
|
|
|
- * @param display: If the status change is displayed in the status window
|
|
|
* @return modified mdef2 with cap_value(mdef2,SHRT_MIN,SHRT_MAX)
|
|
|
*/
|
|
|
-signed short status_calc_mdef2(struct block_list *bl, struct status_change *sc, int mdef2, bool display)
|
|
|
+static signed short status_calc_mdef2(struct block_list *bl, struct status_change *sc, int mdef2)
|
|
|
{
|
|
|
- if(!sc || !sc->count) {
|
|
|
-#ifdef RENEWAL
|
|
|
- return (short)cap_value(mdef2,SHRT_MIN,SHRT_MAX);
|
|
|
-#else
|
|
|
- return (short)cap_value(mdef2,1,SHRT_MAX);
|
|
|
-#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 || !sc->count)
|
|
|
#ifdef RENEWAL
|
|
|
return (short)cap_value(mdef2,SHRT_MIN,SHRT_MAX);
|
|
|
#else
|
|
|
return (short)cap_value(mdef2,1,SHRT_MAX);
|
|
|
#endif
|
|
|
- }
|
|
|
|
|
|
if(sc->data[SC_BERSERK])
|
|
|
return 0;
|
|
@@ -6516,6 +6464,8 @@ signed short status_calc_mdef2(struct block_list *bl, struct status_change *sc,
|
|
|
if(sc->data[SC_MDEFSET])
|
|
|
return sc->data[SC_MDEFSET]->val1;
|
|
|
|
|
|
+ if(sc->data[SC_MINDBREAKER])
|
|
|
+ mdef2 -= mdef2 * sc->data[SC_MINDBREAKER]->val3/100;
|
|
|
if(sc->data[SC_BURNING])
|
|
|
mdef2 -= mdef2 * 25 / 100;
|
|
|
if(sc->data[SC_ANALYZE])
|
|
@@ -6535,7 +6485,7 @@ signed short status_calc_mdef2(struct block_list *bl, struct status_change *sc,
|
|
|
* @param speed: Initial speed
|
|
|
* @return modified speed with cap_value(speed,10,USHRT_MAX)
|
|
|
*/
|
|
|
-unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc, int speed)
|
|
|
+static unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc, int speed)
|
|
|
{
|
|
|
TBL_PC* sd = BL_CAST(BL_PC, bl);
|
|
|
int speed_rate = 100;
|
|
@@ -6720,7 +6670,7 @@ unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc
|
|
|
* False - percentage value
|
|
|
* @return modified aspd
|
|
|
*/
|
|
|
-short status_calc_aspd(struct block_list *bl, struct status_change *sc, bool fixed)
|
|
|
+static short status_calc_aspd(struct block_list *bl, struct status_change *sc, bool fixed)
|
|
|
{
|
|
|
int bonus = 0;
|
|
|
|
|
@@ -6843,7 +6793,7 @@ short status_calc_aspd(struct block_list *bl, struct status_change *sc, bool fix
|
|
|
* @param aspd: Object's current ASPD
|
|
|
* @return modified aspd
|
|
|
*/
|
|
|
-short status_calc_fix_aspd(struct block_list *bl, struct status_change *sc, int aspd)
|
|
|
+static short status_calc_fix_aspd(struct block_list *bl, struct status_change *sc, int aspd)
|
|
|
{
|
|
|
if (!sc || !sc->count)
|
|
|
return cap_value(aspd, 0, 2000);
|
|
@@ -6871,7 +6821,7 @@ short status_calc_fix_aspd(struct block_list *bl, struct status_change *sc, int
|
|
|
* @param aspd_rate: Object's current ASPD
|
|
|
* @return modified aspd_rate
|
|
|
*/
|
|
|
-short status_calc_aspd_rate(struct block_list *bl, struct status_change *sc, int aspd_rate)
|
|
|
+static short status_calc_aspd_rate(struct block_list *bl, struct status_change *sc, int aspd_rate)
|
|
|
{
|
|
|
int i;
|
|
|
|
|
@@ -7016,7 +6966,7 @@ short status_calc_aspd_rate(struct block_list *bl, struct status_change *sc, int
|
|
|
* @param dmotion: Object's current damage delay
|
|
|
* @return modified delay rate
|
|
|
*/
|
|
|
-unsigned short status_calc_dmotion(struct block_list *bl, struct status_change *sc, int dmotion)
|
|
|
+static unsigned short status_calc_dmotion(struct block_list *bl, struct status_change *sc, int dmotion)
|
|
|
{
|
|
|
if( !sc || !sc->count || map_flag_gvg(bl->m) || map[bl->m].flag.battleground )
|
|
|
return cap_value(dmotion,0,USHRT_MAX);
|
|
@@ -7037,7 +6987,7 @@ unsigned short status_calc_dmotion(struct block_list *bl, struct status_change *
|
|
|
* @param maxhp: Object's current max HP
|
|
|
* @return modified maxhp
|
|
|
*/
|
|
|
-unsigned int status_calc_maxhp(struct block_list *bl, uint64 maxhp)
|
|
|
+static unsigned int status_calc_maxhp(struct block_list *bl, uint64 maxhp)
|
|
|
{
|
|
|
int rate = 100;
|
|
|
|
|
@@ -7056,7 +7006,7 @@ unsigned int status_calc_maxhp(struct block_list *bl, uint64 maxhp)
|
|
|
* @param maxsp: Object's current max SP
|
|
|
* @return modified maxsp
|
|
|
*/
|
|
|
-unsigned int status_calc_maxsp(struct block_list *bl, uint64 maxsp)
|
|
|
+static unsigned int status_calc_maxsp(struct block_list *bl, uint64 maxsp)
|
|
|
{
|
|
|
int rate = 100;
|
|
|
|
|
@@ -7075,7 +7025,7 @@ unsigned int status_calc_maxsp(struct block_list *bl, uint64 maxsp)
|
|
|
* @param element: Object's current element
|
|
|
* @return new element
|
|
|
*/
|
|
|
-unsigned char status_calc_element(struct block_list *bl, struct status_change *sc, int element)
|
|
|
+static unsigned char status_calc_element(struct block_list *bl, struct status_change *sc, int element)
|
|
|
{
|
|
|
if(!sc || !sc->count)
|
|
|
return cap_value(element, 0, UCHAR_MAX);
|
|
@@ -7103,7 +7053,7 @@ unsigned char status_calc_element(struct block_list *bl, struct status_change *s
|
|
|
* @param lv: Object's current element level
|
|
|
* @return new element level
|
|
|
*/
|
|
|
-unsigned char status_calc_element_lv(struct block_list *bl, struct status_change *sc, int lv)
|
|
|
+static unsigned char status_calc_element_lv(struct block_list *bl, struct status_change *sc, int lv)
|
|
|
{
|
|
|
if(!sc || !sc->count)
|
|
|
return cap_value(lv, 1, 4);
|
|
@@ -7173,7 +7123,7 @@ unsigned char status_calc_attack_element(struct block_list *bl, struct status_ch
|
|
|
* @param mode: Original mode
|
|
|
* @return mode with cap_value(mode, 0, INT_MAX)
|
|
|
*/
|
|
|
-enum e_mode status_calc_mode(struct block_list *bl, struct status_change *sc, enum e_mode mode)
|
|
|
+static enum e_mode status_calc_mode(struct block_list *bl, struct status_change *sc, enum e_mode mode)
|
|
|
{
|
|
|
if(!sc || !sc->count)
|
|
|
return cap_value(mode, 0, INT_MAX);
|
|
@@ -7757,7 +7707,7 @@ void status_change_init(struct block_list *bl)
|
|
|
* through the timer (e.g. those that deal damage in regular intervals)
|
|
|
* @param type: Status change (SC_*)
|
|
|
*------------------------------------------*/
|
|
|
-int status_get_sc_interval(enum sc_type type)
|
|
|
+static int status_get_sc_interval(enum sc_type type)
|
|
|
{
|
|
|
switch (type) {
|
|
|
case SC_POISON:
|