public int countMonster (int map) {
return c.getChannelServer().getMapFactory().getMap(map).countMonster(map);
}
will not work. That will attempt to count the number of monsters with the id 'map', which is a map ID, not a mob ID.
public int getMonsterCount(int map) { //...