Advertisement
villers

@afk fixed

Mar 13th, 2013
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.51 KB | None | 0 0
  1. Index: conf/battle/misc.conf
  2. ===================================================================
  3. --- conf/battle/misc.conf   (revision 17195)
  4. +++ conf/battle/misc.conf   (working copy)
  5. @@ -101,6 +101,9 @@
  6.  // Set this to the amount of minutes autotrade chars will be kicked from the server.
  7.  at_timeout: 0
  8.  
  9. +// Set this to the amount of minutes afk chars will be kicked from the server.
  10. +afk_timeout: 0
  11. +
  12.  // Auction system, fee per hour. Default is 12000
  13.  auction_feeperhour: 12000
  14.  
  15. Index: src/map/atcommand.c
  16. ===================================================================
  17. --- src/map/atcommand.c (revision 17195)
  18. +++ src/map/atcommand.c (working copy)
  19. @@ -8790,6 +8790,45 @@
  20.     #undef MC_CART_MDFY
  21.  }
  22.  
  23. +/*==========================================
  24. +* @afk
  25. +*------------------------------------------*/
  26. +ACMD_FUNC(afk) {
  27. +   nullpo_retr(-1, sd);
  28. +
  29. +   if(pc_isdead(sd)) {
  30. +       clif_displaymessage(fd, "Cannot @afk if you are dead.");
  31. +       return -1;
  32. +   }
  33. +
  34. +   if( (map[sd->bl.m].flag.autotrade == battle_config.autotrade_mapflag) && (sd->bl.m != map_mapname2mapid("prontera")) )
  35. +   {
  36. +       if(map[sd->bl.m].flag.pvp  || map[sd->bl.m].flag.gvg)
  37. +       {
  38. +           clif_displaymessage(fd, "You may not use the @afk maps PVP or GVG.");
  39. +           return -1;
  40. +       }
  41. +
  42. +       sd->state.autotrade = 1;
  43. +       sd->state.monster_ignore = 1;
  44. +       pc_setsit(sd);
  45. +       skill_sit(sd,1);
  46. +       clif_sitting(&sd->bl,1);
  47. +       clif_changelook(&sd->bl,LOOK_HEAD_TOP,471);
  48. +       clif_specialeffect(&sd->bl, 234,AREA);
  49. +
  50. +       if( battle_config.afk_timeout )
  51. +       {
  52. +           int timeout = atoi(message);
  53. +           status_change_start(&sd->bl, SC_AUTOTRADE, 10000,0,0,0,0, ((timeout > 0) ? min(timeout,battle_config.afk_timeout) : battle_config.afk_timeout)*60000,0);
  54. +       }
  55. +       clif_authfail_fd(fd, 15);
  56. +   } else
  57. +       clif_displaymessage(fd, "@afk is not allowed on this map.");
  58. +
  59. +   return 0;
  60. +}
  61. +
  62.  /**
  63.   * Fills the reference of available commands in atcommand DBMap
  64.   **/
  65. @@ -9050,7 +9089,8 @@
  66.         ACMD_DEF2("rmvperm", addperm),
  67.         ACMD_DEF(unloadnpcfile),
  68.         ACMD_DEF(cart),
  69. -       ACMD_DEF(mount2)
  70. +       ACMD_DEF(mount2),
  71. +       ACMD_DEF(afk)
  72.     };
  73.     AtCommandInfo* atcommand;
  74.     int i;
  75. Index: src/map/battle.c
  76. ===================================================================
  77. --- src/map/battle.c    (revision 17195)
  78. +++ src/map/battle.c    (working copy)
  79. @@ -5870,6 +5870,7 @@
  80.     { "quest_exp_rate",                     &battle_config.quest_exp_rate,                  100,    0,      INT_MAX,        },
  81.     { "at_mapflag",                         &battle_config.autotrade_mapflag,               0,      0,      1,              },
  82.     { "at_timeout",                         &battle_config.at_timeout,                      0,      0,      INT_MAX,        },
  83. +   { "afk_timeout",                        &battle_config.afk_timeout,                     0,      0,      INT_MAX,        },
  84.     { "homunculus_autoloot",                &battle_config.homunculus_autoloot,             0,      0,      1,              },
  85.     { "idle_no_autoloot",                   &battle_config.idle_no_autoloot,                0,      0,      INT_MAX,        },
  86.     { "max_guild_alliance",                 &battle_config.max_guild_alliance,              3,      0,      3,              },
  87. Index: src/map/battle.h
  88. ===================================================================
  89. --- src/map/battle.h    (revision 17195)
  90. +++ src/map/battle.h    (working copy)
  91. @@ -434,6 +434,7 @@
  92.     int quest_exp_rate;
  93.     int autotrade_mapflag;
  94.     int at_timeout;
  95. +   int afk_timeout;
  96.     int homunculus_autoloot;
  97.     int idle_no_autoloot;
  98.     int max_guild_alliance;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement