diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-04-16 12:40:08 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-04-16 12:42:54 +0300 |
commit | 33b41fe00a47510ed6b84e04fc9e9a222b053130 (patch) | |
tree | 24c58e9efef5d75ff5ec5aabfb1bad9d30b1bd85 | |
parent | 6ecadc26c798322d8a88b9fb2d4a93349bc19d07 (diff) | |
download | evol-hercules-33b41fe00a47510ed6b84e04fc9e9a222b053130.tar.gz evol-hercules-33b41fe00a47510ed6b84e04fc9e9a222b053130.tar.bz2 evol-hercules-33b41fe00a47510ed6b84e04fc9e9a222b053130.tar.xz evol-hercules-33b41fe00a47510ed6b84e04fc9e9a222b053130.zip |
Apply WalkSpeed attribute from job_db.conf.
-rw-r--r-- | src/map/init.c | 2 | ||||
-rw-r--r-- | src/map/pc.c | 16 | ||||
-rw-r--r-- | src/map/pc.h | 4 | ||||
-rw-r--r-- | src/map/status.c | 16 | ||||
-rw-r--r-- | src/map/status.h | 1 |
5 files changed, 39 insertions, 0 deletions
diff --git a/src/map/init.c b/src/map/init.c index 572b5e8..7eb1035 100644 --- a/src/map/init.c +++ b/src/map/init.c @@ -156,6 +156,7 @@ HPExport void plugin_init (void) 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("status->calc_pc_", estatus_calc_pc_); addHookPost("clif->set_unit_walking", eclif_set_unit_walking); addHookPost("clif->move", eclif_move); addHookPost("map->addflooritem", emap_addflooritem_post); @@ -165,6 +166,7 @@ HPExport void plugin_init (void) addHookPost("pc->useitem", epc_useitem_post); addHookPost("pc->equipitem", epc_equipitem_post); addHookPost("pc->unequipitem", epc_unequipitem_post); + addHookPost("pc->setnewpc", epc_setnewpc); langScriptId = script->add_str("Lang"); } diff --git a/src/map/pc.c b/src/map/pc.c index 2bc8d79..c24c758 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -291,3 +291,19 @@ int epc_check_job_name(const char *name) hookStop(); return -1; } + +int epc_setnewpc(int retVal, struct map_session_data *sd, + int *account_id __attribute__ ((unused)), + int *char_id __attribute__ ((unused)), + int *login_id1 __attribute__ ((unused)), + unsigned int *client_tick __attribute__ ((unused)), + int *sex __attribute__ ((unused)), + int *fd __attribute__ ((unused))) +{ + if (sd) + { + sd->battle_status.speed = 150; + sd->base_status.speed = 150; + } + return retVal; +} diff --git a/src/map/pc.h b/src/map/pc.h index 459d836..e850b81 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -35,4 +35,8 @@ int epc_unequipitem_post(int retVal, struct map_session_data *sd, int epc_check_job_name(const char *name); +int epc_setnewpc(int retVal, struct map_session_data *sd, + int *account_id, int *char_id, int *login_id1, + unsigned int *client_tick, int *sex, int *fd); + #endif // EVOL_MAP_PC diff --git a/src/map/status.c b/src/map/status.c index 2961646..916ee78 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -13,6 +13,7 @@ #include "../../../map/itemdb.h" #include "../../../map/map.h" #include "../../../map/npc.h" +#include "../../../map/pc.h" #include "../../../map/status.h" #include "map/data/npcd.h" @@ -52,3 +53,18 @@ void estatus_read_job_db_sub(int *idxPtr, if (itemdb->lookup_const(jdb, "MoveSpeed", &i32)) class_move_speed[idx] = i32; } + +int estatus_calc_pc_(int retVal, + struct map_session_data *sd, + enum e_status_calc_opt *opt __attribute__ ((unused))) +{ + if (!sd) + return retVal; + + if (!sd->state.permanent_speed) + { + const int idx = pc->class2idx(sd->status.class_); + sd->base_status.speed = class_move_speed[idx]; + } + return retVal; +} diff --git a/src/map/status.h b/src/map/status.h index 414ad7c..fb0198b 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -7,5 +7,6 @@ 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); +int estatus_calc_pc_(int retVal, struct map_session_data* sd, enum e_status_calc_opt *opt); #endif // EVOL_MAP_STATUS |