yuhsing

Untitled

Jan 8th, 2013
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.69 KB | None | 0 0
  1.  
  2.  
  3. volterra,107,150,3 script Freebies#E 871,{
  4. // prontera,155,181,3 script Freebies#E 871,{
  5. mes "[ ^66CC66Freebies^000000 ]";
  6. if( getgmlevel() >= .GMLevel )
  7. mes "Hello GM '"+strcharinfo(0)+"' Do you want to manage the Freebies Application?";
  8. else
  9. mes "How can i help you ?";
  10. next;
  11. switch( select( "Information",
  12. "Apply for Freebies",
  13. ( getgmlevel() < .GMLevel )?"":"^0055FF[ GM ]^000000 Manage Freebies" )){
  14. Case 1:
  15. mes "[ ^66CC66Freebies^000000 ]";
  16. mes "We have a unique freebies system, you will receive a 1st package in time, and when you complete the freebies quest and you will receive another freebies which is more convenience and a warm welcome to the server!.";
  17. next;
  18. mes "[ ^66CC66Freebies^000000 ]";
  19. mes "You can ^FF0000only register once and apply one character per account^000000 some of the items are not tradable.";
  20. next;
  21. mes "[ ^66CC66Freebies^000000 ]";
  22. mes "^FF0000NOTE:^000000 If we found that your abusing this system all of your ^FF0000ACCOUNT^000000 will get punished.";
  23. break;
  24. Case 2:
  25.  
  26. query_sql( "SELECT `status` FROM `e-freebies` WHERE `account_id` = '"+getcharid(3)+"'",.@Status );
  27. switch( .@Status ){
  28. Case 0:
  29.  
  30. query_sql( "SELECT COUNT(`last_ip`) FROM `e-freebies` WHERE `last_ip` = ( SELECT `last_ip` FROM `login` WHERE `account_id`='"+getcharid(3)+"' ) ",.@IP );
  31.  
  32. if( .@IP >= .MaxIPUsage ){
  33. mes "Seem like you are trying to abuse this System with different account?";
  34. mes "^FF0000Maximum "+.MaxIPUsage+" Per IP Only.^000000";
  35. close;
  36. }
  37.  
  38. mes "[ ^66CC66Freebies^000000 ]";
  39. mes "Do you want to apply for freebies?, you need to register your name here!";
  40. input .@Name$;
  41. if( .@Name$ == strcharinfo(0) ){
  42. mes " ";
  43. mes "Thanks you are now registered to our freebies system!";
  44. query_sql( "SELECT `last_ip` FROM `login` WHERE `account_id`='"+getcharid(3)+"'",.@IP$ );
  45. query_sql( "INSERT INTO `e-freebies` VALUES ( '"+getcharid(3)+"','"+strcharinfo(0)+"','1','1','"+.@IP$+"' )" );
  46. next;
  47. mes "[ ^66CC66Freebies^000000 ]";
  48. mes "Here is your freebies, when you spent ^FF0000another 3 hours^000000 playing, you will receive the 2nd package that contains alot more that you get.";
  49. for( set .@i,0; .@i < getarraysize( .Freebies1 ) - 1; set .@i,.@i + 2 )
  50. getitem .Freebies1[.@i],.Freebies1[.@i+1];
  51. addtimer 60000,strnpcinfo(0)+"::OnMinuteCheck";
  52. next;
  53. mes "[ ^66CC66Freebies^000000 ]";
  54. mes "Remember 3 hours playing without ^FF0000Vending^000000 will receive another Pack!";
  55. }else{
  56. mes "You can't register any other person than yourself in this System.";
  57. }
  58. break;
  59. Case 1:
  60. query_sql( "SELECT `time` FROM `e-freebies` WHERE `account_id` = '"+getcharid(3)+"'",.@OnlineTime );
  61. if( .@OnlineTime < 10800 ){
  62. mes "[ ^66CC66Freebies^000000 ]";
  63. mes "You've been online for ^0055FF"+( .@OnlineTime / 3600 )+"^000000 hours and you have about ^FF0000"+( ( 10800 - .@OnlineTime ) / 3600 )+"^000000 hours left! to get the special package.";
  64. }else{
  65. mes "[ ^66CC66Freebies^000000 ]";
  66. mes "It looks like you've that your freebies quests verywell, i would like you to give a warm welcome!";
  67. if( select("Claim Freebies:Maybe Later....") == 1 ){
  68. announce "[StrikeRO Notification]: Let us give a warm welcome to our newest player, "+strcharinfo(0)+"!",8;
  69. for( set .@i,0; .@i < getarraysize( .Freebies1 ) - 1; set .@i,.@i + 2 )
  70. getitem .Freebies2[.@i],.Freebies2[.@i+1];
  71. query_sql( "SELECT `last_ip` FROM `e-freebies` WHERE `account_id`='"+getcharid(3)+"'",.@IP$ );
  72. query_sql("UPDATE `e-freebies` SET `status`='2',`last_ip`='"+.@IP$+"' WHERE `account_id`='"+getcharid(3)+"'");
  73. }
  74. }
  75. break;
  76. Case 2:
  77. mes "[ ^66CC66Freebies^000000 ]";
  78. mes "You have collected all the freebies.";
  79. break;
  80. Case 3:
  81. mes "[ ^66CC66Freebies^000000 ]";
  82. mes "Your Freebies Application has been denied.";
  83. default: break;
  84. }
  85. break;
  86. Case 3:
  87. query_sql( "SELECT `name`,`status` FROM `e-freebies` WHERE `status` = 1 ORDER BY `status` ASC LIMIT 120",.@Name$,.@Status );
  88. set .@size,getarraysize( .@Name$ );
  89.  
  90. do{
  91. mes "[ ^66CC66Freebies^000000 ]";
  92. mes "These are the player who have apply for freebies package but not yet completed.";
  93. if( .@size <= 0 ) close;
  94.  
  95. set .@max_limit,( ( .@page + 1 ) * .PageLimit );
  96. if( .@max_limit > .@size )
  97. set .@max_limit,.@size;
  98.  
  99. mes "^0055FFRecord Index : "+( .@page * .PageLimit )+" ~ "+.@max_limit+"^000000";
  100. mes "^0055FFTotal Record : "+.@size+"^000000";
  101. set .@Menu$,"";
  102. for( set .@i,( .@page * .PageLimit ); .@i < .@max_limit; set .@i,.@i + 1 )
  103. set .@Menu$,.@Menu$ +( ( .@Status[.@i] == 1 )?"^00EE55[ Pending ]":( .@Status[.@i] == 3 )?"^FF0000[ Denied ]":"^0055FF[ Approved ]" )+"^000000 "+.@Name$[.@i]+"^000000"+":";
  104. if( .@max_limit < .@size ) set .@Menu$,.@Menu$ + "Next Page";
  105. next;
  106. set .@i,( select( .@Menu$ ) - 1 );
  107. set .@page,.@page + 1;
  108.  
  109. }while( .@i % .PageLimit == 0 );
  110.  
  111. set .@i,( .@i + ( .@page - 1 ) * .PageLimit );
  112.  
  113. mes "[ ^66CC66Freebies^000000 ]";
  114. mes "Player Name : ^0055FF"+.@Name$[.@i]+"^000000";
  115. mes "Status : "+( ( .@Status[.@i] == 1 )?"^00EE55[ PENDING ]":( .@Status[.@i] == 3 )?"^FF0000[ DENIED ]":"^0055FF[ APPROVED ]" )+"^000000";
  116. set .@Option,select( ( .@Status[.@i] != 2 )?"Approve Application":"",( .@Status[.@i] == 1 )?"Deny Application":"",( .@Status[.@i] == 2 )?"":"Delete Application");
  117. switch( .@Option ){
  118. Case 1: query_sql("UPDATE `e-freebies` SET `status`='1',`time`='10800' WHERE `name`='"+.@Name$[.@i]+"'"); break;
  119. Case 2: query_sql("UPDATE `e-freebies` SET `status`='3',`time`='0' WHERE `name`='"+.@Name$[.@i]+"'"); break;
  120. Case 3: query_sql("DELETE FROM `e-freebies` WHERE `name`='"+.@Name$[.@i]+"'"); break;
  121. }
  122. mes "Application ^0055FF"+( ( .@Option == 1 )?"Approved":( ( .@Option == 2 )?"Denied":"Deleted" ))+"^000000";
  123. if( isloggedin( .@ID[.@i] ) ){
  124. message .@Name$[.@i],"Your Freebies Packages has been "+( ( .@Option == 1 )?"Approved":( ( .@Option == 2 )?"Denied":"Deleted" ) )+" by GM '"+strcharinfo(0)+"'";
  125. }
  126. break;
  127. }
  128. close;
  129.  
  130.  
  131. OnInit:
  132. // GM Level
  133. set .GMLevel,80;
  134. // IP Limitation
  135. set .MaxIPUsage,3;
  136. // Max List per page
  137. set .PageLimit,30;
  138. // Freebies Pack 1
  139. setarray .Freebies1[0],14533,3,14232,5,20515,5,12210,3;
  140. // Freebies Pack 2
  141. setarray .Freebies2[0],20107,1,20103,5,14545,3,20108,1;
  142. end;
  143.  
  144. OnMinuteCheck:
  145. if( !checkchatting() && !checkvending() )
  146. set @Online,@Online + 60;
  147. if( @Online >= 10800 ){
  148. message strcharinfo(0),"You have to online for 3 hours and you may get the second package again.";
  149. }
  150. else
  151. addtimer 60000,strnpcinfo(0)+"::OnMinuteCheck";
  152. end;
  153.  
  154. OnPCLoginEvent:
  155. query_sql( "SELECT `status`,`time` FROM `e-freebies` WHERE `account_id` = '"+getcharid(3)+"' AND `status`='1'",.@Status,@Online );
  156. if( @Online && @Online < 10800 ){
  157. addtimer 60000,strnpcinfo(0)+"::OnMinuteCheck";
  158. }
  159. end;
  160.  
  161. OnPCLogoutEvent:
  162. query_sql( "SELECT `time` FROM `e-freebies` WHERE `account_id` = '"+getcharid(3)+"' AND `status`='1'",.@Online2 );
  163. if( @Online >= .@Online2 )
  164. query_sql( "UPDATE `e-freebies` SET `time`='"+@Online+"' WHERE `account_id` = '"+getcharid(3)+"'" );
  165. end;
  166. }
  167.  
  168. // --- new player -- //
  169.  
  170. - script Freebies -1,{
  171. OnGet:
  172. if(countitem(20107) < 1) {
  173. message strcharinfo(0),"@newplayer failed. You must have freebies ticket in your inventory.";
  174. close;
  175. } else {
  176. message strcharinfo(0),"There you go! you receive an items from the GM Team, enjoy your freebies and recruit more players! remember to vote every 12 hours.";
  177. delitem 20107,1;
  178. getitem 30096,1;
  179. getitem 30097,1;
  180. getitem 30098,1;
  181. getitem 30099,1;
  182. getitem 30100,1;
  183. close;
  184. }
  185. }
Advertisement
Add Comment
Please, Sign In to add comment