Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int count_mob(struct block_list *bl, va_list ap)
- {
- struct mob_data *md = (struct mob_data*)bl;
- short id = va_arg(ap, short);
- if (md->class_ == id)
- return 1;
- return 0;
- }
- ACMD(mapmoblist)
- {
- char temp[100];
- bool mob_searched[MAX_MOB_DB];
- bool mob_mvp[MAX_MOB_DB];
- struct s_mapiterator* it;
- unsigned short count = 0, i, mapindex = 0;
- int m = 0;
- memset(mob_searched, 0, MAX_MOB_DB);
- memset(mob_mvp, 0, MAX_MOB_DB);
- // if (message && *message) {
- //mapindex = mapindex_name2id(message);
- //if (!mapindex) {
- // clif->message(fd, "Map not found");
- // return -1;
- //}
- // m = iMap->mapindex2mapid(mapindex);
- //} else {
- mapindex = sd->mapindex;
- m = sd->bl.m;
- //}
- clif->message(fd, "--------Monster Liste--------");
- sprintf(temp, "Mapname: %s", mapindex_id2name(mapindex));
- clif->message(fd, temp);
- clif->message(fd, "Monsters: ");
- it = mapit_geteachmob();
- while (true) {
- TBL_MOB* md = (TBL_MOB*)mapit->next(it);
- if (md == NULL)
- break;
- if (md->bl.m != m || md->status.hp <= 0)
- continue;
- if (mob_searched[md->class_] == true)
- continue;
- if (mob_db(md->class_)->mexp) {
- mob_searched[md->class_] = true;
- mob_mvp[md->class_] = true;
- continue;
- }
- mob_searched[md->class_] = true;
- count = iMap->foreachinmap(count_mob, m, BL_MOB, md->class_);
- sprintf(temp, " %s : %d", mob_db(md->class_)->jname , count);
- //[%d]
- clif->message(fd, temp);
- }
- mapit->free(it);
- clif->message(fd, "--------MVP Liste--------: ");
- for (i = 1000; i < MAX_MOB_DB; i++) {
- if (mob_mvp[i] == true) {
- count = iMap->foreachinmap(count_mob, m, BL_MOB, i);
- sprintf(temp, " %s[%d] : %d", mob_db(i)->jname, i, count);
- clif->message(fd, temp);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement