summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-05-02 21:51:13 -0300
committershennetsind <ind@henn.et>2013-05-02 21:51:13 -0300
commitc6f8d9ed12d930a63f5c82370962ac94cd70b13c (patch)
treed961fff9faf1770fd30d697000a1a76b3c09b83b /src/map/script.c
parent64adafab4a56d97f547a5daf0f9feda3f9a12032 (diff)
downloadhercules-c6f8d9ed12d930a63f5c82370962ac94cd70b13c.tar.gz
hercules-c6f8d9ed12d930a63f5c82370962ac94cd70b13c.tar.bz2
hercules-c6f8d9ed12d930a63f5c82370962ac94cd70b13c.tar.xz
hercules-c6f8d9ed12d930a63f5c82370962ac94cd70b13c.zip
Fixed Bug #7210
itemskill now checks for skill conditions unless a 3rd param is present. http://hercules.ws/board/tracker/issue-7210-itemskill-command-does-not-check-for-required-items/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c14
1 files changed, 9 insertions, 5 deletions
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???"),