Jump to content
  • 0
Sign in to follow this  
xienne15

monster die will drop items randomly in map

Question

 

According to the video the drop is scattered all around the map of prt_fild08 is there a way we can do this? if we kill king poring its drop will be scattered all around the map?

 

i tried this but it doesnt make the item on the ground, and it shoule be drop in random places in that map thats why i try to put 0,0;

 

OnNPCkillEvent:
if(killedrid!=1002){ end;}
makeitem 969,1,"prt_fild08",0,0;
makeitem 969,1,"prt_fild08",0,0;
end;
}

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

0, 0 isn't a valid argument for makeitem, you could want to try this other script:
 

-	script	randmobdrops	-1,{OnNPCKillEvent: // Triggered on the player	getmapxy(.@map$,.@x,.@y,0);	switch(killedrid){		case 1002:			setarray .@rewards[0],969,969; //Add your rewards as Item IDs here. They must be valid.		break;		// case other_mob_id:		// 	setarray .@rewards[0], item_id1, item_id2, (...);		// break;	}	if (!getarraysize(.@rewards)) end; // For mobs without rewards	freeloop(1); // The do-while loop can repeat quite a lot of times	for (set .@i, 0; .@i < getarraysize(.@rewards); set .@i, .@i + 1){		do { // No way of getting the actual map size, so will try to find a suitable cell with this brute-force algorithm			set .@x, rand(1, 512); // Hardcoded max map width			set .@y, rand(1, 512); // Hardcoded max map height		} while ( !checkcell(.@map$,.@x,.@y,cell_chkpass) ) // Repeat till the cell is passable		//Now we have everything we need: the item ID as .@rewards[.@i], the map, x and y coordinates. Dropping the item...		makeitem .@rewards[.@i], 1, .@map$, .@x, .@y;	}	end;}

 
This, basically, hunts down a random cell and places the item there, matter what map you're in. Could be a bit resource_hungry since the 0,0 or the "Random" properties aren't defined in that, so I had to make my very own version of it. I haven't tested it so it may not work.

You may not see the rewards unless you make looots of them or you work in a tiny map, though (the smaller the map is, the most tries and thus resource consumption the script will take for finding a suitable cell since the place is random).

Share this post


Link to post
Share on other sites
  • 0

 

According to the video the drop is scattered all around the map of prt_fild08 is there a way we can do this? if we kill king poring its drop will be scattered all around the map?

 

i tried this but it doesnt make the item on the ground, and it shoule be drop in random places in that map thats why i try to put 0,0;

 

OnNPCkillEvent:

if(killedrid!=1002){ end;}

makeitem 969,1,"prt_fild08",0,0;

makeitem 969,1,"prt_fild08",0,0;

end;

}

makeitem 969,1,"prt_fild08",0,0;

 

Dropping Only 1, try to do it >1k(If you want to test) bcoz prt_fild08 is a large map and then kill a poring.

P.S: Or maybe if you have tested that, you may not have loaded the script.

Share this post


Link to post
Share on other sites
  • 0

 

 

According to the video the drop is scattered all around the map of prt_fild08 is there a way we can do this? if we kill king poring its drop will be scattered all around the map?

 

i tried this but it doesnt make the item on the ground, and it shoule be drop in random places in that map thats why i try to put 0,0;

 

OnNPCkillEvent:

if(killedrid!=1002){ end;}

makeitem 969,1,"prt_fild08",0,0;

makeitem 969,1,"prt_fild08",0,0;

end;

}

makeitem 969,1,"prt_fild08",0,0;

 

Dropping Only 1, try to do it >1k(If you want to test) bcoz prt_fild08 is a large map and then kill a poring.

P.S: Or maybe if you have tested that, you may not have loaded the script.

If you try it 1k it will drop the item as 1000 gold in 1 looting, what i mean they are all stack together as one making 1k gold lol

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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