Jump to content
  • 0

bindatcmd Help


EL Dragon

Question


  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  

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 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


- 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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  

but it does drop the item in a line , not random 

 

screenro015g5lx2s7d4v.jpg

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

there is a mistake

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

should be

makeitem .@itemid, 1, .@map$, .@x + .@dx, .@y + .@dy;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  

thx Capuche for the help :D

Link to comment
Share on other sites

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.

×
×
  • Create New...