I want to create a script command that will show monster in the map of players but I am having a problem if I am doing it right. anyone can help me continue this?
int crate_loc(block_list * bl, va_list ap)
{
struct map_session_data *sd = (struct map_session_data *)bl;
struct mob_data *md;
nullpo_ret(bl);
nullpo_ret(md = (struct mob_data *)bl);
int npc_id, type, x, y, id, color, mob_id;
npc_id = va_arg(ap, int);
mob_id = va_arg(ap, int);
type = va_arg(ap, int);
color = va_arg(ap, int);
if (mob_id == 0 || md->bl.type != BL_MOB || md->mob_id != mob_id)
return 0;
x = md->bl.x;
y = md->bl.y;
id = md->bl.id;
clif_viewpoint(sd, npc_id, type, x, y, id, color);
return 0;
}
BUILDIN_FUNC(crate_reveal)
{
struct map_session_data *sd;
struct block_list *bl;
int mob_id = script_getnum(st, 2),
flag = script_getnum(st, 3),
color = script_getnum(st, 4);
sd = (TBL_PC *)bl;
map_foreachinmap(crate_loc, sd->bl.m, BL_MOB, st->oid, mob_id, flag, color);
return 0;
}
Question
nasagnilac
crate_reveal <mobid>,<flag>,<color>
I want to create a script command that will show monster in the map of players but I am having a problem if I am doing it right. anyone can help me continue this?
int crate_loc(block_list * bl, va_list ap) { struct map_session_data *sd = (struct map_session_data *)bl; struct mob_data *md; nullpo_ret(bl); nullpo_ret(md = (struct mob_data *)bl); int npc_id, type, x, y, id, color, mob_id; npc_id = va_arg(ap, int); mob_id = va_arg(ap, int); type = va_arg(ap, int); color = va_arg(ap, int); if (mob_id == 0 || md->bl.type != BL_MOB || md->mob_id != mob_id) return 0; x = md->bl.x; y = md->bl.y; id = md->bl.id; clif_viewpoint(sd, npc_id, type, x, y, id, color); return 0; } BUILDIN_FUNC(crate_reveal) { struct map_session_data *sd; struct block_list *bl; int mob_id = script_getnum(st, 2), flag = script_getnum(st, 3), color = script_getnum(st, 4); sd = (TBL_PC *)bl; map_foreachinmap(crate_loc, sd->bl.m, BL_MOB, st->oid, mob_id, flag, color); return 0; }
Link to comment
Share on other sites
1 answer to this question
Recommended Posts