summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-26 18:54:07 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-26 18:54:07 +0000
commit2e35eff8bfe55314e30aaa2b88bd0bf1e7bd7647 (patch)
tree53fbb31579d6e7c4f9572090379dd0ac36c53000 /src/map/script.c
parent894951cb5bb625050cc6da1ce409aed575f034f0 (diff)
downloadhercules-2e35eff8bfe55314e30aaa2b88bd0bf1e7bd7647.tar.gz
hercules-2e35eff8bfe55314e30aaa2b88bd0bf1e7bd7647.tar.bz2
hercules-2e35eff8bfe55314e30aaa2b88bd0bf1e7bd7647.tar.xz
hercules-2e35eff8bfe55314e30aaa2b88bd0bf1e7bd7647.zip
* Patches to allow everything to work right. + 1 more sample script.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6779 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c51
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;
}