It would be nice to know what doesn't work.
I'm personally not a fan about double-with's... Nor am I a fan of 'temp.n' mysteriously becoming 'n'.
It could be on a gmap, and showing at the top-left corner... As for the npcs array trick, that was before putnpc2 returned an object.
How I usually do it is:
PHP Code:
public function dropItem( id )
{
temp.n = "object_item";
temp.obj = putnpc2( 30, 30, "" );
temp.obj.join( temp.n );
// ...
}