summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authortoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-17 22:38:25 +0000
committertoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-17 22:38:25 +0000
commit43e00cf6174ca30c6c702b59b5a1434dd1c5ce33 (patch)
tree86335f884d5f471f880753fa99cd4c7e6b8fbed6 /src/map/status.c
parent73c59399d732b6d5c88ccbf4fcb9ced38e777aca (diff)
downloadhercules-43e00cf6174ca30c6c702b59b5a1434dd1c5ce33.tar.gz
hercules-43e00cf6174ca30c6c702b59b5a1434dd1c5ce33.tar.bz2
hercules-43e00cf6174ca30c6c702b59b5a1434dd1c5ce33.tar.xz
hercules-43e00cf6174ca30c6c702b59b5a1434dd1c5ce33.zip
- Corrected map_random_dir algorithm
- Fixed homunc natural heal and little code cleanup git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8327 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/map/status.c b/src/map/status.c
index a966849a0..f6561b0e1 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -2532,10 +2532,11 @@ void status_calc_bl_sub_pc(struct map_session_data *sd, unsigned long flag)
//Calculates some attributes that depends on modified stats from status changes.
void status_calc_bl_sub_hom(struct homun_data *hd, unsigned long flag) //[orn]
{
+ TBL_PC * sd;
struct status_data *status = &hd->battle_status, *b_status = &hd->base_status;
int skill = 0;
- if (!hd->master)
+ if (!(sd = hd->master))
return; //Don't do anything if there isn't a master...
if(flag&(SCB_MAXHP|SCB_VIT))
@@ -2554,8 +2555,8 @@ void status_calc_bl_sub_hom(struct homun_data *hd, unsigned long flag) //[orn]
if(hd->regenhp < 1) hd->regenhp = 1;
// Skill-related Adamantium Skin
- if((skill=merc_hom_checkskill(hd->master,HAMI_SKIN)) > 0) {
- status->max_hp = hd->master->homunculus.max_hp + skill * 2 * hd->master->homunculus.max_hp / 100 ;
+ if((skill=merc_hom_checkskill(sd,HAMI_SKIN)) > 0) {
+ status->max_hp = sd->homunculus.max_hp + skill * 2 * sd->homunculus.max_hp / 100 ;
hd->regenhp += skill * 5 * hd->regenhp / 100 ;
}
@@ -2564,10 +2565,10 @@ void status_calc_bl_sub_hom(struct homun_data *hd, unsigned long flag) //[orn]
}
if(flag&SCB_DEF)
{
- status->def = hd->master->homunculus.level / 10 + status->vit / 5 ;
+ status->def = sd->homunculus.level / 10 + status->vit / 5 ;
if(hd->sc.data[SC_DEFENCE].timer != -1)
status->def += hd->sc.data[SC_DEFENCE].val2;
- if((skill=merc_hom_checkskill(hd->master,HAMI_SKIN)) > 0) {
+ if((skill=merc_hom_checkskill(sd,HAMI_SKIN)) > 0) {
status->def += skill * 4 ;
}
}
@@ -2576,7 +2577,7 @@ void status_calc_bl_sub_hom(struct homun_data *hd, unsigned long flag) //[orn]
flag|=SCB_MAXSP;
// Skill-related Instruction Change
- if((skill = merc_hom_checkskill(hd->master,HVAN_INSTRUCT)) > 0) {
+ if((skill = merc_hom_checkskill(sd,HVAN_INSTRUCT)) > 0) {
if ( skill == 5 ) {
status->int_ += 3 ;
} else if ( skill == 1 ) {
@@ -2593,8 +2594,8 @@ void status_calc_bl_sub_hom(struct homun_data *hd, unsigned long flag) //[orn]
}
}
- if((skill = merc_hom_checkskill(hd->master,HLIF_BRAIN)) > 0) {
- status->max_sp = hd->master->homunculus.max_sp + skill * 2 * hd->master->homunculus.max_sp / 100 ;
+ if((skill = merc_hom_checkskill(sd,HLIF_BRAIN)) > 0) {
+ status->max_sp = sd->homunculus.max_sp + skill * 2 * sd->homunculus.max_sp / 100 ;
hd->regensp += skill * 3 * hd->regensp / 100 ;
if ( skill == 5 ) {
status->max_sp *= 103 / 100 ;
@@ -2605,7 +2606,7 @@ void status_calc_bl_sub_hom(struct homun_data *hd, unsigned long flag) //[orn]
}
}
- status->mdef = hd->master->homunculus.level / 10 + status->int_ / 5 ;
+ status->mdef = sd->homunculus.level / 10 + status->int_ / 5 ;
status->max_sp = status_calc_maxsp(&hd->bl, &hd->sc, status->max_sp);
if(status->max_sp > (unsigned int)battle_config.max_sp)
@@ -2629,8 +2630,8 @@ void status_calc_bl_sub_hom(struct homun_data *hd, unsigned long flag) //[orn]
if(flag&(SCB_BATK|SCB_WATK)) {
status->rhw.atk = status->rhw.atk2 = status->str + ( status->str / 10 ) * ( status->str / 10 ) ;
status->rhw.atk += status->dex ;
- if ( (status->str + hd->master->homunculus.level) > status->dex )
- status->rhw.atk2 += status->str + hd->master->homunculus.level ;
+ if ( (status->str + sd->homunculus.level) > status->dex )
+ status->rhw.atk2 += status->str + sd->homunculus.level ;
else
status->rhw.atk2 += status->dex ;
@@ -2684,7 +2685,7 @@ void status_calc_bl_sub_hom(struct homun_data *hd, unsigned long flag) //[orn]
SCB_BATK|SCB_WATK|SCB_MATK|SCB_ASPD|SCB_SPEED|
SCB_RANGE|SCB_MAXHP|SCB_MAXSP)
)
- clif_hominfo(hd->master,hd,0);
+ clif_hominfo(sd,hd,0);
}
void status_calc_bl(struct block_list *bl, unsigned long flag)