yuhsing

Untitled

Aug 21st, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. //===== Hourly Points Script =========================================
  2. //===== By: ==========================================================
  3. //= nostafu
  4. //===== Current Version: =============================================
  5. //= 1.3
  6. //===== Compatible With: =============================================
  7. //= Any eAthena Version
  8. //===== Description: =================================================
  9. //= Get Points every successful hours of gameplay, you cannot get
  10. //= the points even if you miss a second or a minute. A player will
  11. //= get a very big bonus if they played 12 hours consecutively
  12. //= or without logging out of the game. If the player is vending
  13. //= the script will then stop.
  14. //====================================================================
  15. - script hourlypoints -1,{
  16. //--Start of the Script
  17. OnPCLoginEvent:
  18. attachnpctimer ""+strcharinfo(0)+"";
  19. initnpctimer;
  20. end;
  21.  
  22. OnTimer30000:
  23. //Check if Vending (normal or @at)
  24. if(checkvending() >= 1 || checkchatting() == 1) {
  25. dispbottom "The hourly points event stopped because you were vending / chatting. Please relog if you wish to start again.";
  26. stopnpctimer;
  27. end;
  28. }
  29. //Check if Idle
  30. getmapxy( .@map$, .@x, .@y, 0 );
  31. if(@map$ == .@map$ && @x == .@x && @y == .@y) {
  32. set @afk, @afk + 1;
  33. }
  34. //If move timer resets
  35. else {
  36. set @afk, 0;
  37. }
  38. set @map$, .@map$; set @x, .@x; set @y, .@y;
  39. //Idle Check for 5 Minutes
  40. if(@afk == 10) {
  41. dispbottom "The hourly points event point halved because you were idle for 10 minutes. ";
  42. // stopnpctimer;
  43. // end;
  44. }
  45. end;
  46. OnTimer60000:
  47. set @minute, @minute + 1;
  48. //Check for 1 Minute
  49. if(@minute == 60){
  50. set @minute,0;
  51. set .@point_amt, 2; //Points to get every hour (default: 10)
  52. if( @afk >= 0 ) set .@point_amt,( .@point_amt/2 );
  53. set #KAFRAPOINTS, #KAFRAPOINTS + .@point_amt;
  54. dispbottom "You received "+.@point_amt+" Kafrapoints by staying ingame for 1 hour";
  55. dispbottom "Current Balance = "+#KAFRAPOINTS+" Kafrapoints";
  56. set @consecutive_hour, @consecutive_hour + 1;
  57. }
  58. //Check for 12 hours consecutive
  59. if(@consecutive_hour == 12) {
  60. set @consecutive_hour,0;
  61. set .@cpoint_amt, 10; //Points to get for 12 Consecutive hours (default: 50)
  62. if( @afk >= 0 ) set .@cpoint_amt,( .@cpoint_amt/2 );
  63. set #KAFRAPOINTS, #KAFRAPOINTS + .@cpoint_amt;
  64. dispbottom "You receive "+.@cpoint_amt+" Kafrapoints in playing for 12 consecutive hours";
  65. dispbottom "Current Balance = "+#KAFRAPOINTS+" Kafrapoints";
  66. }
  67. stopnpctimer;
  68. initnpctimer;
  69. end;
  70. }
  71. //--End of the Script
Advertisement
Add Comment
Please, Sign In to add comment