diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-10-12 18:48:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-10-12 18:48:32 +0300 |
commit | ec69d4fd5c6ec519cb7a04ba74182cbfeceb9cf9 (patch) | |
tree | 9d8bc7a0889ae2f640fcb68a0adb0b5ad1148d2f /src | |
parent | e5e70b5d5afe465f7ee9e168a1747b8984beeee0 (diff) | |
download | evol-hercules-ec69d4fd5c6ec519cb7a04ba74182cbfeceb9cf9.tar.gz evol-hercules-ec69d4fd5c6ec519cb7a04ba74182cbfeceb9cf9.tar.bz2 evol-hercules-ec69d4fd5c6ec519cb7a04ba74182cbfeceb9cf9.tar.xz evol-hercules-ec69d4fd5c6ec519cb7a04ba74182cbfeceb9cf9.zip |
Add support for mob ai attribute SurviveWithoutMaster.
Diffstat (limited to 'src')
-rw-r--r-- | src/emap/init.c | 1 | ||||
-rw-r--r-- | src/emap/mob.c | 14 | ||||
-rw-r--r-- | src/emap/mob.h | 5 |
3 files changed, 20 insertions, 0 deletions
diff --git a/src/emap/init.c b/src/emap/init.c index c19dc07..049402a 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -202,6 +202,7 @@ HPExport void plugin_init (void) addHookPost("clif->set_unit_walking", eclif_set_unit_walking); addHookPost("clif->move", eclif_move); addHookPost("map->addflooritem", emap_addflooritem_post); + addHookPost("mob->read_db_mode_sub", emob_read_db_mode_sub_post); addHookPost("skill->check_condition_castend", eskill_check_condition_castend_post); addHookPost("pc->additem", epc_additem_post); addHookPost("pc->isequip", epc_isequip_post); diff --git a/src/emap/mob.c b/src/emap/mob.c index eae7901..e7eccbc 100644 --- a/src/emap/mob.c +++ b/src/emap/mob.c @@ -69,3 +69,17 @@ void emob_read_db_additional_fields(struct mob_db *entry, if (mob->lookup_const(it, "WalkMask", &i32)) data->walkMask = i32; } + +int emob_read_db_mode_sub_post(int retVal, + struct mob_db *entry, + struct status_data *mstatus, + int *classPtr, + config_setting_t *t) +{ + config_setting_t *t2; + + if ((t2 = libconfig->setting_get_member(t, "SurviveWithoutMaster"))) + retVal |= libconfig->setting_get_bool(t2) ? 0x8000 : 0; + + return retVal; +} diff --git a/src/emap/mob.h b/src/emap/mob.h index 028195f..a2815fb 100644 --- a/src/emap/mob.h +++ b/src/emap/mob.h @@ -9,5 +9,10 @@ void emob_read_db_additional_fields(struct mob_db *entry, int *classPtr, config_setting_t *it, int *nPtr, const char *source); +int emob_read_db_mode_sub_post(int retVal, + struct mob_db *entry, + struct status_data *mstatus, + int *classPtr, + config_setting_t *t); #endif // EVOL_MAP_MOB |