diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-09-03 20:00:33 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-09-03 20:00:33 +0000 |
commit | 7689b26c216bb9de59d7ddfcbe9c45c18cfb7cc4 (patch) | |
tree | 38fc970c9b971dae33515eaff4fea45192a8d44e /src/map/battle.c | |
parent | 7bb91031c6b244781f6637dc87dafa5835326888 (diff) | |
download | hercules-7689b26c216bb9de59d7ddfcbe9c45c18cfb7cc4.tar.gz hercules-7689b26c216bb9de59d7ddfcbe9c45c18cfb7cc4.tar.bz2 hercules-7689b26c216bb9de59d7ddfcbe9c45c18cfb7cc4.tar.xz hercules-7689b26c216bb9de59d7ddfcbe9c45c18cfb7cc4.zip |
- Added bonuses bSPRegenRate, bHPRegenRate. They behave like the opposite of bHPLossRate/bSPLossRate, making you gain x Hp/Sp every y ms.
- Added bonus bIgnoreMdefRate, used to ignore a % of the target's mdef when using magic attacks (bonus2 will ignore part of the mdef of all targets, bonus3 receives a race argument)
- You can now use bonus2 bCastRate to adjust the cast rate of a single skill.
- Cleaned the code for bleeding (hp-loss) and extended it to handle regen as well.
- Some small cleanups in the pc_bonus functions
- Removed bonus3 bHpLossRate since it was doing nothing and is not used.
- Corrected bGetZeny bonus to be like in Aegis. The amount received is from 1 to the given amount, you can use negative zeny values to use an amount dependant on mob's level (amount*lv).
- Updated doc/item_bonus.txt with all these changes
- Anti-Magic/Stone-Skin now increase/decrease def/mdef only and in an absolute mode (+20*lv rather than +20%*lv). Also the duration is greatly decreased (x/15) when used on players.
- Now when a player uses a strip skill without having it in the skill tree (auto-casted) the duration will be 0, the equipment will be stripped without causing the status change that blocks reequipping.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11112 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r-- | src/map/battle.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 3f9441aa4..4ec4e652d 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2333,10 +2333,22 @@ struct Damage battle_calc_magic_attack( } if(!flag.imdef){ + int mdef = tstatus->mdef; + int mdef2= tstatus->mdef2; + if(sd) { + i = sd->ignore_mdef[is_boss(target)?RC_BOSS:RC_NONBOSS]; + i+= sd->ignore_mdef[tstatus->race]; + if (i) + { + if (i > 100) i = 100; + mdef -= mdef * i/100; + mdef2-= mdef2* i/100; + } + } if(battle_config.magic_defense_type) - ad.damage = ad.damage - tstatus->mdef*battle_config.magic_defense_type - tstatus->mdef2; + ad.damage = ad.damage - mdef*battle_config.magic_defense_type - mdef2; else - ad.damage = ad.damage * (100-tstatus->mdef)/100 - tstatus->mdef2; + ad.damage = ad.damage * (100-mdef)/100 - mdef2; } if(skill_num == CR_GRANDCROSS || skill_num == NPC_GRANDDARKNESS) |