summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorDastgir <dastgirpojee@rocketmail.com>2016-01-11 19:37:02 +0530
committerHaru <haru@dotalux.com>2016-02-28 22:22:30 +0100
commit6fccf18b6112475d00c3abc63804043df8cb4df6 (patch)
tree89305c9080421768ceea19bc7cfd78293dc691cf /src/map
parent21f992314cde9243474bb171d09ec3d971b07214 (diff)
downloadhercules-6fccf18b6112475d00c3abc63804043df8cb4df6.tar.gz
hercules-6fccf18b6112475d00c3abc63804043df8cb4df6.tar.bz2
hercules-6fccf18b6112475d00c3abc63804043df8cb4df6.tar.xz
hercules-6fccf18b6112475d00c3abc63804043df8cb4df6.zip
Added NoKnockback Mode for monsters
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/mob.c3
-rw-r--r--src/map/skill.c2
-rw-r--r--src/map/status.h1
3 files changed, 5 insertions, 1 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 063a1ff6e..e26006599 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -3760,6 +3760,8 @@ int mob_read_db_mode_sub(struct mob_db *entry, struct config_setting_t *t)
mode |= libconfig->setting_get_bool(t2) ? MD_CHANGETARGET_CHASE : 0;
if ((t2 = libconfig->setting_get_member(t, "TargetWeak")))
mode |= libconfig->setting_get_bool(t2) ? MD_TARGETWEAK : 0;
+ if ((t2 = libconfig->setting_get_member(t, "NoKnockback")))
+ mode |= libconfig->setting_get_bool(t2) ? MD_NOKNOCKBACK : 0;
return mode;
}
@@ -4109,6 +4111,7 @@ int mob_read_db_sub(struct config_setting_t *mobt, int n, const char *source)
* ChangeTargetMelee: true/false
* ChangeTargetChase: true/false
* TargetWeak: true/false
+ * NoKnockback: true/false
* }
* MoveSpeed: move speed
* AttackDelay: attack delay
diff --git a/src/map/skill.c b/src/map/skill.c
index 366d66234..fb08103e7 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2089,7 +2089,7 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in
case BL_MOB:
{
const struct mob_data *md = BL_UCCAST(BL_MOB, target);
- if (md->class_ == MOBID_EMPELIUM)
+ if (md->status.mode&MD_NOKNOCKBACK)
return 0;
if (src != target && is_boss(target)) // Bosses can't be knocked-back
return 0;
diff --git a/src/map/status.h b/src/map/status.h
index 85219b280..14cda8545 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -1823,6 +1823,7 @@ enum e_mode
MD_CHANGETARGET_MELEE = 0x1000,
MD_CHANGETARGET_CHASE = 0x2000,
MD_TARGETWEAK = 0x4000,
+ MD_NOKNOCKBACK = 0x8000,
MD_MASK = 0xFFFF,
};