Example #1
0
void do_shiphail( CHAR_DATA *ch, char *argument )
{
   
   SHIP_DATA *ship;
   SHIP_DATA *ship2 = ship_from_cockpit( ch->in_room->vnum );
   int  count;
   int top_num=15;
   int vnum[top_num];
   DESCRIPTOR_DATA *i;
   CHAR_DATA *och;
   char buf[MAX_STRING_LENGTH];
   char buf1[MAX_STRING_LENGTH];
   char arg1[MAX_INPUT_LENGTH];
   char arg2[MAX_INPUT_LENGTH];

   argument = one_argument( argument, arg1 );
   strcpy(arg2,argument);
   if(IS_NPC(ch))
	return;
   if (arg1[0] == '\0' || arg2[0] == '\0')
   {
   	send_to_char ("Syntax: Hail <ship> <message>\n\r", ch);
   	return;
   }
   
   ship = get_ship( arg1 );
   send_to_char ("\n\r", ch);
   if (!ship)
   {
     send_to_char ("No Such Ship!\n\r", ch);
     return;
   }
   if (!ship2)
   {
   	send_to_char("But your not in a cockpit!\n\r", ch);
   	return;
   }
   if ( !IS_NPC(ch) && ( IS_SET (ch->act, PLR_SILENCE ) ) )
   {
	send_to_char("You can't do this while silenced!\n\r", ch);
	return;
   }
    
   sprintf (buf, "&B(&YShip Hail&B) &G&W%s: %s\n\r", ship2->name, arg2);
   sprintf (buf1, "&g%s adjusts some settings on the comm system and says something", ch->name, arg2);
   act( AT_GREEN, buf1,  ch, NULL, NULL, TO_NOTVICT );
   sprintf (buf1, "&B(&YShip Hail&B) &G&WYou: %s\n\r",  arg2);
   act(AT_PLAIN, buf1, ch, NULL, NULL, TO_CHAR);
   act(AT_PLAIN, buf, ch, NULL, NULL, TO_ROOM);
/*   vnum[0] = ship->cockpit;
   vnum[1] = ship->pilotseat;
   vnum[2] = ship->gunseat;
   vnum[3] = ship->coseat;
   vnum[4] = ship->navseat;
   vnum[5] = ship->turret1;
   vnum[6] = ship->turret2;

 for (i = first_descriptor; i; i = i->next)
  {
    if (!i->connected && i->character)
    {
      och = i->original ? i->original : i->character;	
    }
   for( count=1; count <= top_num; count = count + 1 )
   {
     if (och->in_room->vnum == vnum[count] && och->desc)
     {
     	send_to_char(buf, och);
     	break;
     }
   }
  }
*/
 int highroom = 0, lowroom = 0;
 
 if(ship->firstroom <= 0 || ship->lastroom <= 0)
 {
	send_to_char("Contact Immoortal Staff, Hail target ship has vnum range problem.\r\n", ch);
	return;
 }
 highroom = ship->firstroom;
 lowroom = ship->lastroom;
 for(highroom; highroom <= lowroom; highroom++)
 {
	echo_to_room(AT_PLAIN, get_room_index(highroom), buf);
 }

}
Example #2
0
bool spec_newbie_pilot(CHAR_DATA * ch)
{
	int home = 32149;
	CHAR_DATA *victim;
	CHAR_DATA *v_next;
	OBJ_DATA *obj;
	char buf[MAX_STRING_LENGTH];
	bool diploma = FALSE;

	for (victim = ch->in_room->first_person; victim; victim = v_next) {
		v_next = victim->next_in_room;

		if (IS_NPC(victim) || victim->position == POS_FIGHTING)
			continue;

		for (obj = victim->last_carrying; obj; obj = obj->prev_content)
			if (obj->pIndexData->vnum == OBJ_VNUM_SCHOOL_DIPLOMA)
				diploma = TRUE;

		if (!diploma)
			continue;

		switch (victim->race) {
		case RACE_MON_CALAMARI:
			home = 21100;
			strcpy(buf,
			       "After a brief journey you arrive on Mon Calamari.\n\r\n\r");
			echo_to_room(AT_ACTION, ch->in_room, buf);
			break;

		case RACE_QUARREN:
			home = 6904;
			strcpy(buf,
			       "After a brief journey you arrive on Mon Calamari.\n\r\n\r");
			echo_to_room(AT_ACTION, ch->in_room, buf);
			break;

		case RACE_GAMORREAN:
			home = 28038;
			strcpy(buf,
			       "After a brief journey you arrive on Gamorr.\n\r\n\r");
			echo_to_room(AT_ACTION, ch->in_room, buf);
			break;

		case RACE_ADARIAN:
			home = 29006;
			strcpy(buf,
			       "After a brief journey you arrive on Adari.\n\r\n\r");
			echo_to_room(AT_ACTION, ch->in_room, buf);
			break;

		case RACE_JAWA:
			home = 31821;
			strcpy(buf,
			       "After a brief journey you arrive on Tatooine.\n\r\n\r");
			echo_to_room(AT_ACTION, ch->in_room, buf);
			break;

		case RACE_WOOKIEE:
			home = 28600;
			strcpy(buf,
			       "After a brief journey you arrive on Kashyyyk.\n\r\n\r");
			echo_to_room(AT_ACTION, ch->in_room, buf);
			break;

		case RACE_HUMAN:
			home = 201;
			strcpy(buf,
			       "After a brief journey you arrive at Coruscants Menari Spaceport.\n\r\n\r");
			echo_to_room(AT_ACTION, ch->in_room, buf);
			break;

		case RACE_NOGHRI:
			home = 1001;
			strcpy(buf,
			       "After a brief journey you arrive at Honoghr's Nystao Spaceport.\n\r\n\r");
			echo_to_room(AT_ACTION, ch->in_room, buf);
			break;

		default:
			sprintf(buf, "Hmm, a %s.",
				race_table[victim->race].race_name);
			do_look(ch, victim->name);
			do_say(ch, buf);
			do_say(ch,
			       "You're home planet is a little hard to get to right now.");
			do_say(ch, "I'll take you to the Pluogus instead.");
			echo_to_room(AT_ACTION, ch->in_room,
				     "After a brief journey the shuttle docks with the Serin Pluogus.\n\r\n\r");
			break;
		}

		char_from_room(victim);
		char_to_room(victim, get_room_index(home));

		do_look(victim, "");

		sprintf(buf,
			"%s steps out and the shuttle quickly returns to the academy.\n\r",
			victim->name);
		echo_to_room(AT_ACTION, ch->in_room, buf);
	}

	return FALSE;
}