summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-07-28 20:25:19 +0200
committerGitHub <noreply@github.com>2019-07-28 20:25:19 +0200
commitc179d9184301e83e75a425fc09818be98b443f65 (patch)
tree2d27640ae8e572eac3f763dd4375ed233e157977 /src/map/mob.c
parent015f3ef6f763fb11360b4b644d19034e4fcb0357 (diff)
parentb372b02e9cc21ceeb42a428177d992998aed2eec (diff)
downloadhercules-c179d9184301e83e75a425fc09818be98b443f65.tar.gz
hercules-c179d9184301e83e75a425fc09818be98b443f65.tar.bz2
hercules-c179d9184301e83e75a425fc09818be98b443f65.tar.xz
hercules-c179d9184301e83e75a425fc09818be98b443f65.zip
Merge pull request #2510 from Emistry/mobdb_dmg_taken_rate
Update mob_db - DamageTakenRate field
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 939d062af..283bec25a 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -4604,6 +4604,7 @@ static int mob_read_db_sub(struct config_setting_t *mobt, int n, const char *sou
* AttackMotion: attack motion
* DamageMotion: damage motion
* MvpExp: mvp experience
+ * DamageTakenRate: damage taken rate
* MvpDrops: {
* AegisName: chance
* ...
@@ -4837,6 +4838,12 @@ static int mob_read_db_sub(struct config_setting_t *mobt, int n, const char *sou
}
}
+ if (mob->lookup_const(mobt, "DamageTakenRate", &i32) && i32 >= 0) {
+ md.dmg_taken_rate = cap_value(i32, 1, INT_MAX);
+ } else if (!inherit) {
+ md.dmg_taken_rate = 100;
+ }
+
mob->read_db_additional_fields(&md, mobt, n, source);
return mob->db_validate_entry(&md, n, source);