Jump to content
  • 0

How can i check day and night in an npc dialog?


ZelosAvalon

Question


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  181
  • Reputation:   33
  • Joined:  11/11/12
  • Last Seen:  

if i am talking to an npc and during this dialogue the server is at night,

and the npc's speech was: 
Have a good day ~ 
i would like to check it for him to say: 
have a good night ~ instead of day

Can anyone help me with this?

best regards, ZelosAvalon

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  50
  • Reputation:   39
  • Joined:  01/13/12
  • Last Seen:  

1 hour ago, ZelosAvalon said:

if i am talking to an npc and during this dialogue the server is at night,

and the npc's speech was: 
Have a good day ~ 
i would like to check it for him to say: 
have a good night ~ instead of day

Can anyone help me with this?

best regards, ZelosAvalon

You can use these script commands:

Spoiler

*isnight()
*isday()

These functions will return 1 or 0 depending on whether the server is in night
mode or day mode. 'isnight' returns 1 if it's night and 0 if it isn't, 'isday'
the other way around. They can be used interchangeably, pick the one you like
more:

    // These two are equivalent:
    if (isday()) mes "I only prowl in the night.";
    if (isnight() != 1) mes "I only prowl in the night.";

 

And you need to configure your 'conf/battle/misc.conf' at this part:

Spoiler

// Choose if server begin with night (yes) or day (no)
night_at_start: no

// Define duration in msec of the day (default: 7200000 = 2 hours)
// Set to 0 to disable day cycle (but not @day GM command).
// Except 0, minimum is 60000 (1 minute)
day_duration: 0

// Define duration in msec of the night (default: 1800000 = 30 min)
// Set to 0 to disable night cycle (but not @night GM command).
// Except 0, minimum is 60000 (1 minute)
night_duration: 0

 

 

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  181
  • Reputation:   33
  • Joined:  11/11/12
  • Last Seen:  

59 minutes ago, Cretino said:

Você pode usar estes comandos de script:

  Ocultar conteúdo





     

    
     
       

 

E você precisa configurar o seu ' conf / battle / misc.conf ' nesta parte:

  Ocultar conteúdo






 



 

 

 

thanks you help me so much!!!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  461
  • Reputation:   61
  • Joined:  08/28/12
  • Last Seen:  

Hey, if you wanna check the time real time for day and night, use this here:
 

mes (gettime(3)>= 6&&gettime(3)<= 12?"Good Morning":(gettime(3)>=13&&gettime(3)<=18?"Good Afternoon":"Good Evening"))+", "+(Sex?"Mr.":"Mrs.")+" ^0000ff"+strcharinfo(0)+"^000000!";

 

Edited by WhiteEagle
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

if (isnight()) {
	// night codes
}
else {
	// day codes
}

if you have enabled the day/night rotation..

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...