Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- prontera,155,181,5 script Sample#grab_candy 757,{
- if( .status == 0 ){
- mes "No Event right now..";
- }else if( .status == 2 ){
- mes "Event is running...";
- }else{
- warp .Map$,0,0;
- .player$[ getarraysize( .player$ ) ] = strcharinfo(0);
- }
- close;
- OnPCLoginEvent:
- if( .status ){
- .@size = getarraysize( .player$ );
- for( .@i = 0; .@i < .@size; .@i++ )
- if( .player$[.@i] == strcharinfo(0) )
- deletearray .player$[.@i],1;
- }
- end;
- // OnWhisperGlobal:
- OnMinute00:
- .status = 1;
- hideoffnpc strnpcinfo(0);
- deletearray .player$,getarraysize( .player$ );
- announce "Grab Candy event started...you have 1 minutes to register..",0;
- sleep ( 60 * 1000 );
- .status = 2;
- sleep 3000;
- mapannounce .Map$,"Event will start now...pick as many as you can.....start within 5 seconds.",0;
- sleep 5000;
- mapannounce .Map$,"PICK AS MANY AS YOU WANT TO WIN ...within 10 seconds.",0;
- .@time = 0;
- // Drop items for 10 seconds ( 50ms * 200 = 10 seconds ) every 50 miliseconds...
- while( .@time < 200 ){
- makeitem .ItemID,1,.Map$,rand(24,35),rand(24,35);
- sleep 50;
- .@time++;
- }
- mapannounce .Map$,"Event End .....",0;
- // Count Candy ....
- .@size = getarraysize( .player$ );
- .@i = 0;
- .@MaxCandy = 0;
- while( .@i < .@size ){
- if( attachrid( getcharid( 3,.player$[.@i] ) ) )
- if( countitem( .ItemID ) > .@MaxCandy ){
- .@MaxCandy = countitem( .ItemID );
- delitem .ItemID,countitem( .ItemID );
- }
- .@i++;
- }
- // Reward Users ....
- .@i = 0;
- while( .@i < .@size ){
- if( attachrid( getcharid( 3,.player$[.@i] ) ) )
- if( countitem( .ItemID ) == .@MaxCandy ){
- mapannounce .Map$,"Event End ...highest candy holder is "+strcharinfo(0)+" with "+.@MaxCandy+"ea "+getitemname( .ItemID )+"..",0;
- getitem 512,100;
- getitem 909,100;
- }
- .@i++;
- }
- sleep 3000;
- mapwarp .Map$,"prontera",155,181;
- OnInit:
- hideonnpc strnpcinfo(0);
- .status = 0;
- .Map$ = "job3_arch01";
- .ItemID = 529;
- end;
- }
Advertisement
Add Comment
Please, Sign In to add comment