Jump to content
  • 0

NPC Change Display


Drakkus

Question


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   15
  • Joined:  11/17/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  90
  • Reputation:   5
  • Joined:  06/17/12
  • Last Seen:  

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 XD
setnpctimer, 0;
end;
 

 

"Be aware though, this causes a heavy load on your server."

http://rathena.org/wiki/Timers_(Scripting)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   15
  • Joined:  11/17/11
  • Last Seen:  

Thanks for hints and respond, i'll check this out later. :)

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   616
  • Joined:  07/05/12
  • Last Seen:  

*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 ) );
	}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   15
  • Joined:  11/17/11
  • Last Seen:  

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
Link to comment
Share on other sites

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.

×
×
  • Create New...