yuhsing

Untitled

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