Random VNUMS

Posted by AlaricX on Sat 14 Dec 2002 05:06 AM — 3 posts, 14,699 views.

#0
How could i get a working (existant) Vnum between 1 and MAX_VNUMS, be it room, object or mob (most importantly i am looking for ROOM vnums) my max vnums is the 2 billion one.
#1
I have gotten it to get random room vnums, but how would i find a random mob in the world (one that exists and is walking around in an area, etc). i have that, but when i do a get_char_world using the supermob as the first argument, it crashes later due to something about will_fall (i think it's the supermob)
USA #2
k well i think somethin around lines of

if ( (thing = get_room_index(number_range(1,MAX_VNUMS))) == NULL )
{
send_to_char( "Vnum does not exist.\n\r", ch );
return;
}

if for mobs just change to like get_mob_index etc
this way if the "thing"s vnum exists it will just stick with and if doesnt well.. yeah u get a lil msg :)