Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2012
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.65 KB | None | 0 0
  1. //===== Hourly Points Script =========================================
  2. //===== By: ==========================================================
  3. //= GorthexTiger modified by Nibi
  4. //===== Current Version: =============================================
  5. //= 1.0
  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. //===== Additional Comments: =========================================
  15. //= You can modify the script to your liking.
  16. //= The default points is Kafrapoints change it anyway if you like.
  17. //= 1.1 = Check Chatting too
  18. //= 1.2 = 5 Minute Idle Check & @at/@autotrade check.
  19. //= 1.3 = Corrected the current balance line on 12 Hours Consecutive
  20. //====================================================================
  21.  
  22. -    script    hourlypoints    -1,{
  23.  
  24. //--Start of the Script
  25. OnPCLoginEvent:
  26. attachnpctimer ""+strcharinfo(0)+"";
  27. initnpctimer;
  28. end;
  29.    
  30. OnTimer30000:
  31. //Check if Vending (normal or @at)
  32. if(checkvending() >= 1 || checkchatting() == 1) {
  33.     dispbottom "The Hourly Rewards event stopped because you were vending / chatting. Please relog if you wish to start again.";
  34.     stopnpctimer;
  35.     end;
  36. }
  37. //Check if Idle
  38. getmapxy( .@map$, .@x, .@y, 0 );
  39. if(@map$ == .@map$ && @x == .@x && @y == .@y) {
  40.     set @afk, @afk + 1;
  41. }
  42. //If move timer resets
  43. else {
  44.     set @afk, 0;
  45. }
  46.     set @map$, .@map$; set @x, .@x; set @y, .@y;
  47. //Idle Check for 5 Minutes
  48. if(@afk == 5) {
  49.     dispbottom "The Hourly Rewards event stopped because you were idle for 5 minutes. Please relog if you wish to start again.";
  50.     stopnpctimer;
  51.     end;
  52. }
  53. end;
  54.  
  55. OnTimer60000:
  56. set @minute, @minute + 1;
  57. //Check for 1 Minute
  58. if(@minute == 60){
  59.     set @minute,0;
  60.     set .@item_amt, 1; //Points to get every hour (default: 10)
  61.     getitem 7227,.@item_amt;
  62.     dispbottom "You received "+.@point_amt+" [i]<7227's displayname>[/i] by staying ingame for 1 hour";
  63.     }
  64. //Check for 6 hours consecutive
  65.     if(@consecutive_hour == [b][i]6[/i][/b]) {
  66.     set @consecutive_hour,0;
  67.     set .@item_amt, 1; //Points to get for 6 Consecutive hours (default: 50)
  68.     getitem 7185,.@item_amt;
  69.     dispbottom "You receive "+.@item_amt+" [i]<7185's displayname>[/i] in playing for 6 consecutive hours";
  70.     }
  71. stopnpctimer;
  72. initnpctimer;
  73. end;
  74.  
  75. }
  76. //--End of the Script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement