Advertisement
Guest User

Untitled

a guest
Feb 8th, 2019
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.97 KB | None | 0 0
  1. //===== rAthena Script =======================================
  2. //= saders Hourly Rewards
  3. //===== By: ==================================================
  4. //= Sader1992
  5. //https://rathena.org/board/profile/30766-sader1992/
  6. //===== Current Version: =====================================
  7. //= 1.2
  8. //===== Compatible With: =====================================
  9. //= rAthena Project
  10. //https://rathena.org/board/files/file/3647-saders-hourly-rewards/
  11. //https://github.com/sader1992/sader_scripts
  12. //===== Description: =========================================
  13. //==== all the configuration are in the last
  14. //==== support gepard / ip / or without them
  15. //==== if you use ip/gepard sql will be used for that
  16. //==== can add minimem level to get the rewards
  17. //==== can change the time
  18. //==== can ban the vending from the rewards (it will reset after relogin)
  19. //==== can add rewards else then variable
  20. //==== there is a shop npc for the variable
  21. //==== you can make it only for vip
  22. //==== can ban idle players for X time from the Hourly Rewards
  23. //==== player can ban his char from getting the reward by @HourlyBan (it will reset after relogin)
  24. //============================================================
  25. //==== please send me a message if you find error
  26. //==== if you like my work maybe consider support me at paypal
  27. //==== sader1992@gmail.com
  28. //============================================================
  29. //==== 1.1 FIX Critical issue with gepard/ip and compatibility with my other scripts
  30. //==== 1.2 FIX GrPard Variable
  31. //============================================================
  32. - script sader_Hourly_Rewards -1,{
  33.  
  34. OnHourlyRewards:
  35. if(#Hourly_Ban){
  36. message strcharinfo(0),"[Hourly Rewards]: You did ban this char from the Hourly Rewards , Relogin to change that .";
  37. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  38. end;
  39. }
  40. if(.s_idle){
  41. if(checkidle() > .s_idle_time){
  42. message strcharinfo(0),"[Hourly Rewards]: No Hourly Rewards for IDLE Players!.";
  43. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  44. end;
  45. }
  46. }
  47. if(.s_vip){
  48. if(!vip_status(VIP_STATUS_ACTIVE)){
  49. message strcharinfo(0),"[Hourly Rewards]: if you are a VIP you will get Hourly Rewards!.";
  50. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  51. end;
  52. }
  53. }
  54. if(BaseLevel < .s_hourly_level){
  55. message strcharinfo(0),"[Hourly Rewards]: if you are level "+.s_hourly_level+" and more you will get Hourly Rewards!.";
  56. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  57. end;
  58. }
  59. if(.s_vinding){
  60. if(checkvending() & .s_vinding){
  61. message strcharinfo(0),"[Hourly Rewards]: No Hourly Rewards for Venders , Relogin to change that .";
  62. if(.s_GePard_ip){
  63. query_logsql("delete from `sader_variables_log` where `variable` = '#Hourly_Rewads_Check' AND `account_id`= '"+getcharid(3)+"'");
  64. }
  65. #Hourly_Rewads_Check = 0;
  66. #Hourly_Ban = 1;
  67. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  68. end;
  69. }
  70. }
  71. #Hourly_Rewads_Check += 1;
  72. if(.s_GePard_ip == 1){
  73. query_sql("SELECT `last_unique_id` FROM `login` WHERE `account_id` = '"+getcharid(3)+"'", .@s_last_unique_id$);
  74. query_logsql("SELECT value FROM `sader_variables_log` WHERE unique_id = '"+.@s_last_unique_id$+"' AND `variable` = '#Hourly_Rewads_Check'", .@s_GePard);
  75. if(.@s_GePard >= #Hourly_Rewads_Check){
  76. message strcharinfo(0),"[Hourly Rewards]: You already got the Hourly Rewards from this PC";
  77. #Hourly_Rewads_Check -= 1;
  78. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  79. end;
  80. }
  81. if(.@s_GePard == 0){
  82. query_logsql("INSERT INTO `sader_variables_log` (`unique_id`,`ip`,`variable`,`index`,`value`, `account_id`, `char_id`, `char_name`) VALUES ('"+.@s_last_unique_id$+"', '"+getcharip()+"', '#Hourly_Rewads_Check', '0', '"+#Hourly_Rewads_Check+"', '"+getcharid(3)+"', '"+getcharid(0)+"', '"+strcharinfo(0)+"')");
  83. }
  84. query_logsql("Update `sader_variables_log` SET `value` = '"+#Hourly_Rewads_Check+"' WHERE `unique_id`= '"+.@s_last_unique_id$+"' AND `variable` = '#Hourly_Rewads_Check'");
  85. }else if(.s_GePard_ip == 2){
  86. query_logsql("SELECT value FROM `sader_variables_log` WHERE ip = '"+getcharip()+"' AND `variable` = '#Hourly_Rewads_Check'", .@s_ip);
  87. if(.@s_ip >= #Hourly_Rewads_Check){
  88. message strcharinfo(0),"[Hourly Rewards]: You already got the Hourly Rewards from this IP";
  89. #Hourly_Rewads_Check -= 1;
  90. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  91. end;
  92. }
  93. if(.@s_ip == 0){
  94. query_logsql("INSERT INTO `sader_variables_log` (`unique_id`,`ip`,`variable`,`index`,`value`, `account_id`, `char_id`, `char_name`) VALUES ('"+.@s_last_unique_id$+"', '"+getcharip()+"', '#Hourly_Rewads_Check', '0', '"+#Hourly_Rewads_Check+"', '"+getcharid(3)+"', '"+getcharid(0)+"', '"+strcharinfo(0)+"')");
  95. }
  96. query_logsql("Update `sader_variables_log` SET `value` = '"+#Hourly_Rewads_Check+"' WHERE `ip`= '"+getcharip()+"' AND `variable` = '#Hourly_Rewads_Check'");
  97. }
  98. message strcharinfo(0),"[Hourly Rewards]: you Gain your Reward.";
  99. callsub Hourly_Rewads;
  100. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  101. end;
  102.  
  103. OnHourlyBan:
  104. if(!#Hourly_Ban){
  105. message strcharinfo(0),"[Hourly Rewards]: You did ban this char from the Hourly Rewards , Relogin to change that .";
  106. if(.s_GePard_ip){
  107. query_logsql("delete from `sader_variables_log` where `variable` = '#Hourly_Rewads_Check' AND `account_id`= '"+getcharid(3)+"'");
  108. }
  109. #Hourly_Rewads_Check = 0;
  110. #Hourly_Ban = 1;
  111. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  112. }
  113. end;
  114.  
  115. OnUnHourlyBan:
  116. #Hourly_Ban = 0;
  117. end;
  118. OnPCLogoutEvent:
  119. if(.s_GePard_ip){
  120. query_logsql("delete from `sader_variables_log` where `variable` = '#Hourly_Rewads_Check' AND `account_id`= '"+getcharid(3)+"'");
  121. }
  122. if(#Hourly_Ban == 1){
  123. #Hourly_Ban = 0;
  124. }
  125. #Hourly_Rewads_Check = 0;
  126. end;
  127.  
  128. OnPCLoginEvent:
  129. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  130. end;
  131.  
  132. OnInit:
  133. .s_idle = 0; // ban hourly rewards from idle players ? 0 no / 1 yes {if player didn't move for x time he wont get hourly reward} , DEFAULT = 0
  134. .s_idle_time = 1800; // this the time for idle in secend , DEFAULT = 1800 (30 min)
  135. .s_vip = 0; // 1 = only for VIP / 0 = for everyone , DEFAULT = 0
  136. .s_time = 3600000; // 1000 = 1 secend | 60000 = 1 min | 3600000 = 1 houre , DEFAULT = 3600000 (1 hr)
  137. .s_hourly_level = 0; // Minimam level to get the Houerly rewards / 0 = no minimem level , DEFAULT 0
  138. .s_GePard_ip = 0; // 0 = no Gepard / 1 = Gepard / 2 = IP , DEFAULT 0
  139. .s_vinding = 7; // DEFAULT 7 / 0 = will give the reward even if vending / 1 = no normal vending / 2 = no @autotrade / 4 = no buyingstore | Example: if you want to ban normal vend and buying store you add the numbers 1+4=5
  140. query_logsql("CREATE TABLE IF NOT EXISTS `sader_variables_log` (`unique_id` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0',`ip` VARCHAR(100) NOT NULL,`variable` VARCHAR(32) NOT NULL, `index` INT NOT NULL, `value` INT NOT NULL,`account_id` INT NOT NULL,`char_id` INT NOT NULL,`char_name` VARCHAR(30) NOT NULL) ENGINE=MyISAM");
  141. bindatcmd("UnHourlyBan",strnpcinfo(3)+"::OnUnHourlyBan",99,99);
  142. bindatcmd("HourlyBan",strnpcinfo(3)+"::OnHourlyBan",0,99);
  143. end;
  144.  
  145. Hourly_Rewads:
  146. //put the Hourly Rewards here
  147. #HourlyRewads += 10;
  148. message strcharinfo(0),"Você ganhou 10 pontos de presença. Total: "+F_InsertComma(#HourlyRewads)+".";
  149. //getitem 905,1; // if you want to add items as reward you can add them here like that
  150. //getexp 10000,5000; // if you wanna add exp as reward add them here like that
  151. //if(#Hourly_Rewads_Check == 5){getitem 905,1;} // like this you can add reward for Xhr and this reward will be given for that X in this example 5 mean that the player did pass 5hr
  152. //if(#Hourly_Rewads_Check >= 5){getitem 905,1;} // like this you can add reward for Xhr and this reward will be given for that X in this example 5 mean that the player did pass 5hr or more
  153. return;
  154. }
  155. prontera,150,178,6 pointshop Presença Shop 667,#HourlyRewads,31499:80,22534:10,12539:5,666:30
  156. //<ITEM_ID>:<PRICE>,<ITEM_ID>:<PRICE>,<ITEM_ID>:<PRICE>,<ITEM_ID>:<PRICE>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement