summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-01-20 10:30:03 +0100
committerHaru <haru@dotalux.com>2020-02-09 23:46:56 +0100
commita67dddb0c21be9c6ceeb174db023d3b9db4a9db9 (patch)
tree670ad532f64967f2c6ace1ba678c4e6f57a4c1d2 /src/map/script.c
parent38a504a04a2c864938ef3e105d0ce22332ff0b7a (diff)
downloadhercules-a67dddb0c21be9c6ceeb174db023d3b9db4a9db9.tar.gz
hercules-a67dddb0c21be9c6ceeb174db023d3b9db4a9db9.tar.bz2
hercules-a67dddb0c21be9c6ceeb174db023d3b9db4a9db9.tar.xz
hercules-a67dddb0c21be9c6ceeb174db023d3b9db4a9db9.zip
Added a new option flag to itemskill() script command to be able to forcefully cast skill on on invoking character.
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/map/script.c b/src/map/script.c
index acf9fb9ff..b51c1a915 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -11003,7 +11003,7 @@ static BUILDIN(itemskill)
sd->skillitem=id;
sd->skillitemlv=lv;
- /// itemskill_conditions_checked/itemskill_no_conditions/itemskill_no_casttime abuse prevention.
+ /// itemskill_conditions_checked/itemskill_no_conditions/itemskill_no_casttime/itemskill_castonself abuse prevention.
/// Unset in unit_skilluse_id()/unit_skilluse_pos() if skill was not aborted while target selection.
sd->itemskill_id = id;
sd->itemskill_lv = lv;
@@ -11013,6 +11013,7 @@ static BUILDIN(itemskill)
sd->state.itemskill_conditions_checked = 0; /// Skill casting items will check the conditions prior to the target selection in AEGIS. Thus we need a flag to prevent checking them twice.
sd->state.itemskill_no_conditions = ((flag & ISF_IGNORECONDITIONS) == ISF_IGNORECONDITIONS) ? 1 : 0; /// Unset in unit_skilluse_id()/unit_skilluse_pos() if skill was not aborted while target selection.
sd->state.itemskill_no_casttime = ((flag & ISF_INSTANTCAST) == ISF_INSTANTCAST) ? 1 : 0; /// /// Unset in unit_skilluse_id()/unit_skilluse_pos() if skill was not aborted while target selection.
+ sd->state.itemskill_castonself = ((flag & ISF_CASTONSELF) == ISF_CASTONSELF) ? 1 : 0; /// Unset in unit_skilluse_id()/unit_skilluse_pos() if skill was not aborted while target selection.
if (sd->state.itemskill_no_conditions == 0) {
if (skill->check_condition_castbegin(sd, id, lv) == 0 || skill->check_condition_castend(sd, id, lv) == 0)
@@ -11021,7 +11022,7 @@ static BUILDIN(itemskill)
sd->state.itemskill_conditions_checked = 1; /// Unset in unit_skilluse_id()/unit_skilluse_pos() if skill was not aborted while target selection.
}
- clif->item_skill(sd,id,lv);
+ clif->item_skill(sd, id, lv);
return true;
}
/*==========================================