void do_call( CHAR_DATA *ch, char * argument) {
SHIP_DATA *ship, *rndm;
int count;
for ( ship = first_ship; ship; ship = ship->next ) {
if ( !str_cmp( ship->owner , "Public" ) && !IS_SET(ship->flags, SHIP_SIMULATOR ) ) {
if (ship->class > CAPITAL_SHIP) continue;
if (ship->type == MOB_SHIP) continue;
if (number_range(0, count) == 0)
rndm = ship;
count++;
}
}
transship(rndm, ch->in_room->vnum);
}
void do_call( CHAR_DATA *ch, char * argument)
{
SHIP_DATA *ship, *rental;
for ( ship = first_ship; ship; ship = ship->next )
{
if ( !str_cmp( ship->owner , "Public" ) && !IS_SET(ship->flags, SHIP_SIMULATOR ) )
{
if (ship->class > CAPITAL_SHIP)
continue;
if (ship->type == MOB_SHIP)
continue;
if(ship->lastdoc == ch->in_room->vnum)
continue;
if( is_rental(ch,ship) )
rental = ship;
}
}
if (rental == NULL )
{
send_to_char( "All the public ships are already here.\n\r", ch);
return;
}
transship(rental, ch->in_room->vnum);
send_to_char( "A shuttle lands infront of you and its doors swing open.\n\r", ch);
}
if (rental == NULL )
{
send_to_char( "All the public ships are already here.\n\r", ch);
return;
}
origShipyard = ship->shipyard;
SHIP_DATA *ship, *rental = NULL;
Here is the code.
Now what it is doing is calling all the public ships into the room, I want it to call a random public ship to the room, or call them in order each time the command is issued. I'm not sure if there is a function that will pull one from the list alone. any help will be apprieciated.