summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-01-20 02:19:05 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-01-20 02:19:05 +0000
commitf9d5becbc0b6cafa3cce70b16126638e8e0525c3 (patch)
treefe037cba8494135da8c1feac31191da05f01d81f /src/map/battle.c
parentdc43d9256c146508cc9a835805f36ff4c19d5824 (diff)
downloadhercules-f9d5becbc0b6cafa3cce70b16126638e8e0525c3.tar.gz
hercules-f9d5becbc0b6cafa3cce70b16126638e8e0525c3.tar.bz2
hercules-f9d5becbc0b6cafa3cce70b16126638e8e0525c3.tar.xz
hercules-f9d5becbc0b6cafa3cce70b16126638e8e0525c3.zip
- Added support for item effect Ignore Def Rate by Race. bonus2 bIgnoreDefRate,<race>,<%>;
- Added support for item status effects on skills. bonus3 bAddEff,<sc_effect>,<rate>,ATF_SKILL; - Update to battleground equipment. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13457 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 879e6c0db..1ac70f77b 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1712,8 +1712,20 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
short vit_def;
signed char def1 = status_get_def(target); //Don't use tstatus->def1 due to skill timer reductions.
short def2 = (short)tstatus->def2;
- if(battle_config.vit_penalty_type &&
- battle_config.vit_penalty_target&target->type)
+
+ if( sd )
+ {
+ i = sd->ignore_def[is_boss(target)?RC_BOSS:RC_NONBOSS];
+ i += sd->ignore_def[tstatus->race];
+ if( i )
+ {
+ if( i > 100 ) i = 100;
+ def1 -= def1 * i / 100;
+ // def2 -= def2 * i / 100;
+ }
+ }
+
+ if( battle_config.vit_penalty_type && battle_config.vit_penalty_target&target->type )
{
unsigned char target_count; //256 max targets should be a sane max
target_count = unit_counttargeted(target,battle_config.vit_penalty_count_lv);