Jump to content

Question

Posted

this is the script

-	script	Haze2	-1,{
Onitemrain:
	.@itemid = atoi( .@atcmd_parameters$ );
	if ( getitemname( .@itemid ) == "null" ) {
		message strcharinfo(0), "Invalid Item ID";
		end;
	}
	.@area = getbattleflag("area_size");
	getmapxy .@map$, .@x, .@y, 0;
	while ( .@i < 100 ) {
		makeitem .@itemid, 1, .@map$, .@x + rand( -.@area, .@area ), .@y + rand( -.@area, .@area );
		.@i++;
	}
	end;
OnInit:
	bindatcmd "itemrain", strnpcinfo(0) +"::Onitemrain", 60,100;
	end;
}

So who do I use it @itemrain ID  but I will gladly   @itemrain ID  item number 1-100 

4 answers to this question

Recommended Posts

Posted


- script Haze2 -1,{

Onitemrain:

.@itemid = atoi( .@atcmd_parameters$ );

.@amount = atoi( .@atcmd_parameters$[1] );

if ( getitemname( .@itemid ) == "null" ) {

message strcharinfo(0), "Invalid Item ID";

end;

}

if ( .@amount <= 0 || .@amount > 100 )

.@amount = 100;

.@area = getbattleflag("area_size");

getmapxy .@map$, .@x, .@y, 0;

while ( .@i < .@amount ) {

do {

.@dx = rand( -.@area, .@area );

.@dy = rand( -.@area, .@area );

} while( !checkcell( .@map$,(.@x+.@dx),(.@y+.@dy),cell_chkpass ) );

makeitem .@itemid, 1, .@map$, .@x + .@dx, .@y + dy;

.@i++;

}

end;

OnInit:

bindatcmd "itemrain", strnpcinfo(0) +"::Onitemrain", 60,100;

end;

}

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...