diff options
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/src/map/script.c b/src/map/script.c index 75ed89db6..d6d5e7123 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -10514,37 +10514,38 @@ int buildin_getmobdata(struct script_state *st) { int num, id;
char *name;
struct mob_data *md = NULL;
+ struct map_session_data *sd = st->rid?map_id2sd(st->rid):NULL;
id = conv_num(st, & (st->stack->stack_data[st->start+2]));
if(!(md = (struct mob_data *)map_id2bl(id)) || st->stack->stack_data[st->start+3].type!=C_NAME ){
ShowWarning("buildin_getmobdata: Error in argument!\n");
} else {
num=st->stack->stack_data[st->start+3].u.num;
name=(char *)(str_buf+str_data[num&0x00ffffff].str);
- setd_sub(st,map_id2sd(st->rid),name,0,(void *)(int)md->class_,NULL);
- setd_sub(st,map_id2sd(st->rid),name,1,(void *)(int)md->level,NULL);
- setd_sub(st,map_id2sd(st->rid),name,2,(void *)(int)md->hp,NULL);
- setd_sub(st,map_id2sd(st->rid),name,3,(void *)(int)md->max_hp,NULL);
- setd_sub(st,map_id2sd(st->rid),name,4,(void *)(int)md->master_id,NULL);
- setd_sub(st,map_id2sd(st->rid),name,5,(void *)(int)md->bl.m,NULL);
- setd_sub(st,map_id2sd(st->rid),name,6,(void *)(int)md->bl.x,NULL);
- setd_sub(st,map_id2sd(st->rid),name,7,(void *)(int)md->bl.y,NULL);
- setd_sub(st,map_id2sd(st->rid),name,8,(void *)(int)md->speed,NULL);
- setd_sub(st,map_id2sd(st->rid),name,9,(void *)(int)md->mode,NULL);
- setd_sub(st,map_id2sd(st->rid),name,10,(void *)(int)md->special_state.ai,NULL);
- setd_sub(st,map_id2sd(st->rid),name,11,(void *)(int)md->db->option,NULL);
- setd_sub(st,map_id2sd(st->rid),name,12,(void *)(int)md->vd->sex,NULL);
- setd_sub(st,map_id2sd(st->rid),name,13,(void *)(int)md->vd->class_,NULL);
- setd_sub(st,map_id2sd(st->rid),name,14,(void *)(int)md->vd->hair_style,NULL);
- setd_sub(st,map_id2sd(st->rid),name,15,(void *)(int)md->vd->hair_color,NULL);
- setd_sub(st,map_id2sd(st->rid),name,16,(void *)(int)md->vd->head_bottom,NULL);
- setd_sub(st,map_id2sd(st->rid),name,17,(void *)(int)md->vd->head_mid,NULL);
- setd_sub(st,map_id2sd(st->rid),name,18,(void *)(int)md->vd->head_top,NULL);
- setd_sub(st,map_id2sd(st->rid),name,19,(void *)(int)md->vd->cloth_color,NULL);
- setd_sub(st,map_id2sd(st->rid),name,20,(void *)(int)md->vd->shield,NULL);
- setd_sub(st,map_id2sd(st->rid),name,21,(void *)(int)md->vd->weapon,NULL);
- setd_sub(st,map_id2sd(st->rid),name,22,(void *)(int)md->vd->shield,NULL);
- setd_sub(st,map_id2sd(st->rid),name,23,(void *)(int)md->ud.dir,NULL);
- setd_sub(st,map_id2sd(st->rid),name,24,(void *)(int)md->state.killer,NULL);
+ setd_sub(st,sd,name,0,(void *)(int)md->class_,NULL);
+ setd_sub(st,sd,name,1,(void *)(int)md->level,NULL);
+ setd_sub(st,sd,name,2,(void *)(int)md->hp,NULL);
+ setd_sub(st,sd,name,3,(void *)(int)md->max_hp,NULL);
+ setd_sub(st,sd,name,4,(void *)(int)md->master_id,NULL);
+ setd_sub(st,sd,name,5,(void *)(int)md->bl.m,NULL);
+ setd_sub(st,sd,name,6,(void *)(int)md->bl.x,NULL);
+ setd_sub(st,sd,name,7,(void *)(int)md->bl.y,NULL);
+ setd_sub(st,sd,name,8,(void *)(int)md->speed,NULL);
+ setd_sub(st,sd,name,9,(void *)(int)(md->mode?md->mode:md->db->mode),NULL);
+ setd_sub(st,sd,name,10,(void *)(int)md->special_state.ai,NULL);
+ setd_sub(st,sd,name,11,(void *)(int)md->db->option,NULL);
+ setd_sub(st,sd,name,12,(void *)(int)md->vd->sex,NULL);
+ setd_sub(st,sd,name,13,(void *)(int)md->vd->class_,NULL);
+ setd_sub(st,sd,name,14,(void *)(int)md->vd->hair_style,NULL);
+ setd_sub(st,sd,name,15,(void *)(int)md->vd->hair_color,NULL);
+ setd_sub(st,sd,name,16,(void *)(int)md->vd->head_bottom,NULL);
+ setd_sub(st,sd,name,17,(void *)(int)md->vd->head_mid,NULL);
+ setd_sub(st,sd,name,18,(void *)(int)md->vd->head_top,NULL);
+ setd_sub(st,sd,name,19,(void *)(int)md->vd->cloth_color,NULL);
+ setd_sub(st,sd,name,20,(void *)(int)md->vd->shield,NULL);
+ setd_sub(st,sd,name,21,(void *)(int)md->vd->weapon,NULL);
+ setd_sub(st,sd,name,22,(void *)(int)md->vd->shield,NULL);
+ setd_sub(st,sd,name,23,(void *)(int)md->ud.dir,NULL);
+ setd_sub(st,sd,name,24,(void *)(int)md->state.killer,NULL);
}
return 0;
}
|