Advertisement
Guest User

Untitled

a guest
Aug 6th, 2019
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. - script Haze2 -1,{
  2.  
  3. Onitemrain:
  4.  
  5. .@itemid = atoi( .@atcmd_parameters$ );
  6.  
  7. .@amount = atoi( .@atcmd_parameters$[1] );
  8.  
  9. if ( getitemname( .@itemid ) == "null" ) {
  10.  
  11. message strcharinfo(0), "Invalid Item ID";
  12.  
  13. end;
  14.  
  15. }
  16.  
  17. if ( .@amount <= 0 || .@amount > 100 )
  18.  
  19. .@amount = 100;
  20.  
  21. .@area = getbattleflag("area_size");
  22.  
  23. getmapxy .@map$, .@x, .@y, BL_PC;
  24.  
  25. while ( .@i < .@amount ) {
  26.  
  27. do {
  28.  
  29. .@dx = rand( -.@area, .@area );
  30.  
  31. .@dy = rand( -.@area, .@area );
  32.  
  33. } while( !checkcell( .@map$,(.@x+.@dx),(.@y+.@dy),cell_chkpass ) );
  34.  
  35. makeitem .@itemid, 1, .@map$, .@x + .@dx, .@y + .@dy;
  36.  
  37. .@i++;
  38.  
  39. }
  40.  
  41. end;
  42.  
  43. OnInit:
  44.  
  45. bindatcmd "flooritem", strnpcinfo(0) +"::Onitemrain", 60,100;
  46.  
  47. end;
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement