diff options
author | Haru <haru@dotalux.com> | 2020-05-27 13:18:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-27 13:18:39 +0200 |
commit | 03889da5f0c58401ef3c9483006b0ac033edbee6 (patch) | |
tree | 56ef7d2cd059b44ae410a78b499dd31541473aaa /src/map | |
parent | c4eae30a53a2996f5ae80a496b6ab161308f0b05 (diff) | |
parent | aa44b976cb7a512c2ad89c2e8974f525e77f1a7b (diff) | |
download | hercules-03889da5f0c58401ef3c9483006b0ac033edbee6.tar.gz hercules-03889da5f0c58401ef3c9483006b0ac033edbee6.tar.bz2 hercules-03889da5f0c58401ef3c9483006b0ac033edbee6.tar.xz hercules-03889da5f0c58401ef3c9483006b0ac033edbee6.zip |
Merge pull request #2733 from Kenpachi2k13/msc_magicattacked
Add MSC_MAGICATTACKED cast condition for monster skills
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/mob.c | 4 | ||||
-rw-r--r-- | src/map/mob.h | 1 | ||||
-rw-r--r-- | src/map/script.c | 1 |
3 files changed, 5 insertions, 1 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index dcbdccedd..b6ba5e5a9 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -3758,6 +3758,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 != 0) //Restore previous target only if skill condition failed to trigger. [Skotlex] @@ -5679,7 +5681,7 @@ static bool mob_skill_db_libconfig_sub_skill(struct config_setting_t *it, int n, } i32 = MSC_ALWAYS; - 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("%s: Invalid skill condition %d for skill id %d (%s) in %s %d, defaulting to MSC_ALWAYS.\n", __func__, i32, skill_id, skill_name, mob_str, mob_id); i32 = MSC_ALWAYS; diff --git a/src/map/mob.h b/src/map/mob.h index 6ad1ce705..59b288fcc 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -321,6 +321,7 @@ enum { MSC_MASTERATTACKED, MSC_ALCHEMIST, MSC_SPAWN, + MSC_MAGICATTACKED, }; /** Special monster(-name) constants used to assign skills to a group of monsters. **/ diff --git a/src/map/script.c b/src/map/script.c index 0fd8bda2a..e4a57194d 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -28122,6 +28122,7 @@ static void script_hardcoded_constants(void) script->set_constant("MSC_MASTERATTACKED", MSC_MASTERATTACKED, false, false); script->set_constant("MSC_ALCHEMIST", MSC_ALCHEMIST, false, false); script->set_constant("MSC_SPAWN", MSC_SPAWN, false, false); + script->set_constant("MSC_MAGICATTACKED", MSC_MAGICATTACKED, false, false); script->constdb_comment("monster skill targets"); script->set_constant("MST_TARGET", MST_TARGET, false, false); |