monster die will drop items randomly in map

xienne15

New member
Messages
120
Points
0
To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.

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;
}

 
To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.
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.

 
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).

 
Last edited by a moderator:
Back
Top