yuhsing

Untitled

Nov 13th, 2012
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.62 KB | None | 0 0
  1.  
  2.  
  3. prontera,146,170,5 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) < 2000100 && getgmlevel() < .GMLevel ){
  25. mes "Sorry you already have it.";
  26. close;
  27. }
  28. if( query_sql( "SELECT `last_ip` FROM `login` WHERE `account_id`='"+getcharid(3)+"'",.@IP$ ) >= .MaxIPUsage ){
  29. mes "Seem like you are trying to abuse this System with different account ?";
  30. close;
  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 24 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 24 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 < 86400 ){
  59. mes "[ ^66CC66Freebies^000000 ]";
  60. mes "You've been online for ^0055FF"+( .@OnlineTime / 3600 )+"^000000 hours and you have about ^FF0000"+( ( 86400 - .@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 `login` 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`='86400' 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. OnInit:
  111. // GM Level
  112. set .GMLevel,90;
  113. // IP Limitation
  114. set .MaxIPUsage,1;
  115. // Freebies Pack 1
  116. setarray .Freebies1[0],504,100,504,100,12208,3,603,5,617,3;
  117. // Freebies Pack 2
  118. setarray .Freebies2[0],12186,1,675,10,12412,3,617,10,616,5,12221,1;
  119. end;
  120.  
  121.  
  122. OnMinuteCheck:
  123. if( !checkchatting() && !checkvending() )
  124. set @Online,@Online + 60;
  125. if( @Online >= 86400 ){
  126. message strcharinfo(0),"You have to online for 24 hours and you may get the freebies 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 < 86400 ){
  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. }
Advertisement
Add Comment
Please, Sign In to add comment