yuhsing

Untitled

Nov 26th, 2012
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1.  
  2.  
  3. prontera,155,181,5 script Sample#grab_candy 757,{
  4. if( .status == 0 ){
  5. mes "No Event right now..";
  6. }else if( .status == 2 ){
  7. mes "Event is running...";
  8. }else{
  9. warp .Map$,0,0;
  10. .player$[ getarraysize( .player$ ) ] = strcharinfo(0);
  11. }
  12. close;
  13.  
  14. OnPCLoginEvent:
  15. if( .status ){
  16. .@size = getarraysize( .player$ );
  17. for( .@i = 0; .@i < .@size; .@i++ )
  18. if( .player$[.@i] == strcharinfo(0) )
  19. deletearray .player$[.@i],1;
  20. }
  21. end;
  22.  
  23. // OnWhisperGlobal:
  24. OnMinute00:
  25. .status = 1;
  26. hideoffnpc strnpcinfo(0);
  27. deletearray .player$,getarraysize( .player$ );
  28. announce "Grab Candy event started...you have 1 minutes to register..",0;
  29. sleep ( 60 * 1000 );
  30. .status = 2;
  31. sleep 3000;
  32. mapannounce .Map$,"Event will start now...pick as many as you can.....start within 5 seconds.",0;
  33. sleep 5000;
  34. mapannounce .Map$,"PICK AS MANY AS YOU WANT TO WIN ...within 10 seconds.",0;
  35.  
  36. .@time = 0;
  37. // Drop items for 10 seconds ( 50ms * 200 = 10 seconds ) every 50 miliseconds...
  38. while( .@time < 200 ){
  39. makeitem .ItemID,1,.Map$,rand(24,35),rand(24,35);
  40. sleep 50;
  41. .@time++;
  42. }
  43. mapannounce .Map$,"Event End .....",0;
  44.  
  45. // Count Candy ....
  46. .@size = getarraysize( .player$ );
  47. .@i = 0;
  48. .@MaxCandy = 0;
  49. while( .@i < .@size ){
  50. if( attachrid( getcharid( 3,.player$[.@i] ) ) )
  51. if( countitem( .ItemID ) > .@MaxCandy ){
  52. .@MaxCandy = countitem( .ItemID );
  53. delitem .ItemID,countitem( .ItemID );
  54. }
  55. .@i++;
  56. }
  57.  
  58. // Reward Users ....
  59. .@i = 0;
  60. while( .@i < .@size ){
  61. if( attachrid( getcharid( 3,.player$[.@i] ) ) )
  62. if( countitem( .ItemID ) == .@MaxCandy ){
  63. mapannounce .Map$,"Event End ...highest candy holder is "+strcharinfo(0)+" with "+.@MaxCandy+"ea "+getitemname( .ItemID )+"..",0;
  64. getitem 512,100;
  65. getitem 909,100;
  66. }
  67. .@i++;
  68. }
  69. sleep 3000;
  70. mapwarp .Map$,"prontera",155,181;
  71.  
  72.  
  73. OnInit:
  74. hideonnpc strnpcinfo(0);
  75. .status = 0;
  76. .Map$ = "job3_arch01";
  77. .ItemID = 529;
  78. end;
  79. }
Advertisement
Add Comment
Please, Sign In to add comment