summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorEmistry Haoyan <equinox1991@gmail.com>2019-07-23 22:24:57 +0800
committerEmistry Haoyan <equinox1991@gmail.com>2019-07-24 07:36:26 +0800
commitb372b02e9cc21ceeb42a428177d992998aed2eec (patch)
treefae024ea4d1357514d998b363cb971961224761b /src/map/battle.c
parenta5eb6ec995612c878a3b6cb522520ffae8b13a3b (diff)
downloadhercules-b372b02e9cc21ceeb42a428177d992998aed2eec.tar.gz
hercules-b372b02e9cc21ceeb42a428177d992998aed2eec.tar.bz2
hercules-b372b02e9cc21ceeb42a428177d992998aed2eec.tar.xz
hercules-b372b02e9cc21ceeb42a428177d992998aed2eec.zip
Update mob_db - DamageTakenRate field
- adjust the damage taken by monster. (default = `100 = 1x`) - ref: https://github.com/idathena/trunk/commit/e267d2e2dada6196b479a6f2f35e9d25291ef22b
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index c40c3afac..75ce2b894 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -6321,6 +6321,18 @@ static enum damage_lv battle_weapon_attack(struct block_list *src, struct block_
if (sd && sd->state.arrow_atk) //Consume arrow.
battle->consume_ammo(sd, 0, 0);
+ if (target->type == BL_MOB) {
+ struct mob_data *md = BL_CAST(BL_MOB, target);
+ if (md != NULL) {
+ if (md->db->dmg_taken_rate != 100) {
+ if (wd.damage > 0)
+ wd.damage = apply_percentrate64(wd.damage, md->db->dmg_taken_rate, 100);
+ if (wd.damage2 > 0)
+ wd.damage2 = apply_percentrate64(wd.damage2, md->db->dmg_taken_rate, 100);
+ }
+ }
+ }
+
damage = wd.damage + wd.damage2;
if( damage > 0 && src != target ) {
if( sc && sc->data[SC_DUPLELIGHT] && (wd.flag&BF_SHORT) && rnd()%100 <= 10+2*sc->data[SC_DUPLELIGHT]->val1 ){