yuhsing

Untitled

Nov 10th, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.36 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. query_sql( "SELECT `status` FROM `E-Freebies` WHERE `account_id` = '"+getcharid(3)+"'",.@Status );
  29. switch( .@Status ){
  30. Case 0:
  31. mes "[ ^66CC66Freebies^000000 ]";
  32. mes "Do you want to apply for freebies?, you need to register your name here!";
  33. input .@Name$;
  34. if( .@Name$ == strcharinfo(0) ){
  35. mes " ";
  36. mes "Thanks you are now registered to our freebies system!";
  37. query_sql( "SELECT `last_ip` FROM `login` WHERE `account_id`='"+getcharid(3)+"'",.@IP$ );
  38. query_sql( "INSERT INTO `E-Freebies` VALUES ( '"+getcharid(3)+"','"+strcharinfo(0)+"','1','1','"+.@IP$+"' )" );
  39. next;
  40. mes "[ ^66CC66Freebies^000000 ]";
  41. 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.";
  42. for( set .@i,0; .@i < getarraysize( .Freebies1 ) - 1; set .@i,.@i + 2 )
  43. getitem .Freebies1[.@i],.Freebies1[.@i+1];
  44. addtimer 60000,strnpcinfo(0)+"::OnMinuteCheck";
  45. next;
  46. mes "[ ^66CC66Freebies^000000 ]";
  47. mes "Remember 24 hours playing without ^FF0000Vending^000000 will receive another Pack!";
  48. }else{
  49. mes "You can't register any other person than yourself in this System.";
  50. }
  51. break;
  52. Case 1:
  53. query_sql( "SELECT `time` FROM `E-Freebies` WHERE `account_id` = '"+getcharid(3)+"'",.@OnlineTime );
  54. if( .@OnlineTime < 86400 ){
  55. mes "[ ^66CC66Freebies^000000 ]";
  56. 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.";
  57. }else{
  58. mes "[ ^66CC66Freebies^000000 ]";
  59. mes "It looks like you've that your freebies quests verywell, i would like you to give a warm welcome!";
  60. if( select("Claim Freebies:Maybe Later....") == 1 ){
  61. announce "[StrikeRO Notification]: Let us give a warm welcome to our newest player, "+strcharinfo(0)+"!",8;
  62. for( set .@i,0; .@i < getarraysize( .Freebies1 ) - 1; set .@i,.@i + 2 )
  63. getitem .Freebies2[.@i],.Freebies2[.@i+1];
  64. query_sql( "SELECT `last_ip` FROM `login` WHERE `account_id`='"+getcharid(3)+"'",.@IP$ );
  65. query_sql("UPDATE `E-Freebies` SET `status`='2',`last_ip`='"+.@IP$+"' WHERE `account_id`='"+getcharid(3)+"'");
  66. }
  67. }
  68. break;
  69. Case 2:
  70. mes "[ ^66CC66Freebies^000000 ]";
  71. mes "You have collected all the freebies.";
  72. break;
  73. Case 3:
  74. mes "[ ^66CC66Freebies^000000 ]";
  75. mes "Your Freebies Application has been denied.";
  76. default: break;
  77. }
  78. break;
  79. Case 3:
  80. query_sql( "SELECT `name`,`status` FROM `E-Freebies` WHERE `status`<> 2 ORDER BY `status` ASC LIMIT 100",.@Name$,.@Status );
  81. mes "[ ^66CC66Freebies^000000 ]";
  82. mes "These are the player who have apply for freebies package but not yet completed.";
  83. mes "Total of "+getarraysize( .@Name$ )+" Records found.";
  84. if( getarraysize( .@Name$ ) <= 0 ) close;
  85. for( set .@i,0; .@i < getarraysize( .@Name$ ); set .@i,.@i + 1 )
  86. set .@Menu$,.@Menu$ +( ( .@Status[.@i] == 1 )?"^00EE55[ Pending ]":( .@Status[.@i] == 3 )?"^FF0000[ Denied ]":"^0055FF[ Approved ]" )+"^000000 "+.@Name$[.@i]+"^000000"+":";
  87. next;
  88. set .@i,( select( .@Menu$ ) - 1 );
  89. mes "[ ^66CC66Freebies^000000 ]";
  90. mes "Player Name : ^0055FF"+.@Name$[.@i]+"^000000";
  91. mes "Status : "+( ( .@Status[.@i] == 1 )?"^00EE55[ PENDING ]":( .@Status[.@i] == 3 )?"^FF0000[ DENIED ]":"^0055FF[ APPROVED ]" )+"^000000";
  92. set .@Option,select( ( .@Status[.@i] != 2 )?"Approve Application":"",( .@Status[.@i] == 1 )?"Deny Application":"",( .@Status[.@i] == 2 )?"":"Delete Application");
  93. switch( .@Option ){
  94. Case 1: query_sql("UPDATE `E-Freebies` SET `status`='1',`time`='86400' WHERE `name`='"+.@Name$[.@i]+"'"); break;
  95. Case 2: query_sql("UPDATE `E-Freebies` SET `status`='3',`time`='0' WHERE `name`='"+.@Name$[.@i]+"'"); break;
  96. Case 3: query_sql("DELETE FROM `E-Freebies` WHERE `name`='"+.@Name$[.@i]+"'"); break;
  97. }
  98. mes "Application ^0055FF"+( ( .@Option == 1 )?"Approved":( ( .@Option == 2 )?"Denied":"Deleted" ))+"^000000";
  99. if( isloggedin( .@ID[.@i] ) ){
  100. message .@Name$[.@i],"Your Freebies Packages has been "+( ( .@Option == 1 )?"Approved":( ( .@Option == 2 )?"Denied":"Deleted" ) )+" by GM '"+strcharinfo(0)+"'";
  101. }
  102. break;
  103. }
  104. close;
  105.  
  106. OnInit:
  107. set .GMLevel,90;
  108. // Freebies Pack 1
  109. setarray .Freebies1[0],504,100,504,100,12208,3,603,5,617,3;
  110. // Freebies Pack 2
  111. setarray .Freebies2[0],12186,1,675,10,12412,3,617,10,616,5,12221,1;
  112. end;
  113.  
  114.  
  115. OnMinuteCheck:
  116. if( !checkchatting() && !checkvending() )
  117. set @Online,@Online + 60;
  118. if( @Online >= 86400 ){
  119. message strcharinfo(0),"You have to online for 24 hours and you may get the freebies again.";
  120. }
  121. else
  122. addtimer 60000,strnpcinfo(0)+"::OnMinuteCheck";
  123. end;
  124.  
  125. OnPCLoginEvent:
  126. query_sql( "SELECT `status`,`time` FROM `E-Freebies` WHERE `account_id` = '"+getcharid(3)+"' AND `status`='1'",.@Status,@Online );
  127. if( @Online && @Online < 86400 ){
  128. addtimer 60000,strnpcinfo(0)+"::OnMinuteCheck";
  129. }
  130. end;
  131.  
  132. OnPCLogoutEvent:
  133. query_sql( "SELECT `time` FROM `E-Freebies` WHERE `account_id` = '"+getcharid(3)+"' AND `status`='1'",.@Online2 );
  134. if( @Online >= .@Online2 )
  135. query_sql( "UPDATE `E-Freebies` SET `time`='"+@Online+"' WHERE `account_id` = '"+getcharid(3)+"'" );
  136. end;
  137. }
Advertisement
Add Comment
Please, Sign In to add comment