Jump to content
  • 0

Day/Night Mode Announcement


Dori

Question


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

How can I remove the "Day/Night Mode Activated" message? I've done this previously by commenting the below lines in src/pc.c, but now it errors when I recompile.

	strcpy(tmp_soutput, (data == 0) ? msg_txt(NULL,503) : msg_txt(NULL,59)); // The night has fallen...

intif_broadcast(tmp_soutput, strlen(tmp_soutput) + 1, 0);

	strcpy(tmp_soutput, (data == 0) ? msg_txt(NULL,502) : msg_txt(NULL,60)); // The day has arrived!

intif_broadcast(tmp_soutput, strlen(tmp_soutput) + 1, 0);

Edited by Phenex
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

FIXED IT
 
For those who want the "Day/Night Mode" announcement disabled:
 
in Pc.c find:
int map_day_timer(int tid, unsigned int tick, int id, intptr_t data)
{
    char tmp_soutput[1024];
 
    if (data == 0 && battle_config.day_duration <= 0)    // if we want a day
        return 0;
 
    if (!night_flag)
        return 0; //Already day.
 
    night_flag = 0; // 0=day, 1=night [Yor]
    map_foreachpc(pc_daynight_timer_sub);
    strcpy(tmp_soutput, (data == 0) ? msg_txt(NULL,502) : msg_txt(NULL,60)); // The day has arrived!
    intif_broadcast(tmp_soutput, strlen(tmp_soutput) + 1, 0);
    return 0;
}
/*================================================
 * timer to do the night [Yor]
 * data: 0 = called by timer, 1 = gmcommand/script
 *------------------------------------------------*/
int map_night_timer(int tid, unsigned int tick, int id, intptr_t data)
{
    char tmp_soutput[1024];
 
    if (data == 0 && battle_config.night_duration <= 0)    // if we want a night
        return 0;
 
    if (night_flag)
        return 0; //Already nigth.
 
    night_flag = 1; // 0=day, 1=night [Yor]
    map_foreachpc(pc_daynight_timer_sub);
    strcpy(tmp_soutput, (data == 0) ? msg_txt(NULL,503) : msg_txt(NULL,59)); // The night has fallen...
    intif_broadcast(tmp_soutput, strlen(tmp_soutput) + 1, 0);
    return 0;
}
 
Replace With:
 
int map_day_timer(int tid, unsigned int tick, int id, intptr_t data)
{
//    char tmp_soutput[1024];
 
    if (data == 0 && battle_config.day_duration <= 0)    // if we want a day
        return 0;
 
    if (!night_flag)
        return 0; //Already day.
 
    night_flag = 0; // 0=day, 1=night [Yor]
    map_foreachpc(pc_daynight_timer_sub);
//    strcpy(tmp_soutput, (data == 0) ? msg_txt(NULL,502) : msg_txt(NULL,60)); // The day has arrived!
//    intif_broadcast(tmp_soutput, strlen(tmp_soutput) + 1, 0);
    return 0;
}
/*================================================
 * timer to do the night [Yor]
 * data: 0 = called by timer, 1 = gmcommand/script
 *------------------------------------------------*/
int map_night_timer(int tid, unsigned int tick, int id, intptr_t data)
{
//    char tmp_soutput[1024];
 
    if (data == 0 && battle_config.night_duration <= 0)    // if we want a night
        return 0;
 
    if (night_flag)
        return 0; //Already nigth.
 
    night_flag = 1; // 0=day, 1=night [Yor]
    map_foreachpc(pc_daynight_timer_sub);
//    strcpy(tmp_soutput, (data == 0) ? msg_txt(NULL,503) : msg_txt(NULL,59)); // The night has fallen...
//    intif_broadcast(tmp_soutput, strlen(tmp_soutput) + 1, 0);
    return 0;
}

 

Edited by Phenex
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   104
  • Joined:  11/19/11
  • Last Seen:  


There are a set of configuraiton settings ,you can disable it

conf/battle/misc.conf

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  60
  • Reputation:   9
  • Joined:  04/16/12
  • Last Seen:  

i found a similar post and @Emistry says delete the same as you say but not the 2 lines just

 

strcpy(tmp_soutput, (data == 0) ? msg_txt(502) : msg_txt(60)); // The day has arrived!

strcpy(tmp_soutput, (data == 0) ? msg_txt(503) : msg_txt(59)); // The night has fallen...

i cant test atm my hd just blow up :(  but any way this is the reference topic http://rathena.org/board/topic/77995-msg-athena/?hl=%2Bday+%2Bnight

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

Thanks for the reply. The recompiling went well without any errors, But in-game when I tested out Day or Night the client crashed.

Note: I used @day and @night to test this out.

May be I have to edit the atcommand.c as well

 

I'll try to let day or night change without using the @command and see if it errors.

 

EDIT: Ok so I tried it. Day and night changed without an error But a message still appears when it changes (and not in english).

Look below.

 

dayer_zpsdd83d916.jpg

Edited by Phenex
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...