yuhsing

Untitled

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