Currently Posted December 25, 2012 Group: Members Topic Count: 162 Topics Per Day: 0.03 Content Count: 313 Reputation: 1 Joined: 01/22/12 Last Seen: November 17, 2023 Share 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 Link to comment Share on other sites More sharing options...
Emistry Posted December 25, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Yesterday at 05:32 PM Share 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 Link to comment Share on other sites More sharing options...
Currently Posted December 25, 2012 Group: Members Topic Count: 162 Topics Per Day: 0.03 Content Count: 313 Reputation: 1 Joined: 01/22/12 Last Seen: November 17, 2023 Author Share 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 Link to comment Share on other sites More sharing options...
AnnieRuru Posted December 25, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share 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 Link to comment Share on other sites More sharing options...
Capuche Posted December 26, 2012 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share 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 Link to comment Share on other sites More sharing options...
AnnieRuru Posted December 27, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share 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 Link to comment Share on other sites More sharing options...
Capuche Posted December 27, 2012 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted December 27, 2012 Thanks you AnnieRuru. Quote Link to comment Share on other sites More sharing options...
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.
Link to comment
Share on other sites
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.