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