Advertisement
Emistry

[RO] Playtime Rewards

May 21st, 2017
1,386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. // https://rathena.org/board/topic/109983-playtime-script/
  2.  
  3.  
  4. prontera,155,181,5 script Sample#playtime 4_F_KAFRA1,{
  5. doevent "playtime_main::OnTalk";
  6. }
  7.  
  8. - script playtime_main -1,{
  9.  
  10. OnInit:
  11. setarray .level, 255, 120;
  12. .reward_point_required = ( 24 * 60 * 60 ); // 24 hours (seconds)
  13. .reward_nameid = 512;
  14. .reward_amount = 1;
  15. end;
  16.  
  17. OnTalk:
  18. mes "You accumulated total "+#TOTAL_PLAYTIME+" point(s)";
  19. mes " ";
  20. switch( select(
  21. ( @playtime ) ? "" : "Start Playtime",
  22. ( @playtime ) ? "Stop Playtime" : "",
  23. "Claim Reward",
  24. "Information"
  25. )) {
  26. case 1:
  27. if ( BaseLevel < .level[0] || JobLevel < .level[1] ) {
  28. mes "You need to be Level "+.level[0]+"/"+.level[1]+" to access this benefit.";
  29. }
  30. else {
  31. @playtime = gettimetick(2);
  32. mes "Playtime counting started.";
  33. }
  34. break;
  35. case 2:
  36. mes "Playtime counting stopped.";
  37. #TOTAL_PLAYTIME = #TOTAL_PLAYTIME + ( gettimetick(2) - @playtime );
  38. @playtime = 0;
  39. deltimer .npc_name$+"::OnPlayTimeUpdate";
  40. break;
  41. case 3:
  42. mes "Every "+.reward_point_required+" point(s), you can claim "+.reward_amount+"x "+getitemname( .reward_nameid );
  43. if ( #TOTAL_PLAYTIME < .reward_point_required ) {
  44. mes "You lack of "+( .reward_point_required - #TOTAL_PLAYTIME )+" point(s) to exchanged.";
  45. }
  46. else {
  47. #TOTAL_PLAYTIME -= .reward_point_required;
  48. getitem .reward_nameid, .reward_amount;
  49. mes "Done, you left "+#TOTAL_PLAYTIME+" Point(s)";
  50. }
  51. break;
  52. default:
  53. mes "PlayTime Points timer will only start when the player decided to start their PlayTime Points using "Start PlayTime Points".";
  54. mes "PlayTime Points timer will not count whenever the player quits, re-logs in or changes character.";
  55. mes "The reward is not hourly, instead one apple (example) for every 24 hours with an interval of also 24 hours.";
  56. mes "Check PlayTime Duration will check how many more hours left or how many hours he/she has reached for the player to stay online and to receive its reward.";
  57. mes "Inactivity or the idleness of the player won't affect or stop the PlayTime Points timer.";
  58. break;
  59. }
  60. close;
  61.  
  62. OnPCLogoutEvent:
  63. if ( @playtime ) {
  64. #TOTAL_PLAYTIME = #TOTAL_PLAYTIME + ( gettimetick(2) - @playtime );
  65. }
  66. end;
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement