cahadeyelo Posted April 25 Group: Members Topic Count: 69 Topics Per Day: 0.02 Content Count: 170 Reputation: 1 Joined: 11/13/14 Last Seen: July 9 Share Posted April 25 Hi rAthena, Is it possible that instead of event label, the script will read the mob_id on a given map. If yes, can i see what's codes do need to add on my script.cpp. Quote Link to comment Share on other sites More sharing options...
0 Rynbef Posted April 25 Group: Forum Moderator Topic Count: 44 Topics Per Day: 0.01 Content Count: 898 Reputation: 121 Joined: 05/23/12 Last Seen: May 2 Share Posted April 25 Take a look at the Convex Mirror Or u can use *mobcount("map",1002) The question does not rly match with ur topic title Rynbef~ Quote Link to comment Share on other sites More sharing options...
0 cahadeyelo Posted April 26 Group: Members Topic Count: 69 Topics Per Day: 0.02 Content Count: 170 Reputation: 1 Joined: 11/13/14 Last Seen: July 9 Author Share Posted April 26 BUILDIN_FUNC(mobcount) { const char *mapname,*event; int16 m; mapname=script_getstr(st,2); event=script_getstr(st,3); if( strcmp(event, "all") == 0 ) event = NULL; else check_event(st, event); if( strcmp(mapname, "this") == 0 ) { struct map_session_data *sd; if( script_rid2sd(sd) ) m = sd->bl.m; else { script_pushint(st,-1); return SCRIPT_CMD_SUCCESS; } } else if( (m = map_mapname2mapid(mapname)) < 0 ) { script_pushint(st,-1); return SCRIPT_CMD_SUCCESS; } script_pushint(st,map_foreachinmap(buildin_mobcount_sub, m, BL_MOB, event)); return SCRIPT_CMD_SUCCESS; } what codes do i need to replace so that the mobcount script will read the mob_id instead of event label? Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted May 2 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10015 Reputation: 2355 Joined: 10/28/11 Last Seen: Tuesday at 11:50 AM Share Posted May 2 what you need is rewrite the static int buildin_mobcount_sub(struct block_list *bl,va_list ap) into static int buildin_mobcount_by_id_sub(struct block_list *bl,va_list ap) // Added by RoVeRT { unsigned int id = va_arg(ap,unsigned int); struct mob_data *md = ((struct mob_data *)bl); if (md->status.hp > 0 && md->status.class_ == id) return 1; return SCRIPT_CMD_SUCCESS; } script_pushint(st,map_foreachinmap(buildin_mobcount_by_id_sub, id)); Quote Link to comment Share on other sites More sharing options...
Question
cahadeyelo
Hi rAthena, Is it possible that instead of event label, the script will read the mob_id on a given map. If yes, can i see what's codes do need to add on my script.cpp.
Link to comment
Share on other sites
3 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.