Drakkus Posted June 19, 2013 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 386 Reputation: 15 Joined: 11/17/11 Last Seen: September 13, 2024 Share Posted June 19, 2013 Hello, i don't know if this was answer in other thread but i was thinking if, is it possible? that NPC will change every 5*seconds sprite? i mean NPC sprite ID with setarray[0]? 871,90,823,872Can this be possible? Quote Link to comment Share on other sites More sharing options...
KoolKat29 Posted June 19, 2013 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 90 Reputation: 5 Joined: 06/17/12 Last Seen: September 6, 2013 Share Posted June 19, 2013 OnInit:initnpctimer;end;OnTimer1000:if(gettime(1) != 5) end;setnpcdisplay( strnpcinfo(0),rand( 871,90,823,872 ) ); //From MonsterWiki Not sure if it'll work XDsetnpctimer, 0;end; "Be aware though, this causes a heavy load on your server." - http://rathena.org/wiki/Timers_(Scripting) Quote Link to comment Share on other sites More sharing options...
Drakkus Posted June 19, 2013 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 386 Reputation: 15 Joined: 11/17/11 Last Seen: September 13, 2024 Author Share Posted June 19, 2013 Thanks for hints and respond, i'll check this out later. Quote Link to comment Share on other sites More sharing options...
Capuche Posted June 20, 2013 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 June 20, 2013 *rand(<number>{,<number>}); This function returns a number ... (if you specify one) ... randomly positioned between 0 and the number you specify -1. (if you specify two) ... randomly positioned between the two numbers you specify. rand(10) would result in 0,1,2,3,4,5,6,7,8 or 9 rand(0,9) would result in 0,1,2,3,4,5,6,7,8 or 9 rand(2,5) would result in 2,3,4 or 5 So ,rand( 871,90,823,872 ) ); doesn't work Try this OnInit: while(1) { sleep 5000; setnpcdisplay( strnpcinfo(0),callfunc( "F_RandMes", 4, 871,90,823,872 ) ); } Quote Link to comment Share on other sites More sharing options...
Drakkus Posted June 20, 2013 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 386 Reputation: 15 Joined: 11/17/11 Last Seen: September 13, 2024 Author Share Posted June 20, 2013 (edited) Hi Capuche thanks for the respond i'll try this one also. This one i wanted to add the feature :3 //===== rAthena Script ======================================= //= Core Feature: Show which GMs are online/offline //= Special Features: //= - cache the result to prevent spam to the DB //= - show when a GM was online the last time //===== By: ================================================== //= ~De@dly Silence~ <[email protected]> //===== Current Version: ===================================== //= 1.0 //===== Additional Comments: ================================= //= 1.0 Initial Version //============================================================ frontier.gat,147,224,5 script Board 857,{ // cache the results to prevent spam .caching = 1; // caching time in seconds .cachingTime = 1; // minimum level to be recognized as a GM .minLevel = 1; // if activated, show when the GM was online the last time (account based) .showLastOnline = 1; // format the date string (%Y for year, %m for month, %d for day) .dateString$ = "%d.%m.%Y"; // format the time string (%H for hour (24 hour format), %h for hour (12 hour format), %i for minute) .timeString$ = "%H:%i"; // check if caching is enabled AND caching time is over OR caching is disabled if ((.caching && (.onlineCachingTime + .cachingTime <= gettimetick(2))) || !.caching) { query_sql( "SELECT DATE_FORMAT(`l`.`lastlogin`, '" + .dateString$ + "') as date, DATE_FORMAT(`l`.`lastlogin`, '" + .timeString$ + "') as time, `c`.`name`, `c`.`online` FROM `login` l " + "JOIN (`char` c) " + "ON (`l`.`account_id` = `c`.`account_id`) " + "WHERE `l`.`group_id` >= " + .minLevel + " " + "ORDER BY `c`.`online` DESC, `c`.`name` ASC" , .date$, .time$, .name$, .online$ ); // Workaround: select "online" as string because 0 will result in an empty field value .onlineCachingTime = gettimetick(2); } mes "(^0055FF Staff Lists ^000000)", " "; mes " "; for (.@i = 0; .@i < getarraysize(.online$); .@i += 1) { if ("1" == .online$[.@i]) { mes .name$[.@i] + ": ^00AA00ONLINE^000000"; } else { mes .name$[.@i] + ": ^FF0000OFFLINE^000000"; if (.showLastOnline) { mes "» Last online at " + .date$ + " " + .time$; } } mes "———————————————————"; } close; } Edited June 20, 2013 by Vlync Quote Link to comment Share on other sites More sharing options...
Question
Drakkus
Hello, i don't know if this was answer in other thread but i was thinking if, is it possible? that NPC will change every 5*seconds sprite? i mean NPC sprite ID
with setarray[0]? 871,90,823,872
Can this be possible?
Link to comment
Share on other sites
4 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.