yuhsing

Untitled

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