diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/init.c | 3 | ||||
-rw-r--r-- | src/map/status.c | 22 | ||||
-rw-r--r-- | src/map/status.h | 2 |
3 files changed, 26 insertions, 1 deletions
diff --git a/src/map/init.c b/src/map/init.c index e825346..572b5e8 100644 --- a/src/map/init.c +++ b/src/map/init.c @@ -68,6 +68,8 @@ HPExport void plugin_init (void) { // HPM_map_add_group_permission = GET_SYMBOL("addGroupPermission"); + status_init(); + addAtcommand("setskill", setSkill); addScriptCommand("setcamnpc", "*", setCamNpc); @@ -153,6 +155,7 @@ HPExport void plugin_init (void) addHookPost("clif->changemap", eclif_changemap_post); addHookPost("clif->set_unit_idle", eclif_set_unit_idle_post); addHookPost("status->set_viewdata", estatus_set_viewdata_post); + addHookPost("status->read_job_db_sub", estatus_read_job_db_sub); addHookPost("clif->set_unit_walking", eclif_set_unit_walking); addHookPost("clif->move", eclif_move); addHookPost("map->addflooritem", emap_addflooritem_post); diff --git a/src/map/status.c b/src/map/status.c index fa18d39..2961646 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -10,6 +10,7 @@ #include "../../../common/mmo.h" #include "../../../common/socket.h" #include "../../../common/strlib.h" +#include "../../../map/itemdb.h" #include "../../../map/map.h" #include "../../../map/npc.h" #include "../../../map/status.h" @@ -17,8 +18,17 @@ #include "map/data/npcd.h" #include "map/struct/npcdext.h" +int class_move_speed[CLASS_COUNT]; + +void status_init(void) +{ + int f; + for (f = 0; f < CLASS_COUNT; f ++) + class_move_speed[f] = 150; +} + void estatus_set_viewdata_post(struct block_list *bl, - int *class_ __attribute__ ((unused))) + int *class_ __attribute__ ((unused))) { if (!bl) return; @@ -32,3 +42,13 @@ void estatus_set_viewdata_post(struct block_list *bl, npc->vd->sex = 3; } } + +void estatus_read_job_db_sub(int *idxPtr, + const char *name __attribute__ ((unused)), + config_setting_t *jdb) +{ + int i32 = 0; + const int idx = *idxPtr; + if (itemdb->lookup_const(jdb, "MoveSpeed", &i32)) + class_move_speed[idx] = i32; +} diff --git a/src/map/status.h b/src/map/status.h index ed22d4d..414ad7c 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -4,6 +4,8 @@ #ifndef EVOL_MAP_STATUS #define EVOL_MAP_STATUS +void status_init(void); void estatus_set_viewdata_post(struct block_list *bl, int *class_); +void estatus_read_job_db_sub(int *idxPtr, const char *name, config_setting_t *jdb); #endif // EVOL_MAP_STATUS |