Currently Posted December 25, 2012 Posted December 25, 2012 Not sure how I will start it thats why I'm just requesting for a little script that will do a mobcount check. and if it reaches 0. OnPCEvent will happen next. Quote
Emistry Posted December 25, 2012 Posted December 25, 2012 (edited) if( !mobcount( "mapname","event label" ) ){ //do what you want here.. OnPCEvent.... } refer mobcount Edited December 25, 2012 by Emistry Quote
Currently Posted December 25, 2012 Author Posted December 25, 2012 ^ Okay so uhm. Will that triffer if the mob count is 0? I tried to read the mobcount from script_commands.txt but I dont really just get it.. Quote
AnnieRuru Posted December 25, 2012 Posted December 25, 2012 (edited) prontera,154,174,4 script kdfksdjfs 100,{ monster "this", -1,-1, "--ja--", 1002, 3, strnpcinfo(0)+"::OnPCEvent"; end; OnPCEvent: if ( mobcount( "this", strnpcinfo(0)+"::OnPCEvent" ) ) end; dispbottom "will happen next"; end; } though I usually using a variable to save the mobcount instead of using this script command though, more resource friendly prontera,154,174,4 script kdfksdjfs 100,{ monster "this", -1,-1, "--ja--", 1002, 3, strnpcinfo(0)+"::OnPCEvent"; .count += 3; end; OnPCEvent: .count--; if ( .count ) end; dispbottom "will happen next"; end; } Edited December 27, 2012 by AnnieRuru Quote
Capuche Posted December 26, 2012 Posted December 26, 2012 (edited) though I usually using a variable to save the mobcount instead of using this script command though, more resource friendly Maybe this is a stupid question or I shouldn't ask here... if that's it please forgive me ! (lol) How could I know if a script is optimized ? How estimate the resource the script is using ? or like you said, how estimate the resource when I used a variable or a script command ? Just curiosity. Edited December 27, 2012 by Capuche Quote
AnnieRuru Posted December 27, 2012 Posted December 27, 2012 (edited) read the source script.c file mobcount script command script_pushint(st,map_foreachinmap(buildin_mobcount_sub, m, BL_MOB, event)); in this script, every time a monster is kill, in the source will run this function this function search EVERY monsters in the map, so let's say if there are more than 300 monsters with 5 different event labels it will loop through every monsters in this map with 300 loops, and only count++ out only this event label that you have specify of course, using variables will be more resource friendly Edited December 27, 2012 by AnnieRuru Quote
Question
Currently
Not sure how I will start it thats why
I'm just requesting for a little script that will do a mobcount check. and if it reaches 0. OnPCEvent will happen next.
6 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.