yuhsing

Untitled

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