Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: conf/msg_conf/map_msg.conf
- ===================================================================
- --- conf/msg_conf/map_msg.conf (revision 17128)
- +++ conf/msg_conf/map_msg.conf (working copy)
- @@ -1738,5 +1738,10 @@
- +// @afk
- +1497: Você está em estado ausente.
- +1498: Por Favor, digite sua resposta automática (usage: @afk <Estou longe do teclado>).
- +1499: Sua resposta automática está ativada, use @afk para desativar.
- +1500: (Mensagem Automática): "%s"
- //Custom translations
- import: conf/import/msg_conf.txt
- Index: src/map/atcommand.c
- ===================================================================
- --- src/map/atcommand.c (revision 17128)
- +++ src/map/atcommand.c (working copy)
- @@ -8818,6 +8818,51 @@
- #undef MC_CART_MDFY
- }
- +ACMD_FUNC(afk)
- +{
- + char temp_msg[CHAT_SIZE_MAX];
- +
- + nullpo_retr(-1, sd);
- +
- + memset(temp_msg, '\0', sizeof(temp_msg));
- +
- + if (!message || !*message || sscanf(message, "%255[^\n]", temp_msg) < 1)
- + {
- + sprintf(atcmd_output, msg_txt(sd, 1498)); // Por Favor, digite sua resposta automática (usage: @afk <Estou longe do teclado>).
- + clif_displaymessage(sd->fd, atcmd_output);
- + return -1;
- + }
- + sd->state.away = 0;
- +
- + sscanf(message, "%255[^\n]", sd->state.away_msg);
- + pc_setsit(sd);
- + skill_sit(sd,1);
- + clif_sitting(&sd->bl, true);
- + clif_changelook(&sd->bl,LOOK_HEAD_TOP,471);
- + clif_specialeffect(&sd->bl, 234,AREA);
- + sprintf(atcmd_output, msg_txt(sd, 1497)); // Você está em estado ausente.
- + clif_displaymessage(sd->fd, atcmd_output);
- + }
- + else {
- + sd->state.away = 1;
- + sscanf(message, "%255[^\n]", sd->state.away_msg);
- + sprintf(atcmd_output, msg_txt(sd,1499)); // Sua resposta automática está ativada, use @afk para desativar.
- + clif_displaymessage(sd->fd, atcmd_output);
- +
- + return 0;
- +}
- /**
- * Fills the reference of available commands in atcommand DBMap
- **/
- @@ -9078,7 +9123,8 @@
- ACMD_DEF2("rmvperm", addperm),
- ACMD_DEF(unloadnpcfile),
- ACMD_DEF(cart),
- - ACMD_DEF(mount2)
- + ACMD_DEF(mount2),
- + ACMD_DEF(afk)
- };
- AtCommandInfo* atcommand;
- int i;
- Index: src/map/clif.c
- ===================================================================
- --- src/map/clif.c (revision 17128)
- +++ src/map/clif.c (working copy)
- @@ -10062,6 +10062,18 @@
- return;
- }
- + // @afk
- + if( dstsd->state.away == 1 )
- + {
- + char output_away[CHAT_SIZE_MAX];
- +
- + clif_wis_end(fd, 0); // 0: success to send wisper
- + sprintf(output_away, msg_txt(1500), dstsd->state.away_msg); // (Mensagem Automática): "%s"
- + clif_wis_message(fd, dstsd->status.name, output_away, strlen(output_away) + 1);
- + clif_wis_message(dstsd->fd, sd->status.name, message, messagelen);
- + return;
- + }
- +
- // if player is autotrading
- if( dstsd->state.autotrade == 1 ) {
- char output[256];
- Index: src/map/pc.h
- ===================================================================
- --- src/map/pc.h (revision 17128)
- +++ src/map/pc.h (working copy)
- @@ -144,6 +144,8 @@
- struct guild *gmaster_flag;
- unsigned int prevend : 1;//used to flag wheather you've spent 40sp to open the vending or not.
- unsigned int warping : 1;//states whether you're in the middle of a warp processing
- + unsigned short away : 1; //@afk2 auto message.
- + char away_msg[CHAT_SIZE_MAX]; //@afk2 auto message.
- } state;
- struct {
- unsigned char no_weapon_damage, no_magic_damage, no_misc_damage;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement