Jump to content
  • 0

Help Me Debug


nasagnilac

Question


  • Group:  Members
  • Topic Count:  89
  • Topics Per Day:  0.02
  • Content Count:  232
  • Reputation:   15
  • Joined:  11/02/13
  • Last Seen:  

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

  • 0

  • Group:  Members
  • Topic Count:  89
  • Topics Per Day:  0.02
  • Content Count:  232
  • Reputation:   15
  • Joined:  11/02/13
  • Last Seen:  

Closed

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...