summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-31 03:41:58 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-31 03:41:58 +0000
commit4107030428aa608b62524bcde7d211665ab83ca3 (patch)
tree6c56eb9759307d77fda364e9b999a7c840ee69cf /src/map/status.c
parent8b8ad4994db8d2558505f21babc17c03e4d5d244 (diff)
downloadhercules-4107030428aa608b62524bcde7d211665ab83ca3.tar.gz
hercules-4107030428aa608b62524bcde7d211665ab83ca3.tar.bz2
hercules-4107030428aa608b62524bcde7d211665ab83ca3.tar.xz
hercules-4107030428aa608b62524bcde7d211665ab83ca3.zip
- 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
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c33
1 files changed, 7 insertions, 26 deletions
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);
}