Jump to content
  • 0
Sign in to follow this  
Luffy

[Request] Plugin @flooritem

Question

@flooritem <itemname/itemid> [quantity]

 

Drops item on the floor on a certain map.

 

 

its like the one i saw, Shower event. XD

Edited by Luffy

Share this post


Link to post
Share on other sites

15 answers to this question

Recommended Posts

  • 0

 

 

 

 

 

 

Isn't flooritem same as makeitem ?

 Hi mam Angelmelody is this like this? http://herc.ws/board/topic/2706-itemmap/

 

 

nope

 

 

it does not drop a certain amount of item on a map?

 

 

its no need to create plugin ,you can try bindatcmd then makeitem param param..... Edited by Angelmelody

Share this post


Link to post
Share on other sites
  • 0

 ok, I finished it ....you can add map by editing .dm$ array

 

-	script	test1235678	-1,{end;OnInit:	setarray .dm$,"prontera","prt_fild08";	.msize = getarraysize(.dm$);	bindatcmd "flooritem", strnpcinfo(0)+"::OnFI", 60,90; ;	end;OnFI:	.@hditemid = atoi(.@atcmd_parameters$[0]);    	.@damount = atoi(.@atcmd_parameters$[1]);	if ( !.@damount ) {		message strcharinfo(0), "@flooritem <Itemid or itemname> <amount>";		end;	}	if ( .@damount < 0 ) {		message strcharinfo(0), "@flooritem -> Invalid amount";		end;    	}	if ( getitemname(.@hditemid) == "null" && !searchitem(.@temp[0],.@atcmd_parameters$[0]) ) {		message strcharinfo(0), "@alootnoitem -> Invalid Item ID";		end;    	}	if(.@temp[0])		.@dropitemid = .@temp[0];	else		.@dropitemid = .@hditemid;	freeloop(1);	for(.@i=0;.@i<.msize;.@i++) {		for(.@j=0;.@j< .@damount;.@j++) {			while (checkcell(.dm$[.@i],.@x=rand(1, 512),.@y=rand(1, 512), cell_chknopass));			makeitem .@dropitemid,1,.dm$[.@i],.@x,.@y;		}	}	freeloop(0);    end;}

Share this post


Link to post
Share on other sites
  • 0


Wow i didnt know that it can be done like that. thanks angel let me try this.

DONE is working m/
 

 



P.S , how can i make it just drop on where im standing the for example i just @flooritem apple 10 .. it will scatter 10 apple on where am standing and as i increase the flooritem amount that the time it will go far to me. sorry for my english

Edited by Luffy

Share this post


Link to post
Share on other sites
  • 0

 

Wow i didnt know that it can be done like that. thanks angel let me try this.

 

DONE is working m/

 

 

P.S , how can i make it just drop on where im standing the for example i just @flooritem apple 10 .. it will scatter 10 apple on where am standing and as i increase the flooritem amount that the time it will go far to me. sorry for my english

try this...

-	script	test1235678	-1,{end;OnInit:	bindatcmd "flooritem", strnpcinfo(0)+"::OnFI", 60,90; ;	end;OnFI:	.@hditemid = atoi(.@atcmd_parameters$[0]);    	.@damount = atoi(.@atcmd_parameters$[1]);	if ( !.@damount ) {		message strcharinfo(0), "@flooritem <Itemid or itemname> <amount>";		end;	}	if ( .@damount < 0 ) {		message strcharinfo(0), "@flooritem -> Invalid amount";		end;    	}	if ( getitemname(.@hditemid) == "null" && !searchitem(.@temp[0],.@atcmd_parameters$[0]) ) {		message strcharinfo(0), "@alootnoitem -> Invalid Item ID";		end;    	}	if(.@temp[0])		.@dropitemid = .@temp[0];	else		.@dropitemid = .@hditemid;	.@r = (sqrt(.@damount) > 16 ? 16 :sqrt(.@damount));	getmapxy(.@m$,.@px,.@py,0);	.@min_x =((.@px-.@r) < 1?1:(.@px-.@r));	.@max_x =((.@px+.@r) > 512 ? 512:(.@px+.@r));	.@min_y =((.@py-.@r) < 1?1:(.@py-.@r));	.@max_y =((.@py+.@r) > 512 ? 512:(.@py+.@r));		freeloop(1);	for(.@j=0;.@j< .@damount;.@j++) {		while (checkcell(.dm$[.@i],.@dx=rand(.@min_x, .@max_x),.@dy=rand(.@min_y , .@max_y), cell_chknopass));		makeitem .@dropitemid,1,.@m$,.@dx,.@dy;	}	freeloop(0);    end;}
Edited by Angelmelody

Share this post


Link to post
Share on other sites
  • 0

Hi,

I've tried to use the script but i am getting an infinite loop error in my mapserver after executing the command

[Warning]: Unexpected type for argument 1. Expected number.[Debug]: Data: label pos=849[Debug]: Function: __jump_zero[Debug]: Source (NPC): test1235678 (invisible/not on a map)[Debug]: mapindex_name2id: Map "" not found in index list![Warning]: checkcell: Attempted to run on unexsitent map '', type 6, x/y 159,157

Share this post


Link to post
Share on other sites
  • 0

 

Hi,

 

I've tried to use the script but i am getting an infinite loop error in my mapserver after executing the command

 

[Warning]: Unexpected type for argument 1. Expected number.[Debug]: Data: label pos=849[Debug]: Function: __jump_zero[Debug]: Source (NPC): test1235678 (invisible/not on a map)[Debug]: mapindex_name2id: Map "" not found in index list![Warning]: checkcell: Attempted to run on unexsitent map '', type 6, x/y 159,157

you need change the map........................................

Share this post


Link to post
Share on other sites
  • 0

The issue is this right here:

while (checkcell(.dm$[.@i],.@dx=rand(.@min_x, .@max_x),.@dy=rand(.@min_y , .@max_y), cell_chknopass));

change to this:

while (checkcell(.@m$[.@i],.@px=rand(.@min_x, .@max_x),.@py=rand(.@min_y , .@max_y), cell_chknopass));

 

it was checking for a map using a variable that contained no data.

Share this post


Link to post
Share on other sites
  • 0

Okay i found solution to make it work

needed to change dx and dy into px and py

while (checkcell(.@m$[.@i],.@px=rand(.@min_x, .@max_x),.@py=rand(.@min_y , .@max_y), cell_chknopass));
	makeitem .@dropitemid,1,.@m$,.@px,.@py;

 

-	script	test1235678	FAKE_NPC,{
end;
OnInit:
	bindatcmd "flooritem", strnpcinfo(0)+"::OnFI", 60,90;
	end;
OnFI:
	.@hditemid = atoi(.@atcmd_parameters$[0]);
	.@damount = atoi(.@atcmd_parameters$[1]);

if ( !.@damount ) {
	message strcharinfo(0), "@flooritem <Itemid or itemname> <amount>";
	end;
	}
if ( .@damount < 0 ) {
	message strcharinfo(0), "@flooritem -> Invalid amount";
	end;
	}
if ( getitemname(.@hditemid) == "null" && !searchitem(.@temp[0],.@atcmd_parameters$[0]) ) {
	message strcharinfo(0), "@flooritem -> Invalid Item ID";
	end;
	}
if(.@temp[0])		.@dropitemid = .@temp[0];
	else
.@dropitemid = .@hditemid;	.@r = (sqrt(.@damount) > 16 ? 16 :sqrt(.@damount));

	getmapxy(.@m$,.@px,.@py,0);
	.@min_x =((.@px-.@r) < 1?1:(.@px-.@r));
	.@max_x =((.@px+.@r) > 512 ? 512:(.@px+.@r));
	.@min_y =((.@py-.@r) < 1?1:(.@py-.@r));
	.@max_y =((.@py+.@r) > 512 ? 512:(.@py+.@r));
	freeloop(1);
	for(.@j=0;.@j< .@damount;.@j++) {
	while (checkcell(.@m$[.@i],.@px=rand(.@min_x, .@max_x),.@py=rand(.@min_y , .@max_y), cell_chknopass));
	makeitem .@dropitemid,1,.@m$,.@px,.@py;
	}
	freeloop(0);
	end;

}
Edited by Ranz

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.