diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-05 17:57:37 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-05 17:57:37 +0000 |
commit | babf9653c5dd6ec37bc859665d3becf114962afc (patch) | |
tree | b910604c67110ee501d4b3a0b36fb99c473c1da2 /src/map/status.c | |
parent | d99c0313edbb4bd24172f825b7d621ad620ec7d1 (diff) | |
download | hercules-babf9653c5dd6ec37bc859665d3becf114962afc.tar.gz hercules-babf9653c5dd6ec37bc859665d3becf114962afc.tar.bz2 hercules-babf9653c5dd6ec37bc859665d3becf114962afc.tar.xz hercules-babf9653c5dd6ec37bc859665d3becf114962afc.zip |
- /doridori now won't double the HP/SP regen of TKs, it only activates their "happy" state.
- Added the -50 hit penalty when standing on Wall of Fog.
- Cleaned up status_calc_mdef2
- Uncommented the status_calc_mdef2 call in status_calc_pc.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6491 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r-- | src/map/status.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/map/status.c b/src/map/status.c index f0b4797eb..87142832a 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1311,7 +1311,7 @@ int status_calc_pc(struct map_session_data* sd,int first) // Basic INT-MDEF value
sd->mdef2 += sd->paramc[3];
- // sd->mdef2 = status_calc_mdef2(&sd->bl,sd->mdef2);
+ sd->mdef2 = status_calc_mdef2(&sd->bl,sd->mdef2);
// Apply relative modifiers from equipment
if(sd->mdef2_rate != 100)
@@ -2953,20 +2953,24 @@ int status_get_mdef2(struct block_list *bl) int mdef2=0;
nullpo_retr(0, bl);
- if(bl->type == BL_PC)
- return ((struct map_session_data *)bl)->mdef2 + (((struct map_session_data *)bl)->paramc[2]>>1);
- else if(bl->type == BL_MOB)
- mdef2 = ((struct mob_data *)bl)->db->int_ + (((struct mob_data *)bl)->db->vit>>1);
- else if(bl->type == BL_PET) { //<Skotlex> Use pet's stats
- if (battle_config.pet_lv_rate && ((struct pet_data *)bl)->status)
- mdef2 = ((struct pet_data *)bl)->status->int_ +(((struct pet_data *)bl)->status->vit>>1);
+ switch(bl->type)
+ {
+ case BL_PC:
+ return ((TBL_PC*)bl)->mdef2 + (((TBL_PC*)bl)->paramc[2]>>1);
+ case BL_MOB:
+ mdef2 = ((TBL_MOB*)bl)->db->int_ + (((TBL_MOB*)bl)->db->vit>>1);
+ break;
+ case BL_PET:
+ //<Skotlex> Use pet's stats
+ if (battle_config.pet_lv_rate && ((TBL_PET*)bl)->status)
+ mdef2 = ((TBL_PET*)bl)->status->int_ +(((TBL_PET*)bl)->status->vit>>1);
else
- mdef2 = ((struct pet_data *)bl)->db->int_ + (((struct pet_data *)bl)->db->vit>>1);
+ mdef2 = ((TBL_PET*)bl)->db->int_ + (((TBL_PET*)bl)->db->vit>>1);
+ break;
}
mdef2 = status_calc_mdef2(bl,mdef2);
if(mdef2 < 0) mdef2 = 0;
-
return mdef2;
}
/*==========================================
|