diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-08-07 21:57:49 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-08-10 23:06:08 +0300 |
commit | 2f488d98cacccc17d1702230488e15f7f9bc25e7 (patch) | |
tree | 0acf0239078b8bf1ce35dc4929ce8435f37be546 /src/map/script.c | |
parent | c0367b69fd226be21643cd4b620fff2aadb0e742 (diff) | |
download | hercules-2f488d98cacccc17d1702230488e15f7f9bc25e7.tar.gz hercules-2f488d98cacccc17d1702230488e15f7f9bc25e7.tar.bz2 hercules-2f488d98cacccc17d1702230488e15f7f9bc25e7.tar.xz hercules-2f488d98cacccc17d1702230488e15f7f9bc25e7.zip |
Move equip item script function call into function script_run_item_equip_script.
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c index 1290d96e1..190a942fb 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -19850,6 +19850,22 @@ void script_run_use_script(struct map_session_data *sd, struct item_data *data, script->current_item_id = 0; } +void script_run_item_equip_script(struct map_session_data *sd, struct item_data *data, int oid) __attribute__((nonnull (1, 2))); + +/** + * Run item equip script for item. + * + * @param sd player session data. Must be correct and checked before. + * @param data equipped item data. Must be correct and checked before. + * @param oid npc id. Can be also 0 or fake npc id. + */ +void script_run_item_equip_script(struct map_session_data *sd, struct item_data *data, int oid) +{ + script->current_item_id = data->nameid; + script->run(data->equip_script, 0, sd->bl.id, oid); + script->current_item_id = 0; +} + #define BUILDIN_DEF(x,args) { buildin_ ## x , #x , args, false } #define BUILDIN_DEF2(x,x2,args) { buildin_ ## x , x2 , args, false } #define BUILDIN_DEF_DEPRECATED(x,args) { buildin_ ## x , #x , args, true } @@ -20796,4 +20812,5 @@ void script_defaults(void) { script->parser_clean_leftovers = script_parser_clean_leftovers; script->run_use_script = script_run_use_script; + script->run_item_equip_script = script_run_item_equip_script; } |