Jump to content
  • 0

Question

Posted

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?

 

4 answers to this question

Recommended Posts

Posted

*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 ) );
	}
Posted (edited)

Hi Capuche thanks for the respond i'll try this one also. /no1

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 by Vlync

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...