diff options
-rw-r--r-- | doc/script_commands.txt | 9 | ||||
-rw-r--r-- | src/map/script.c | 14 |
2 files changed, 14 insertions, 9 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt index aa3112d62..768813a6f 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -4454,13 +4454,14 @@ except for those have been set with 'disable_items'. --------------------------------------- -*itemskill <skill id>,<skill level>; -*itemskill "<skill name>",<skill level>; +*itemskill <skill id>,<skill level>,{flag}; +*itemskill "<skill name>",<skill level>,{flag}; This command meant for item scripts to replicate single-use skills in usable -items. It will not work properly, if there is a visible dialog window or menu. -If the skill is self or auto-targeting, it will be used immediately otherwise a +items. It will not work properly if there is a visible dialog window or menu. +If the skill is self or auto-targeting it will be used immediately otherwise a target cursor is shown. +Flag is a optional param and when present the command will not check for skill requirements // When Anodyne is used, it will cast Endure (8), Level 1, as if the actual // skill has been used from skill tree. diff --git a/src/map/script.c b/src/map/script.c index 3b1533f74..250ffeb93 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -8245,10 +8245,9 @@ BUILDIN(guildopenstorage) /*========================================== * Make player use a skill trought item usage *------------------------------------------*/ -/// itemskill <skill id>,<level> -/// itemskill "<skill name>",<level> -BUILDIN(itemskill) -{ +/// itemskill <skill id>,<level>{,flag +/// itemskill "<skill name>",<level>{,flag +BUILDIN(itemskill) { int id; int lv; TBL_PC* sd; @@ -8260,6 +8259,11 @@ BUILDIN(itemskill) id = ( script_isstring(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) ); lv = script_getnum(st,3); + if( !script_hasdata(st, 4) ) { + if( !skill->check_condition_castbegin(sd,id,lv) ) + return true; + } + sd->skillitem=id; sd->skillitemlv=lv; clif->item_skill(sd,id,lv); @@ -17155,7 +17159,7 @@ void script_parse_builtin(void) { BUILDIN_DEF(gettimestr,"si"), BUILDIN_DEF(openstorage,""), BUILDIN_DEF(guildopenstorage,""), - BUILDIN_DEF(itemskill,"vi"), + BUILDIN_DEF(itemskill,"vi?"), BUILDIN_DEF(produce,"i"), BUILDIN_DEF(cooking,"i"), BUILDIN_DEF(monster,"siisii???"), |