summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-18 02:54:17 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-18 02:54:17 +0000
commitdeaa0330b9368e716464e248019daf3213700ac0 (patch)
tree47c1c1f9a8fa8a5088e6b88b62ffcdb80975b357 /src
parent4b9deaad37eb140bc7e55b1caf82e4512f476075 (diff)
downloadhercules-deaa0330b9368e716464e248019daf3213700ac0.tar.gz
hercules-deaa0330b9368e716464e248019daf3213700ac0.tar.bz2
hercules-deaa0330b9368e716464e248019daf3213700ac0.tar.xz
hercules-deaa0330b9368e716464e248019daf3213700ac0.zip
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7234 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/map/script.c b/src/map/script.c
index c8fd85bb8..119ea5097 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -10706,28 +10706,30 @@ int buildin_unitwarp(struct script_state *st){
}
int buildin_unitattack(struct script_state *st) {
- int id = 0;
+ int id = 0, actiontype = 0;
char *target = NULL;
- struct mob_data *md = NULL;
struct map_session_data *sd = NULL;
struct block_list *bl = NULL, *tbl = NULL;
id = conv_num(st, & (st->stack->stack_data[st->start+2]));
- if(st->end > st->start + 3)
- target = conv_str(st, & (st->stack->stack_data[st->start+3]));
+ target = conv_str(st, & (st->stack->stack_data[st->start+3]));
+ if(st->end > st->start + 4)
+ actiontype = conv_num(st, & (st->stack->stack_data[st->start+4]));
- if(target){
- sd = map_nick2sd(target);
- if(!sd)
- tbl = map_id2bl(atoi(target));
- else
- tbl = &sd->bl;
- }
+ sd = map_nick2sd(target);
+ if(!sd)
+ tbl = map_id2bl(atoi(target));
+ else
+ tbl = &sd->bl;
- if(tbl && (bl = map_id2bl(id))){
+ if((bl = map_id2bl(id))){
if (bl->type == BL_MOB) {
- md->state.killer = 1;
- md->target_id = bl->id;
+ ((TBL_MOB *)bl)->state.killer = 1;
+ ((TBL_MOB *)bl)->target_id = tbl->id;
+ } else if(bl->type == BL_PC){
+ clif_parse_ActionRequest_sub(((TBL_PC *)bl), actiontype > 0?0x07:0x00, tbl->id, gettick());
+ push_val(st->stack,C_INT,1);
+ return 0;
}
push_val(st->stack,C_INT,unit_walktobl(bl, tbl, 65025, 2));
} else {