viewing paste useskill | C

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -15396,6 +15396,33 @@
    return 0;
 }
 
+BUILDIN_FUNC(useskill){
+   TBL_PC* sd = script_rid2sd(st);
+   TBL_PC* pl_sd;
+   int skillid = script_getnum(st,2);
+   int skilllv = script_getnum(st,3);
+
+   nullpo_ret(sd);
+
+   if(script_hasdata(st,4)){
+       pl_sd = script_isint(st,4)?map_id2sd(script_getnum(st,4)):map_nick2sd(script_getstr(st,4));
+   }
+   else pl_sd = sd;
+
+   if (skillnum >= HM_SKILLBASE && skillnum < HM_SKILLBASE+MAX_HOMUNSKILL
+       && sd->hd && merc_is_hom_active(sd->hd))
+       bl = &sd->hd->bl;
+   else
+       bl = &sd->bl;
+
+   if (skill_get_inf(skillnum)&INF_GROUND_SKILL)
+       unit_skilluse_pos(bl, pl_sd->bl.x, pl_sd->bl.y, skillnum, skilllv);
+   else
+       unit_skilluse_id(bl, pl_sd->bl.id, skillnum, skilllv);
+
+   return 0;
+}
+
Viewed 1348 times, submitted by lighta.