Advertisement
Guest User

Untitled

a guest
Feb 8th, 2019
452
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. //============================================================
  28. //==== 1.1 FIX Critical issue with gepard/ip and compatibility with my other scripts
  29. //==== 1.2 FIX GrPard Variable
  30. //============================================================
  31. - script sader_Hourly_Rewards -1,{
  32.  
  33. OnHourlyRewards:
  34. if(#Hourly_Ban){
  35. message strcharinfo(0),"[Hourly Rewards]: You did ban this char from the Hourly Rewards , Relogin to change that .";
  36. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  37. end;
  38. }
  39. if(.s_idle){
  40. if(checkidle() > .s_idle_time){
  41. message strcharinfo(0),"[Hourly Rewards]: No Hourly Rewards for IDLE Players!.";
  42. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  43. end;
  44. }
  45. }
  46. if(.s_vip){
  47. if(!vip_status(VIP_STATUS_ACTIVE)){
  48. message strcharinfo(0),"[Hourly Rewards]: if you are a VIP you will get Hourly Rewards!.";
  49. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  50. end;
  51. }
  52. }
  53. if(BaseLevel < .s_hourly_level){
  54. message strcharinfo(0),"[Hourly Rewards]: if you are level "+.s_hourly_level+" and more you will get Hourly Rewards!.";
  55. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  56. end;
  57. }
  58. if(.s_vinding){
  59. if(checkvending() & .s_vinding){
  60. message strcharinfo(0),"[Hourly Rewards]: No Hourly Rewards for Venders , Relogin to change that .";
  61. if(.s_GePard_ip){
  62. query_logsql("delete from `sader_variables_log` where `variable` = '#Hourly_Rewads_Check' AND `account_id`= '"+getcharid(3)+"'");
  63. }
  64. #Hourly_Rewads_Check = 0;
  65. #Hourly_Ban = 1;
  66. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  67. end;
  68. }
  69. }
  70. #Hourly_Rewads_Check += 1;
  71. if(.s_GePard_ip == 1){
  72. query_sql("SELECT `last_unique_id` FROM `login` WHERE `account_id` = '"+getcharid(3)+"'", .@s_last_unique_id$);
  73. query_logsql("SELECT value FROM `sader_variables_log` WHERE unique_id = '"+.@s_last_unique_id$+"' AND `variable` = '#Hourly_Rewads_Check'", .@s_GePard);
  74. if(.@s_GePard >= #Hourly_Rewads_Check){
  75. message strcharinfo(0),"[Hourly Rewards]: You already got the Hourly Rewards from this PC";
  76. #Hourly_Rewads_Check -= 1;
  77. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  78. end;
  79. }
  80. if(.@s_GePard == 0){
  81. 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)+"')");
  82. }
  83. query_logsql("Update `sader_variables_log` SET `value` = '"+#Hourly_Rewads_Check+"' WHERE `unique_id`= '"+.@s_last_unique_id$+"' AND `variable` = '#Hourly_Rewads_Check'");
  84. }else if(.s_GePard_ip == 2){
  85. query_logsql("SELECT value FROM `sader_variables_log` WHERE ip = '"+getcharip()+"' AND `variable` = '#Hourly_Rewads_Check'", .@s_ip);
  86. if(.@s_ip >= #Hourly_Rewads_Check){
  87. message strcharinfo(0),"[Hourly Rewards]: You already got the Hourly Rewards from this IP";
  88. #Hourly_Rewads_Check -= 1;
  89. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  90. end;
  91. }
  92. if(.@s_ip == 0){
  93. 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)+"')");
  94. }
  95. query_logsql("Update `sader_variables_log` SET `value` = '"+#Hourly_Rewads_Check+"' WHERE `ip`= '"+getcharip()+"' AND `variable` = '#Hourly_Rewads_Check'");
  96. }
  97. message strcharinfo(0),"[Hourly Rewards]: you Gain your Reward.";
  98. callsub Hourly_Rewads;
  99. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  100. end;
  101.  
  102. OnHourlyBan:
  103. if(!#Hourly_Ban){
  104. message strcharinfo(0),"[Hourly Rewards]: You did ban this char from the Hourly Rewards , Relogin to change that .";
  105. if(.s_GePard_ip){
  106. query_logsql("delete from `sader_variables_log` where `variable` = '#Hourly_Rewads_Check' AND `account_id`= '"+getcharid(3)+"'");
  107. }
  108. #Hourly_Rewads_Check = 0;
  109. #Hourly_Ban = 1;
  110. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  111. }
  112. end;
  113.  
  114. OnUnHourlyBan:
  115. #Hourly_Ban = 0;
  116. end;
  117. OnPCLogoutEvent:
  118. if(.s_GePard_ip){
  119. query_logsql("delete from `sader_variables_log` where `variable` = '#Hourly_Rewads_Check' AND `account_id`= '"+getcharid(3)+"'");
  120. }
  121. if(#Hourly_Ban == 1){
  122. #Hourly_Ban = 0;
  123. }
  124. #Hourly_Rewads_Check = 0;
  125. end;
  126.  
  127. OnPCLoginEvent:
  128. addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
  129. end;
  130.  
  131. OnInit:
  132. .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
  133. .s_idle_time = 1800; // this the time for idle in secend , DEFAULT = 1800 (30 min)
  134. .s_vip = 0; // 1 = only for VIP / 0 = for everyone , DEFAULT = 0
  135. .s_time = 3600000; // 1000 = 1 secend | 60000 = 1 min | 3600000 = 1 houre , DEFAULT = 3600000 (1 hr)
  136. .s_hourly_level = 0; // Minimam level to get the Houerly rewards / 0 = no minimem level , DEFAULT 0
  137. .s_GePard_ip = 0; // 0 = no Gepard / 1 = Gepard / 2 = IP , DEFAULT 0
  138. .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
  139. 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");
  140. bindatcmd("UnHourlyBan",strnpcinfo(3)+"::OnUnHourlyBan",99,99);
  141. bindatcmd("HourlyBan",strnpcinfo(3)+"::OnHourlyBan",0,99);
  142. end;
  143.  
  144. Hourly_Rewads:
  145. //put the Hourly Rewards here
  146. #HourlyRewads += 10;
  147. message strcharinfo(0),"Você ganhou 10 pontos de presença. Total: "+F_InsertComma(#HourlyRewads)+".";
  148. //getitem 905,1; // if you want to add items as reward you can add them here like that
  149. //getexp 10000,5000; // if you wanna add exp as reward add them here like that
  150. //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
  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 or more
  152. return;
  153. }
  154. prontera,150,178,6 pointshop Presença Shop 667,#HourlyRewads,31499:80,22534:10,12539:5,666:30
  155. //<ITEM_ID>:<PRICE>,<ITEM_ID>:<PRICE>,<ITEM_ID>:<PRICE>,<ITEM_ID>:<PRICE>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement