summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 0e89c37da..f953c3c7c 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -3560,6 +3560,8 @@ static int mobskill_event(struct mob_data *md, struct block_list *src, int64 tic
res = mob->skill_use(md, tick, MSC_CLOSEDATTACKED);
else if (flag&BF_LONG && !(flag&BF_MAGIC)) //Long-attacked should not include magic.
res = mob->skill_use(md, tick, MSC_LONGRANGEATTACKED);
+ else if ((flag & BF_MAGIC) != 0)
+ res = mob->skill_use(md, tick, MSC_MAGICATTACKED);
if (!res)
//Restore previous target only if skill condition failed to trigger. [Skotlex]
@@ -5398,7 +5400,7 @@ static bool mob_skill_db_libconfig_sub_skill(struct config_setting_t *it, int n,
ms->target = MST_TARGET;
}
- if (mob->lookup_const(it, "CastCondition", &i32) && (i32 < MSC_ALWAYS || i32 > MSC_SPAWN)) {
+ if (mob->lookup_const(it, "CastCondition", &i32) && (i32 < MSC_ALWAYS || i32 > MSC_MAGICATTACKED)) {
ShowWarning("mob_skill_db_libconfig_sub_skill: Invalid skill condition %d for skill id %d in monster %d, defaulting to MSC_ALWAYS.\n", i32, skill_id, mob_id);
ms->cond1 = MSC_ALWAYS;
}