- script Sample -1,{
function GenerateCode;
OnPCLoadMapEvent:
for( set .@i,0; .@i < getarraysize( .Map$ ); set .@i,.@i + 1 )
if( strcharinfo(3) == .Map$[.@i] ){
//set .@GeneratedCode$,GenerateCode( <Bitmask>,<Length> );
set .@GeneratedCode$,GenerateCode( 7,5 );
mes "Please input the ^FF0000RED COLOR^000000 words.";
mes GenerateCode( 7,rand(1,10) )+"^FF0000"+.@GeneratedCode$+"^000000"+GenerateCode( 7,rand(1,10) );
input .@Input$;
if( .@Input$ != .@GeneratedCode$ ){
mes "You entered Wrong Code.";
close2;
warp "prontera",155,181;
end;
}
break;
}
close;
OnInit:
// List Of Maps
setarray .Map$,"prontera","payon","izlude","aldebaran";
for( set .@i,0; .@i < getarraysize( .Map$ ); set .@i,.@i + 1 )
setmapflag .Map$[.@i],mf_loadevent;
end;
function GenerateCode {
if( getarg(0) & 1 ) setarray .@Word$[ getarraysize( .@Word$ ) ],"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z";
if( getarg(0) & 2 ) setarray .@Word$[ getarraysize( .@Word$ ) ],"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z";
if( getarg(0) & 4 ) setarray .@Word$[ getarraysize( .@Word$ ) ],"0","1","2","3","4","5","6","7","8","9";
if( getarg(0) & 8 ) setarray .@Word$[ getarraysize( .@Word$ ) ],"~","!","@","#","$","%","^","&","*","*","(",")","_","+","-","?",">","<";
do{
set .@Random$,.@Random$ + .@Word$[ rand( getarraysize( .@Word$ ) ) ];
}while( getstrlen( .@Random$ ) < getarg(1) );
return .@GeneratedCode$;
}
}