git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6772 54d463be-8e91-2dee-dedb-b68131a5f0ec

This commit is contained in:
Lance 2006-05-26 10:11:08 +00:00
parent b2b5a789a3
commit dffe836f3b

View File

@ -10545,88 +10545,89 @@ int buildin_getmobdata(struct script_state *st) {
} }
int buildin_setmobdata(struct script_state *st){ int buildin_setmobdata(struct script_state *st){
int id, value; int id, value, value2;
struct mob_data *md = NULL; struct mob_data *md = NULL;
id = conv_num(st, & (st->stack->stack_data[st->start+2])); id = conv_num(st, & (st->stack->stack_data[st->start+2]));
value = conv_num(st, & (st->stack->stack_data[st->start+3])); value = conv_num(st, & (st->stack->stack_data[st->start+3]));
if(!(md = (struct mob_data *)map_id2bl(id)) || st->stack->stack_data[st->start+3].type!=C_NAME ){ value2 = conv_num(st, & (st->stack->stack_data[st->start+4]));
if(!(md = (struct mob_data *)map_id2bl(id))){
ShowWarning("buildin_setmobdata: Error in argument!\n"); ShowWarning("buildin_setmobdata: Error in argument!\n");
} else { } else {
switch(id){ switch(value){
case 0: case 0:
md->class_ = (short)value; md->class_ = (short)value2;
break; break;
case 1: case 1:
md->level = (unsigned short)value; md->level = (unsigned short)value2;
break; break;
case 2: case 2:
md->hp = value; md->hp = value2;
break; break;
case 3: case 3:
md->max_hp = value; md->max_hp = value2;
break; break;
case 4: case 4:
md->master_id = value; md->master_id = value2;
break; break;
case 5: case 5:
md->bl.m = (short)value; md->bl.m = (short)value2;
break; break;
case 6: case 6:
md->bl.x = (short)value; md->bl.x = (short)value2;
break; break;
case 7: case 7:
md->bl.y = (short)value; md->bl.y = (short)value2;
break; break;
case 8: case 8:
md->speed = (short)value; md->speed = (short)value2;
break; break;
case 9: case 9:
md->mode = (short)value; md->mode = (short)value2;
break; break;
case 10: case 10:
md->special_state.ai = (unsigned int)value; md->special_state.ai = (unsigned int)value2;
break; break;
case 11: case 11:
md->db->option = (short)value; md->db->option = (short)value2;
break; break;
case 12: case 12:
md->vd->sex = value; md->vd->sex = value2;
break; break;
case 13: case 13:
md->vd->class_ = value; md->vd->class_ = value2;
break; break;
case 14: case 14:
md->vd->hair_style = (short)value; md->vd->hair_style = (short)value2;
break; break;
case 15: case 15:
md->vd->hair_color = (short)value; md->vd->hair_color = (short)value2;
break; break;
case 16: case 16:
md->vd->head_bottom = (short)value; md->vd->head_bottom = (short)value2;
break; break;
case 17: case 17:
md->vd->head_mid = (short)value; md->vd->head_mid = (short)value2;
break; break;
case 18: case 18:
md->vd->head_top = (short)value; md->vd->head_top = (short)value2;
break; break;
case 19: case 19:
md->vd->cloth_color = (short)value; md->vd->cloth_color = (short)value2;
break; break;
case 20: case 20:
md->vd->shield = value; md->vd->shield = value2;
break; break;
case 21: case 21:
md->vd->weapon = (short)value; md->vd->weapon = (short)value2;
break; break;
case 22: case 22:
md->vd->shield = (short)value; md->vd->shield = (short)value2;
break; break;
case 23: case 23:
md->ud.dir = (unsigned char)value; md->ud.dir = (unsigned char)value2;
break; break;
case 24: case 24:
md->state.killer = value>0?1:0; md->state.killer = value2>0?1:0;
break; break;
default: default:
ShowError("buildin_setmobdata: argument id is not identified."); ShowError("buildin_setmobdata: argument id is not identified.");