frenzmu06 Posted May 27, 2012 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 326 Reputation: 47 Joined: 04/01/12 Last Seen: February 1, 2023 Share Posted May 27, 2012 (edited) Request: @mapmoblist/@ml shows the current monsters and monster counts in the map if given a map value it will show the given map's monsters while if not, it will show the monsters where you are on Ex: --------Monster List-------- Mapname: prt_fild03 >specified map name Monsters: Poring(1002)/20 >monster name(id)/count Fabre(1007)/50 MVP: >mvp if there is/are Ex 2: --------Monster List-------- Mapname: pay_dun04 Monsters: Dokebi(1110)/40 Nine Tail(1180)/30 Horong(1129)/30 Archer Skeleton(1277)/15 Am Mut(1301)/1 Skeleton General(1290)/1 Cat o' Nine Tails(1307)/1 Shining Plant(1083)/2 Red Plant(1078)/10 White Plant(1082)/6 MVP: Moonlight Flower(1150)/1 for those who will help. thanks Edited May 28, 2012 by frenzmu06 Quote Link to comment Share on other sites More sharing options...
FatalEror Posted May 27, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 67 Reputation: 23 Joined: 11/14/11 Last Seen: October 3, 2014 Share Posted May 27, 2012 (edited) ../src/map/atcommand.c put this above atcommand_basecommands function static int count_mob(struct block_list *bl, va_list ap) // [FE] { struct mob_data *md = (struct mob_data*)bl; short id = va_arg(ap, short); if (md->class_ == id) return 1; return 0; } ACMD_FUNC(mapmoblist) // [FE] { char temp[100]; bool mob_searched[MAX_MOB_DB]; bool mob_mvp[MAX_MOB_DB]; // Store mvp data.. 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) { // Player input map name, search mob list for that map mapindex = mapindex_name2id(message); if (!mapindex) { clif_displaymessage(fd, "Map not found"); return -1; } m = map_mapindex2mapid(mapindex); } else { // Player doesn't input map name, search mob list in player current map mapindex = sd->mapindex; m = sd->bl.m; } clif_displaymessage(fd, "--------Monster List--------"); sprintf(temp, "Mapname: %s", mapindex_id2name(mapindex)); clif_displaymessage(fd, temp); clif_displaymessage(fd, "Monsters: "); //Looping and search for mobs 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; // Already found, skip it if (mob_db(md->class_)->mexp) { mob_searched[md->class_] = true; mob_mvp[md->class_] = true; // Save id for later continue; // It's MVP! } mob_searched[md->class_] = true; count = map_foreachinmap(count_mob, m, BL_MOB, md->class_); sprintf(temp, " %s[%d] : %d", mob_db(md->class_)->jname, md->class_, count); clif_displaymessage(fd, temp); } mapit_free(it); clif_displaymessage(fd, "MVP: "); // Looping again and search for mvp, not sure if this is the best way.. for (i = 1000; i < MAX_MOB_DB; i++) { //First monster start at 1001 (Scorpion) if (mob_mvp[i] == true) { count = map_foreachinmap(count_mob, m, BL_MOB, i); sprintf(temp, " %s[%d] : %d", mob_db(i)->jname, i, count); clif_displaymessage(fd, temp); } } return 0; } below ACMD_DEF(set), ACMD_DEF(mapmoblist), ../conf/atcommand_athena.conf mapmoblist: ["ml"] ../conf/groups.conf commands: { ... mapmoblist: true ... } Edited May 29, 2012 by FatalEror 1 Quote Link to comment Share on other sites More sharing options...
Limestone Posted May 27, 2012 Group: Members Topic Count: 155 Topics Per Day: 0.03 Content Count: 647 Reputation: 16 Joined: 11/21/11 Last Seen: December 28, 2022 Share Posted May 27, 2012 wow! thanks Fatal.. i'll try this Quote Link to comment Share on other sites More sharing options...
frenzmu06 Posted May 29, 2012 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 326 Reputation: 47 Joined: 04/01/12 Last Seen: February 1, 2023 Author Share Posted May 29, 2012 (edited) @FatalEror thanks this is great , but there is one problem, it only works on the map where you are on (putting other map as parameter doesn't show the mobs on that specific map but still the mobs from where you are on) ex. you are at gl_knt then you type "@ml pay_dun04" - it is still showing the monster at gl_knt where it should make an output of pay_dun04 hope you can fix/add the map parameter thing, i know you can this code will be very useful for the community Edited May 29, 2012 by frenzmu06 Quote Link to comment Share on other sites More sharing options...
FatalEror Posted May 29, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 67 Reputation: 23 Joined: 11/14/11 Last Seen: October 3, 2014 Share Posted May 29, 2012 (edited) See post #2 Edited May 29, 2012 by FatalEror Quote Link to comment Share on other sites More sharing options...
frenzmu06 Posted May 29, 2012 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 326 Reputation: 47 Joined: 04/01/12 Last Seen: February 1, 2023 Author Share Posted May 29, 2012 (edited) should i remove these? static int count_mob(struct block_list *bl, va_list ap) // [FE] { struct mob_data *md = (struct mob_data*)bl; short id = va_arg(ap, short); if (md->class_ == id) return 1; return 0; } nvm allready workin tnx Edited May 29, 2012 by frenzmu06 Quote Link to comment Share on other sites More sharing options...
Limestone Posted June 29, 2012 Group: Members Topic Count: 155 Topics Per Day: 0.03 Content Count: 647 Reputation: 16 Joined: 11/21/11 Last Seen: December 28, 2022 Share Posted June 29, 2012 @frenzmu how did it worked? mine is not working. bump Quote Link to comment Share on other sites More sharing options...
frenzmu06 Posted June 30, 2012 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 326 Reputation: 47 Joined: 04/01/12 Last Seen: February 1, 2023 Author Share Posted June 30, 2012 just follow instruction on post #2 and all should be fine Quote Link to comment Share on other sites More sharing options...
frenzmu06 Posted March 31, 2013 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 326 Reputation: 47 Joined: 04/01/12 Last Seen: February 1, 2023 Author Share Posted March 31, 2013 can someone make this work on the latest revision, i cant seem to make it work on (always compile error) Quote Link to comment Share on other sites More sharing options...
icabit Posted April 1, 2013 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 353 Reputation: 70 Joined: 07/14/12 Last Seen: Wednesday at 07:23 PM Share Posted April 1, 2013 ../src/map/atcommand.c put this above atcommand_basecommands function static int count_mob(struct block_list *bl, va_list ap) // [FE] { struct mob_data *md = (struct mob_data*)bl; short id = va_arg(ap, short); if (md->class_ == id) return 1; return 0; } ACMD_FUNC(mapmoblist) // [FE] { char temp[100]; bool mob_searched[MAX_MOB_DB]; bool mob_mvp[MAX_MOB_DB]; // Store mvp data.. 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) { // Player input map name, search mob list for that map mapindex = mapindex_name2id(message); if (!mapindex) { clif_displaymessage(fd, "Map not found"); return -1; } m = map_mapindex2mapid(mapindex); } else { // Player doesn't input map name, search mob list in player current map mapindex = sd->mapindex; m = sd->bl.m; } clif_displaymessage(fd, "--------Monster List--------"); sprintf(temp, "Mapname: %s", mapindex_id2name(mapindex)); clif_displaymessage(fd, temp); clif_displaymessage(fd, "Monsters: "); //Looping and search for mobs 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; // Already found, skip it if (mob_db(md->class_)->mexp) { mob_searched[md->class_] = true; mob_mvp[md->class_] = true; // Save id for later continue; // It's MVP! } mob_searched[md->class_] = true; count = map_foreachinmap(count_mob, m, BL_MOB, md->class_); sprintf(temp, " %s[%d] : %d", mob_db(md->class_)->jname, md->class_, count); clif_displaymessage(fd, temp); } mapit_free(it); clif_displaymessage(fd, "MVP: "); // Looping again and search for mvp, not sure if this is the best way.. for (i = 1000; i < MAX_MOB_DB; i++) { //First monster start at 1001 (Scorpion) if (mob_mvp[i] == true) { count = map_foreachinmap(count_mob, m, BL_MOB, i); sprintf(temp, " %s[%d] : %d", mob_db(i)->jname, i, count); clif_displaymessage(fd, temp); } } return 0; } below ACMD_DEF(set), ACMD_DEF(mapmoblist), ../conf/atcommand_athena.conf mapmoblist: ["ml"] ../conf/groups.conf commands: { ... mapmoblist: true ... } works great thx for this Quote Link to comment Share on other sites More sharing options...
frenzmu06 Posted April 1, 2013 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 326 Reputation: 47 Joined: 04/01/12 Last Seen: February 1, 2023 Author Share Posted April 1, 2013 now works again for me, found the problem i think it was the comment inside the { ->//First monster start at 1001 (Scorpion) relocate it somewhere or remove it Quote Link to comment Share on other sites More sharing options...
Zezicla Posted April 30, 2013 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 121 Reputation: 1 Joined: 12/01/12 Last Seen: May 9, 2015 Share Posted April 30, 2013 can this be for normal players too ?? what to change ?? Quote Link to comment Share on other sites More sharing options...
frenzmu06 Posted May 10, 2013 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 326 Reputation: 47 Joined: 04/01/12 Last Seen: February 1, 2023 Author Share Posted May 10, 2013 yes, configure out it on groups.conf relocate this to your corresponding group level you want to use the command mapmoblist: true Quote Link to comment Share on other sites More sharing options...
Question
frenzmu06
Request: @mapmoblist/@ml
shows the current monsters and monster counts in the map
if given a map value it will show the given map's monsters
while if not, it will show the monsters where you are on
Ex:
--------Monster List--------
Mapname: prt_fild03 >specified map name
Monsters: Poring(1002)/20 >monster name(id)/count
Fabre(1007)/50
MVP: >mvp if there is/are
Ex 2:
--------Monster List--------
Mapname: pay_dun04
Monsters: Dokebi(1110)/40
Nine Tail(1180)/30
Horong(1129)/30
Archer Skeleton(1277)/15
Am Mut(1301)/1
Skeleton General(1290)/1
Cat o' Nine Tails(1307)/1
Shining Plant(1083)/2
Red Plant(1078)/10
White Plant(1082)/6
MVP: Moonlight Flower(1150)/1
for those who will help. thanks
Edited by frenzmu06Link to comment
Share on other sites
12 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.