Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=244
I found some code in script.c that manually enumerates the block_list internals instead of doing a map_foreach(), in function *getmapmobs.
Further investigation reveals that a very similar command already exists.
QUOTE
*getmapmobs("<map name>")
This function will return the total count of monsters currently located on the specified map.
If the map name is given as "this", the map the invoking character is on will be used.
If the map is not found, or the invoker is not a character while the map is "this", it will return -1.
QUOTE
*mobcount("<map name>","<event label>")
This function will count all the monsters on the specified map that have a given event label and return the number or 0 if it can't find any.
However, apparently, if you pass this function an empty string for the event label, it should return the total count of normal permanently respawning monsters instead.
I doubt that the 'event label ==""' trick will work due to a strcmp() being used, but imo these two could be merged.
mobcount is there since r1.
getmapmobs was added in
r1182 as a part of a jAthena update.