Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- volterra,107,150,3 script Freebies#E 871,{
- // prontera,155,181,3 script Freebies#E 871,{
- mes "[ ^66CC66Freebies^000000 ]";
- if( getgmlevel() >= .GMLevel )
- mes "Hello GM '"+strcharinfo(0)+"' Do you want to manage the Freebies Application?";
- else
- mes "How can i help you ?";
- next;
- switch( select( "Information",
- "Apply for Freebies",
- ( getgmlevel() < .GMLevel )?"":"^0055FF[ GM ]^000000 Manage Freebies" )){
- Case 1:
- mes "[ ^66CC66Freebies^000000 ]";
- 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!.";
- next;
- mes "[ ^66CC66Freebies^000000 ]";
- mes "You can ^FF0000only register once and apply one character per account^000000 some of the items are not tradable.";
- next;
- mes "[ ^66CC66Freebies^000000 ]";
- mes "^FF0000NOTE:^000000 If we found that your abusing this system all of your ^FF0000ACCOUNT^000000 will get punished.";
- break;
- Case 2:
- query_sql( "SELECT `status` FROM `e-freebies` WHERE `account_id` = '"+getcharid(3)+"'",.@Status );
- switch( .@Status ){
- Case 0:
- query_sql( "SELECT COUNT(`last_ip`) FROM `e-freebies` WHERE `last_ip` = ( SELECT `last_ip` FROM `login` WHERE `account_id`='"+getcharid(3)+"' ) ",.@IP );
- if( .@IP >= .MaxIPUsage ){
- mes "Seem like you are trying to abuse this System with different account?";
- mes "^FF0000Maximum "+.MaxIPUsage+" Per IP Only.^000000";
- close;
- }
- mes "[ ^66CC66Freebies^000000 ]";
- mes "Do you want to apply for freebies?, you need to register your name here!";
- input .@Name$;
- if( .@Name$ == strcharinfo(0) ){
- mes " ";
- mes "Thanks you are now registered to our freebies system!";
- query_sql( "SELECT `last_ip` FROM `login` WHERE `account_id`='"+getcharid(3)+"'",.@IP$ );
- query_sql( "INSERT INTO `e-freebies` VALUES ( '"+getcharid(3)+"','"+strcharinfo(0)+"','1','1','"+.@IP$+"' )" );
- next;
- mes "[ ^66CC66Freebies^000000 ]";
- 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.";
- for( set .@i,0; .@i < getarraysize( .Freebies1 ) - 1; set .@i,.@i + 2 )
- getitem .Freebies1[.@i],.Freebies1[.@i+1];
- addtimer 60000,strnpcinfo(0)+"::OnMinuteCheck";
- next;
- mes "[ ^66CC66Freebies^000000 ]";
- mes "Remember 3 hours playing without ^FF0000Vending^000000 will receive another Pack!";
- }else{
- mes "You can't register any other person than yourself in this System.";
- }
- break;
- Case 1:
- query_sql( "SELECT `time` FROM `e-freebies` WHERE `account_id` = '"+getcharid(3)+"'",.@OnlineTime );
- if( .@OnlineTime < 10800 ){
- mes "[ ^66CC66Freebies^000000 ]";
- 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.";
- }else{
- mes "[ ^66CC66Freebies^000000 ]";
- mes "It looks like you've that your freebies quests verywell, i would like you to give a warm welcome!";
- if( select("Claim Freebies:Maybe Later....") == 1 ){
- announce "[StrikeRO Notification]: Let us give a warm welcome to our newest player, "+strcharinfo(0)+"!",8;
- for( set .@i,0; .@i < getarraysize( .Freebies1 ) - 1; set .@i,.@i + 2 )
- getitem .Freebies2[.@i],.Freebies2[.@i+1];
- query_sql( "SELECT `last_ip` FROM `e-freebies` WHERE `account_id`='"+getcharid(3)+"'",.@IP$ );
- query_sql("UPDATE `e-freebies` SET `status`='2',`last_ip`='"+.@IP$+"' WHERE `account_id`='"+getcharid(3)+"'");
- }
- }
- break;
- Case 2:
- mes "[ ^66CC66Freebies^000000 ]";
- mes "You have collected all the freebies.";
- break;
- Case 3:
- mes "[ ^66CC66Freebies^000000 ]";
- mes "Your Freebies Application has been denied.";
- default: break;
- }
- break;
- Case 3:
- query_sql( "SELECT `name`,`status` FROM `e-freebies` WHERE `status` = 1 ORDER BY `status` ASC LIMIT 120",.@Name$,.@Status );
- set .@size,getarraysize( .@Name$ );
- do{
- mes "[ ^66CC66Freebies^000000 ]";
- mes "These are the player who have apply for freebies package but not yet completed.";
- if( .@size <= 0 ) close;
- set .@max_limit,( ( .@page + 1 ) * .PageLimit );
- if( .@max_limit > .@size )
- set .@max_limit,.@size;
- mes "^0055FFRecord Index : "+( .@page * .PageLimit + 1 )+" ~ "+.@max_limit+"^000000";
- mes "^0055FFTotal Record : "+.@size+"^000000";
- set .@Menu$,"";
- for( set .@i,( .@page * .PageLimit ); .@i < .@max_limit; set .@i,.@i + 1 )
- set .@Menu$,.@Menu$ +( ( .@Status[.@i] == 1 )?"^00EE55[ Pending ]":( .@Status[.@i] == 3 )?"^FF0000[ Denied ]":"^0055FF[ Approved ]" )+"^000000 "+.@Name$[.@i]+"^000000"+":";
- if( .@max_limit < .@size ) set .@Menu$,.@Menu$ + "Next Page";
- next;
- set .@i,( select( .@Menu$ ) - 1 );
- set .@page,.@page + 1;
- }while( .@i % .PageLimit == 0 );
- set .@i,( .@i + ( .@page - 1 ) * .PageLimit );
- mes "[ ^66CC66Freebies^000000 ]";
- mes "Player Name : ^0055FF"+.@Name$[.@i]+"^000000";
- mes "Status : "+( ( .@Status[.@i] == 1 )?"^00EE55[ PENDING ]":( .@Status[.@i] == 3 )?"^FF0000[ DENIED ]":"^0055FF[ APPROVED ]" )+"^000000";
- set .@Option,select( ( .@Status[.@i] != 2 )?"Approve Application":"",( .@Status[.@i] == 1 )?"Deny Application":"",( .@Status[.@i] == 2 )?"":"Delete Application");
- switch( .@Option ){
- Case 1: query_sql("UPDATE `e-freebies` SET `status`='1',`time`='10800' WHERE `name`='"+.@Name$[.@i]+"'"); break;
- Case 2: query_sql("UPDATE `e-freebies` SET `status`='3',`time`='0' WHERE `name`='"+.@Name$[.@i]+"'"); break;
- Case 3: query_sql("DELETE FROM `e-freebies` WHERE `name`='"+.@Name$[.@i]+"'"); break;
- }
- mes "Application ^0055FF"+( ( .@Option == 1 )?"Approved":( ( .@Option == 2 )?"Denied":"Deleted" ))+"^000000";
- if( isloggedin( .@ID[.@i] ) ){
- message .@Name$[.@i],"Your Freebies Packages has been "+( ( .@Option == 1 )?"Approved":( ( .@Option == 2 )?"Denied":"Deleted" ) )+" by GM '"+strcharinfo(0)+"'";
- }
- break;
- }
- close;
- OnInit:
- // GM Level
- set .GMLevel,80;
- // IP Limitation
- set .MaxIPUsage,3;
- // Max List per page
- set .PageLimit,30;
- // Freebies Pack 1
- setarray .Freebies1[0],14533,3,14232,5,20515,5,12210,3;
- // Freebies Pack 2
- setarray .Freebies2[0],20107,1,20103,5,14545,3,20108,1;
- end;
- OnMinuteCheck:
- if( !checkchatting() && !checkvending() )
- set @Online,@Online + 60;
- if( @Online >= 10800 ){
- message strcharinfo(0),"You have to online for 3 hours and you may get the second package again.";
- }
- else
- addtimer 60000,strnpcinfo(0)+"::OnMinuteCheck";
- end;
- OnPCLoginEvent:
- query_sql( "SELECT `status`,`time` FROM `e-freebies` WHERE `account_id` = '"+getcharid(3)+"' AND `status`='1'",.@Status,@Online );
- if( @Online && @Online < 10800 ){
- addtimer 60000,strnpcinfo(0)+"::OnMinuteCheck";
- }
- end;
- OnPCLogoutEvent:
- query_sql( "SELECT `time` FROM `e-freebies` WHERE `account_id` = '"+getcharid(3)+"' AND `status`='1'",.@Online2 );
- if( @Online >= .@Online2 )
- query_sql( "UPDATE `e-freebies` SET `time`='"+@Online+"' WHERE `account_id` = '"+getcharid(3)+"'" );
- end;
- }
- // --- new player -- //
- - script Freebies -1,{
- OnGet:
- if(countitem(20107) < 1) {
- message strcharinfo(0),"@newplayer failed. You must have freebies ticket in your inventory.";
- close;
- } else {
- 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.";
- delitem 20107,1;
- getitem 30096,1;
- getitem 30097,1;
- getitem 30098,1;
- getitem 30099,1;
- getitem 30100,1;
- close;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment