From 4107030428aa608b62524bcde7d211665ab83ca3 Mon Sep 17 00:00:00 2001 From: skotlex Date: Wed, 31 May 2006 03:41:58 +0000 Subject: - Added function pc_check_skilltree for checking if you unlocked new tree-skills when raising non-passive skills. - Some cleaning of pc_calc_skilltree - Fixed flee/hit calculation in status_calc_bl to account for bonuses from the base status. - Some cleaning of status_calc_pet to use the cap_value define. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6872 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/status.c | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) (limited to 'src/map/status.c') diff --git a/src/map/status.c b/src/map/status.c index c95524a9b..48212875d 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1211,24 +1211,11 @@ int status_calc_pet(struct pet_data *pd, int first) status->rhw.atk2 = battle_config.pet_max_atk2; status->str = cap_value(status->str,1,battle_config.pet_max_stats); - if(status->str > battle_config.pet_max_stats) - status->str = battle_config.pet_max_stats; - else if (status->str < 1) status->str = 1; - if(status->agi > battle_config.pet_max_stats) - status->agi = battle_config.pet_max_stats; - else if (status->agi < 1) status->agi = 1; - if(status->vit > battle_config.pet_max_stats) - status->vit = battle_config.pet_max_stats; - else if (status->vit < 1) status->vit = 1; - if(status->int_ > battle_config.pet_max_stats) - status->int_ = battle_config.pet_max_stats; - else if (status->int_ < 1) status->int_ = 1; - if(status->dex > battle_config.pet_max_stats) - status->dex = battle_config.pet_max_stats; - else if (status->dex < 1) status->dex = 1; - if(status->luk > battle_config.pet_max_stats) - status->luk = battle_config.pet_max_stats; - else if (status->luk < 1) status->luk = 1; + status->agi = cap_value(status->agi,1,battle_config.pet_max_stats); + status->vit = cap_value(status->vit,1,battle_config.pet_max_stats); + status->int_= cap_value(status->int_,1,battle_config.pet_max_stats); + status->dex = cap_value(status->dex,1,battle_config.pet_max_stats); + status->luk = cap_value(status->luk,1,battle_config.pet_max_stats); status->batk = status_base_atk(&pd->bl, &pd->status); status_calc_misc(&pd->status, lv); @@ -2511,18 +2498,12 @@ void status_calc_bl(struct block_list *bl, unsigned long flag) } if(flag&SCB_HIT) { - status->hit = status_get_lv(bl) + status->dex; - temp = b_status->dex - status->dex; - if (temp) - status->hit += temp; + status->hit = b_status->hit - b_status->dex + status->dex; status->hit = status_calc_hit(bl, sc, status->hit); } if(flag&SCB_FLEE) { - status->flee = status_get_lv(bl) + status->agi; - temp = b_status->agi - status->agi; - if (temp) - status->flee += temp; + status->flee = b_status->flee - b_status->agi + status->agi; status->flee = status_calc_flee(bl, sc, status->flee); } -- cgit v1.2.3-70-g09d2