Advertisement
Guest User

Untitled

a guest
Mar 6th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.38 KB | None | 0 0
  1. Index: conf/msg_conf/map_msg.conf
  2. ===================================================================
  3. --- conf/msg_conf/map_msg.conf (revision 17128)
  4. +++ conf/msg_conf/map_msg.conf (working copy)
  5. @@ -1738,5 +1738,10 @@
  6.  
  7. +// @afk
  8. +1497: Você está em estado ausente.
  9. +1498: Por Favor, digite sua resposta automática (usage: @afk <Estou longe do teclado>).
  10. +1499: Sua resposta automática está ativada, use @afk para desativar.
  11. +1500: (Mensagem Automática): "%s"
  12.  
  13. //Custom translations
  14. import: conf/import/msg_conf.txt
  15. Index: src/map/atcommand.c
  16. ===================================================================
  17. --- src/map/atcommand.c (revision 17128)
  18. +++ src/map/atcommand.c (working copy)
  19. @@ -8818,6 +8818,51 @@
  20. #undef MC_CART_MDFY
  21. }
  22.  
  23. +ACMD_FUNC(afk)
  24. +{
  25. + char temp_msg[CHAT_SIZE_MAX];
  26. +
  27. + nullpo_retr(-1, sd);
  28. +
  29. + memset(temp_msg, '\0', sizeof(temp_msg));
  30. +
  31. + if (!message || !*message || sscanf(message, "%255[^\n]", temp_msg) < 1)
  32. + {
  33. + sprintf(atcmd_output, msg_txt(sd, 1498)); // Por Favor, digite sua resposta automática (usage: @afk <Estou longe do teclado>).
  34. + clif_displaymessage(sd->fd, atcmd_output);
  35. + return -1;
  36. + }
  37. + sd->state.away = 0;
  38. +
  39. + sscanf(message, "%255[^\n]", sd->state.away_msg);
  40. + pc_setsit(sd);
  41. + skill_sit(sd,1);
  42. + clif_sitting(&sd->bl, true);
  43. + clif_changelook(&sd->bl,LOOK_HEAD_TOP,471);
  44. + clif_specialeffect(&sd->bl, 234,AREA);
  45. + sprintf(atcmd_output, msg_txt(sd, 1497)); // Você está em estado ausente.
  46. + clif_displaymessage(sd->fd, atcmd_output);
  47. + }
  48. + else {
  49. + sd->state.away = 1;
  50. + sscanf(message, "%255[^\n]", sd->state.away_msg);
  51. + sprintf(atcmd_output, msg_txt(sd,1499)); // Sua resposta automática está ativada, use @afk para desativar.
  52. + clif_displaymessage(sd->fd, atcmd_output);
  53. +
  54. + return 0;
  55. +}
  56.  
  57. /**
  58. * Fills the reference of available commands in atcommand DBMap
  59. **/
  60. @@ -9078,7 +9123,8 @@
  61. ACMD_DEF2("rmvperm", addperm),
  62. ACMD_DEF(unloadnpcfile),
  63. ACMD_DEF(cart),
  64. - ACMD_DEF(mount2)
  65. + ACMD_DEF(mount2),
  66. + ACMD_DEF(afk)
  67. };
  68. AtCommandInfo* atcommand;
  69. int i;
  70. Index: src/map/clif.c
  71. ===================================================================
  72. --- src/map/clif.c (revision 17128)
  73. +++ src/map/clif.c (working copy)
  74. @@ -10062,6 +10062,18 @@
  75. return;
  76. }
  77.  
  78. + // @afk
  79. + if( dstsd->state.away == 1 )
  80. + {
  81. + char output_away[CHAT_SIZE_MAX];
  82. +
  83. + clif_wis_end(fd, 0); // 0: success to send wisper
  84. + sprintf(output_away, msg_txt(1500), dstsd->state.away_msg); // (Mensagem Automática): "%s"
  85. + clif_wis_message(fd, dstsd->status.name, output_away, strlen(output_away) + 1);
  86. + clif_wis_message(dstsd->fd, sd->status.name, message, messagelen);
  87. + return;
  88. + }
  89. +
  90. // if player is autotrading
  91. if( dstsd->state.autotrade == 1 ) {
  92. char output[256];
  93. Index: src/map/pc.h
  94. ===================================================================
  95. --- src/map/pc.h (revision 17128)
  96. +++ src/map/pc.h (working copy)
  97. @@ -144,6 +144,8 @@
  98. struct guild *gmaster_flag;
  99. unsigned int prevend : 1;//used to flag wheather you've spent 40sp to open the vending or not.
  100. unsigned int warping : 1;//states whether you're in the middle of a warp processing
  101. + unsigned short away : 1; //@afk2 auto message.
  102. + char away_msg[CHAT_SIZE_MAX]; //@afk2 auto message.
  103. } state;
  104. struct {
  105. unsigned char no_weapon_damage, no_magic_damage, no_misc_damage;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement