Advertisement
Emistry

[RO] Hourly Point - auto reset 1.3

Nov 25th, 2016
1,056
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. // https://rathena.org/board/topic/108246-hourly-points/
  2.  
  3. - script hourly_point_main -1,{
  4.  
  5. OnInit:
  6. .max_minute = 300;
  7. bindatcmd "check",strnpcinfo(3)+"::OnAtcommand";
  8. .npc_name$ = strnpcinfo(3);
  9. end;
  10.  
  11. OnAtcommand:
  12. dispbottom "Accumulated "+#daily_minute_count+" / "+.max_minute+" minute(s) - "+ ( ( #daily_minute_count < .max_minute )?" In Progress":"Completed" );
  13. end;
  14.  
  15. OnClock0000:
  16. query_sql( "DELETE FROM acc_reg_num` WHERE `key` = '#daily_minute_count' AND `account_id` IN ( SELECT `account_id` FROM `char` WHERE `login` = 0 GROUP BY `account_id` ) " );
  17. addrid(0);
  18. #daily_minute_count = -1;
  19.  
  20. OnUpdate:
  21. deltimer .npc_name$+"::OnUpdate";
  22. #daily_minute_count++;
  23. switch ( #daily_minute_count ) {
  24. default:
  25. break;
  26. case 60: // 60 minutes
  27. #CASHPOINT += 1;
  28. getitem 512,1;
  29. break;
  30. case 120: // 120 minutes
  31. #CASHPOINT += 2;
  32. getitem 512,2;
  33. break;
  34. case 180: // 180 minutes
  35. #CASHPOINT += 3;
  36. getitem 512,3;
  37. break;
  38. case 240: // 240 minutes
  39. #CASHPOINT += 4;
  40. getitem 512,4;
  41. break;
  42. case 300: // 300 minutes
  43. #CASHPOINT += 5;
  44. getitem 512,6;
  45. break;
  46. }
  47.  
  48. OnPCLoginEvent:
  49. dispbottom "Accumulated "+#daily_minute_count+" minute(s)";
  50. if ( #daily_minute_count < .max_minute ) {
  51. addtimer ( 60 * 1000 ), .npc_name$+"::OnUpdate";
  52. }
  53. end;
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement