summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-20 20:01:07 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-20 20:01:07 +0000
commitd0f2d77ed059c68c4b6e6ad599c7e6960fdd269e (patch)
treefa6392e2bede434754e68a5d93295ad4bc7c239a /src/map/atcommand.c
parent065abbacf70dbc690e76beecc88bdf3faf95d891 (diff)
downloadhercules-d0f2d77ed059c68c4b6e6ad599c7e6960fdd269e.tar.gz
hercules-d0f2d77ed059c68c4b6e6ad599c7e6960fdd269e.tar.bz2
hercules-d0f2d77ed059c68c4b6e6ad599c7e6960fdd269e.tar.xz
hercules-d0f2d77ed059c68c4b6e6ad599c7e6960fdd269e.zip
- @useskill will now cause your homun to use the skill instead of you if the skill is a Homun skill and you have an active homunculus.
- Some cleanups... git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8383 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 00d051284..31e68c224 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -7547,6 +7547,7 @@ atcommand_useskill(const int fd, struct map_session_data* sd,
const char* command, const char* message)
{
struct map_session_data *pl_sd = NULL;
+ struct block_list *bl;
int skillnum;
int skilllv;
char target[255];
@@ -7562,10 +7563,16 @@ atcommand_useskill(const int fd, struct map_session_data* sd,
return -1;
}
+ if (skillnum >= HM_SKILLBASE && skillnum < HM_SKILLBASE+MAX_HOMUNSKILL
+ && sd->hd && merc_is_hom_active(sd->hd)) // (If used with @useskill, put the homunc as dest)
+ bl = &sd->hd->bl;
+ else
+ bl = &sd->bl;
+
if (skill_get_inf(skillnum)&INF_GROUND_SKILL)
- unit_skilluse_pos(&sd->bl, pl_sd->bl.x, pl_sd->bl.y, skillnum, skilllv);
+ unit_skilluse_pos(bl, pl_sd->bl.x, pl_sd->bl.y, skillnum, skilllv);
else
- unit_skilluse_id(&sd->bl, pl_sd->bl.id, skillnum, skilllv);
+ unit_skilluse_id(bl, pl_sd->bl.id, skillnum, skilllv);
return 0;
}