summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-08-07 18:49:31 -0300
committershennetsind <ind@henn.et>2013-08-07 18:49:31 -0300
commita702c55f219519c1d9410f823bd7a9e4c6be256b (patch)
treebd2bff4ce29206e7d71b72b352538351d0caf1ed
parent4fee6cb386a90f24306e54ea3606fa7fa133b8e3 (diff)
downloadhercules-a702c55f219519c1d9410f823bd7a9e4c6be256b.tar.gz
hercules-a702c55f219519c1d9410f823bd7a9e4c6be256b.tar.bz2
hercules-a702c55f219519c1d9410f823bd7a9e4c6be256b.tar.xz
hercules-a702c55f219519c1d9410f823bd7a9e4c6be256b.zip
Fixed Bug #7633
unitskillusepos/unitskilluseid script commands werent functioning because the npc's status weren't properly measured. Special Thanks to purityz http://hercules.ws/board/tracker/issue-7633-unitskillusepos-unitskilluseid/ Signed-off-by: shennetsind <ind@henn.et>
-rw-r--r--src/map/script.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 4385ef07d..04ed0ccce 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -15092,8 +15092,17 @@ BUILDIN(unitskilluseid)
target_id = ( script_hasdata(st,5) ? script_getnum(st,5) : unit_id );
bl = iMap->id2bl(unit_id);
- if( bl != NULL )
+
+ if( bl != NULL ) {
+ if( bl->type == BL_NPC ) {
+ if (!((TBL_NPC*)bl)->status.hp) {
+ status_calc_npc(((TBL_NPC*)bl), true);
+ } else {
+ status_calc_npc(((TBL_NPC*)bl), false);
+ }
+ }
unit_skilluse_id(bl, target_id, skill_id, skill_lv);
+ }
return true;
}
@@ -15118,8 +15127,17 @@ BUILDIN(unitskillusepos)
skill_y = script_getnum(st,6);
bl = iMap->id2bl(unit_id);
- if( bl != NULL )
+
+ if( bl != NULL ) {
+ if( bl->type == BL_NPC ) {
+ if (!((TBL_NPC*)bl)->status.hp) {
+ status_calc_npc(((TBL_NPC*)bl), true);
+ } else {
+ status_calc_npc(((TBL_NPC*)bl), false);
+ }
+ }
unit_skilluse_pos(bl, skill_x, skill_y, skill_id, skill_lv);
+ }
return true;
}