yuhsing

Untitled

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