bool spec_caem_gCapt(CHAR_DATA * ch)
{
	CHAR_DATA *pers;
	OBJ_DATA *pipe, *pipe_next;
	bool has_pipe = FALSE;
	int i, x, y, z, att;

	i = number_range( 1, 100 );
	x = number_range( 1, 4 );
	y = number_range( 1, 13 );
	z = number_range( 1, 6 );
	att = number_range( 1, 5 );

	if ( ch->fighting != NULL )
	{
		if ( ch->advancing == FALSE )
			return FALSE;
		if ( ch->advancing_on == NULL )
			return FALSE;
		if ( ch->range < RANGE_MISSLE )
			return FALSE;
		switch ( att )
		{
			case 1:
			    do_function( ch, &do_bash, "");
			break;
			case 2:
				do_function( ch, &do_wear, "longsword" );
			    do_function( ch, &do_disarm, "");
				do_function( ch, &do_remove, "longsword" );
			break;
			case 3:
			    do_function( ch, &do_kick, "");
			break;
			case 4:
			    do_function(ch, &do_dirt, "");
			break;
			case 5:
			    do_function(ch, &do_mobforms, "");
			break;
		}
		return FALSE;
	}
	if ( i < 80 )
		return FALSE;

	if ( ch->position == POS_RESTING )
	{
		do_stand( ch, "" );
	}
	switch( y )
	{
		case 1:
			if ( ch->position == POS_RESTING )
			do_appraise( ch, "sword" );
		break;

		case 2:
			act( "$n absently scratches at the beard covering his chin, obviously deep in thought.", ch, NULL, NULL, TO_ROOM );
		break;

		case 3:
			act( "$n casts a searching gaze across the people in the crowd.", ch, NULL, NULL, TO_ROOM );
			if ( chance( 50 ) )
			{
				for ( pers = ch->in_room->people; pers != NULL; pers = pers->next_in_room )
				{
					if ( !IS_NPC( pers ) )
						continue;
					if ( pers )
						break;
				}
				if ( pers && IS_NPC( pers ) && pers->pIndexData && pers->pIndexData->vnum == 3220 )
				{
					act( "{g$n shouts, {G'{gHey $N! No loitering! Get a move on!{G'{x", ch, NULL, pers, TO_ROOM );
					do_west( pers, "" );
				}
				if ( pers && IS_NPC( pers ) && pers->pIndexData && pers->pIndexData->vnum == 3109 )
				{
					act( "{g$n shouts, {G'{gHey $N! No loitering! Get a move on!{G'{x", ch, NULL, pers, TO_ROOM );
					do_north( pers, "" );
				}
				if ( pers && IS_NPC( pers ) && pers->pIndexData && pers->pIndexData->vnum == 3220 )
				{
					act( "{g$n shouts, {G'{gHey $N! No loitering! Get a move on!{G'{x", ch, NULL, pers, TO_ROOM );
					do_south( pers, "" );
				}
				if ( pers && IS_NPC( pers ) && pers->pIndexData && pers->pIndexData->vnum == 3219 )
				{
					act( "{g$n shouts, {G'{gYou there $N! No loitering! Get a move on!{G'{x", ch, NULL, pers, TO_ROOM );
					do_east( pers, "" );
				}
			}
		break;

		case 4:
			if ( ch->in_room && ch->in_room->vnum == 3001 )
			{
				switch( x )
				{
					case 1: /* goto 3003 */
						act( "{g$n barks, {G'{gParade, turn! Face... East!{G'{x", ch, NULL, NULL, TO_ROOM );
						act( "The guards following $n turn with a click of their boot heels.", ch, NULL, NULL, TO_ROOM );
						act( "{g$n barks, {G'{gMarch!{G'{x", ch, NULL, NULL, TO_ROOM );
						do_east( ch, "" );
					break;
					case 2: /* goto 3005 */
						act( "{g$n barks, {G'{gParade, turn! Face... South!{G'{x", ch, NULL, NULL, TO_ROOM );
						act( "The guards following $n turn with a click of their boot heels.", ch, NULL, NULL, TO_ROOM );
						act( "{g$n barks, {G'{gMarch!{G'{x", ch, NULL, NULL, TO_ROOM );
						do_south( ch, "" );
					break;
					case 3: /* goto 3004 */
						act( "{g$n barks, {G'{gParade, turn! Face... West!{G'{x", ch, NULL, NULL, TO_ROOM );
						act( "The guards following $n turn with a click of their boot heels.", ch, NULL, NULL, TO_ROOM );
						act( "{g$n barks, {G'{gMarch!{G'{x", ch, NULL, NULL, TO_ROOM );
						do_west( ch, "" );
					break;
					case 4: /* goto 3002 */
						act( "{g$n barks, {G'{gParade, turn! Face... North!{G'{x", ch, NULL, NULL, TO_ROOM );
						act( "The guards following $n turn with a click of their boot heels.", ch, NULL, NULL, TO_ROOM );
						act( "{g$n barks, {G'{gMarch!{G'{x", ch, NULL, NULL, TO_ROOM );
						do_north( ch, "" );
					break;
				}
				return TRUE;
			}
			if ( ch->in_room && ch->in_room->vnum == 3003 ) /* bank entrance */
			{
				march_halt( ch );
				do_enter( ch, "door" );
				act( "$n, Captain of the Guard, glances casually about the room.", ch, NULL, NULL, TO_ROOM );
				if ( ch->in_room->people != NULL )
					wait_function( ch, 2, do_say, "Peace be on the people of Caemlyn." );
				wait_function( ch, 2, do_enter, "door" );
				wait_act( 4, "{g$n barks, {G'{gParade, turn! Face... West!{G'{x", ch, NULL, NULL, TO_ROOM );
				wait_act( 4, "The guards following $n turn with a click of their boot heels.", ch, NULL, NULL, TO_ROOM );
				wait_act( 4, "{g$n barks, {G'{gMarch!{G'{x", ch, NULL, NULL, TO_ROOM );
				wait_function( ch, 4, do_west, "" );
				return TRUE;
			}
			if ( ch->in_room && ch->in_room->vnum == 3005 ) /* south plaza */
			{
				act( "{gThe Captain barks, {G'{gParade, turn! Face... North!{G'{x", ch, NULL, NULL, TO_ROOM );
				act( "The guards following $n turn with a click of their boot heels.", ch, NULL, NULL, TO_ROOM );
				act( "{g$n barks, {G'{gMarch!{G'{x", ch, NULL, NULL, TO_ROOM );
				do_north( ch, "" );
				return TRUE;
			}
			if ( ch->in_room && ch->in_room->vnum == 3004 ) /* pawn entrance */
			{
				march_halt( ch );
				do_enter( ch, "tent" );
				act( "{g$n, Captain of the Guard, glances casually about the room.", ch, NULL, NULL, TO_ROOM );
				if ( ch->in_room->people != NULL )
					wait_function( ch, 2, do_say, "Peace be on the people of Caemlyn." );
				wait_function( ch, 2, do_north, "" );
				wait_act( 4, "{g$n barks, {G'{gParade, turn! Face... East!{G'{x", ch, NULL, NULL, TO_ROOM );
				wait_act( 4, "The guards following $n turn with a click of their boot heels.", ch, NULL, NULL, TO_ROOM );
				wait_act( 4, "{g$n barks, {G'{gMarch!{G'{x", ch, NULL, NULL, TO_ROOM );
				wait_function( ch, 4, do_east, "" );
				return TRUE;
			}
			if ( ch->in_room && ch->in_room->vnum == 3002 ) /* north plaza */
			{
				act( "{g$n barks, {G'{gParade, turn! Face... South!{G'{x", ch, NULL, NULL, TO_ROOM );
				act( "The guards following $n turn with a click of their boot heels.", ch, NULL, NULL, TO_ROOM );
				act( "{g$n barks, {G'{gMarch!{G'{x", ch, NULL, NULL, TO_ROOM );
				do_south( ch, "" );
				return TRUE;
			}
		break;

		case 5:
			if ( ch->in_room && ch->in_room->vnum == 3001 )
			{
				if( chance( 50 ) )
					act( "{g$n mutters, {G'{gToo much marching today. Worked up a good thirst...{G'{x", ch, NULL, NULL, TO_ROOM );
				else
					act( "{g$n says, {G'{gCan you believe this heat lately? Seems... Unnatural.{G'{x", ch, NULL, NULL, TO_ROOM );
				do_drink( ch, "fountain" );
				return TRUE;
			}
		break;

		case 6:
			if ( ch->in_room && ch->in_room->vnum == 3001 )
			{
				if ( chance( 50 ) )
				{
					do_rest( ch, "bench" );
					act( "{g$n asks, {G'{gWhat? You think I'm going to stand on my flaming feet all bloody day?{G'{x", ch, NULL, NULL, TO_ROOM );
					return TRUE;
				}
				else
				{
					do_rest( ch, "bench" );
					act( "{g$n says, {G'{gAll this marching is murder on my feet and back.{G'{x", ch, NULL, NULL, TO_ROOM );
					return TRUE;
				}
			}
		break;

		case 7:
			do_search( ch, "" );
			return TRUE;
		break;

		case 8:
			for ( pers = ch->in_room->people; pers != NULL; pers = pers->next_in_room )
			{
				if ( IS_NPC( pers ) )
					continue;
				if ( pers->incog_level > 0 || pers->invis_level > 0 )
					continue;
				if ( pers )
					break;
			}
			if ( pers )
			{
				if( chance( 50 ) )
					act( "{g$n growls, {G'{gWhat are you looking at $N?{G'{x", ch, NULL, pers, TO_ROOM );
				else
					act( "{g$n asks, {G'{gDon't you ever get tired of just sitting around here, $N?{G'{x", ch, NULL, pers, TO_ROOM );
			}
			return TRUE;
		break;

		case 9:
			if ( ch->in_room && ch->in_room->vnum == 3001 ) /* north plaza */
				act( "$n idly traces a finger through the waters of {Wan {wo{Wval {ws{Whaped {wf{Wountain{x.", ch, NULL, NULL, TO_ROOM );
			return TRUE;
		break;

		case 10:
			for ( pipe = ch->carrying; pipe != NULL; pipe = pipe_next )
			{
			    pipe_next = pipe->next_content;
			    if ( pipe->item_type == ITEM_PIPE_TABAC )
			    {
			    	has_pipe = TRUE;
			    	break;
			    }
			}
			if ( has_pipe )
			{
				switch( z )
				{
					case 1:
						do_smoke( ch, "pipe" );
						wait_function( ch, 3, do_exhale, "rings" );
					break;
					case 2:
						do_smoke( ch, "pipe" );
						wait_function( ch, 3, do_exhale, "lines" );
					break;
					case 3:
						do_smoke( ch, "pipe" );
						wait_function( ch, 3, do_exhale, "balls" );
					break;
					case 4:
						do_smoke( ch, "pipe" );
						wait_function( ch, 3, do_exhale, "web" );
					break;
					case 5:
						do_smoke( ch, "pipe" );
						wait_function( ch, 3, do_exhale, "phoenix" );
					break;
					case 6:
						do_smoke( ch, "pipe" );
						wait_function( ch, 3, do_exhale, "horns" );
					break;
				}
				return TRUE;
			}
			else
			{
				OBJ_INDEX_DATA *pObj;
				act( "{g$n mutters, {G'{gI'll have to go see Jakob about getting some more tabac for my pipe...{G'{x", ch, NULL, NULL, TO_ROOM );
			    act( "{c$n beseeches transportation and receives it.{c", ch, NULL, NULL, TO_ROOM );
			    char_from_room( ch );
			    char_to_room( ch, get_room_index( ROOM_VNUM_PLAZA ) );
			    act( "{c$n appears in the room, trembling from some horrible experience, and collapses.{c", ch, NULL, NULL, TO_ROOM );
			    act( "{c$n stands up.{c", ch, NULL, NULL, TO_ROOM );
			    do_west( ch, "" );
			    do_west( ch, "" );
			    do_open( ch, "north" );
			    do_north( ch, "" );

				pObj = get_obj_index( 3198 );
				pipe = create_object( pObj, 1 );
				obj_to_char( pipe, ch );
			    act( "{c$n buys $p.", ch, pipe, NULL, TO_ROOM );

			    do_open( ch, "south" );
			    do_south( ch, "" );
			    do_east( ch, "" );
			    do_east( ch, "" );
			}
			return TRUE;
		break;

		case 11:
			if ( ch->in_room && ch->in_room->vnum == 3005 ) /* south plaza */
			{
				act( "{g$n growls, {G'{gFlaming peddlers are taking over the city these days.{G'{x", ch, NULL, NULL, TO_ROOM );
				for ( pers = ch->in_room->people; pers != NULL; pers = pers->next_in_room )
				{
					if ( !IS_NPC( pers ) )
						continue;
					if ( pers && IS_NPC( pers ) && pers->pIndexData && pers->pIndexData->vnum == 3000 )
						break;
				}
				if ( pers )
				{
					act( "{W$n grunts sourly at an old peddler.{x", ch, NULL, pers, TO_ROOM );
					wait_act( 2, "{WAn old peddler scratches his head in bewilderment.{x", pers, NULL, NULL, TO_ROOM );
				}
			}
		break;

		case 12:
			if ( weather_info.sky == SKY_RAINING )
				act( "{g$n says, {G'{gBloody rain needs to let up a bit and let a man do his job.{G'{x", ch, NULL, NULL, TO_ROOM );
		break;

		case 13:
			for ( pers = ch->in_room->people; pers != NULL; pers = pers->next_in_room )
			{
				if ( IS_NPC( pers ) )
					continue;
				if ( pers->incog_level > 0 || pers->invis_level > 0 )
					continue;
				if ( pers )
					break;
			}
			if ( pers )
			{
				if ( !str_cmp( clan_table[pers->clan].name, "loner" ) )
				{
					if( chance( 50 ) )
					{
						do_look( ch, pers->name );
						act( "{g$n says, {G'{gYou seem hale enough, $N. You should look into joining the Queen's Guard.{G'{x", ch, NULL, pers, TO_ROOM );
					}
					else
					{
						do_look( ch, pers->name );
						act( "{g$n says, {G'{g$N, why don't you go see a recruiter about joining the Queen's Guard?{G'{x", ch, NULL, pers, TO_ROOM );
					}
				}
				else if ( !str_cmp( clan_table[pers->clan].name, "aessedai" ) )
				{
					if( chance( 50 ) )
						act( "{g$n says, {G'{gLight illumine you, m'lady $N.{G'{x", ch, NULL, pers, TO_ROOM );
					else
						act( "{g$n says with a bow, {G'{gYou honor Caemlyn with your presence, Lady $N.{G'{x", ch, NULL, pers, TO_ROOM );
				}
				else if ( !str_cmp( clan_table[pers->clan].name, "warder" )
				|| !str_cmp( clan_table[pers->clan].name, "youngling" )
				|| !str_cmp( clan_table[pers->clan].name, "towerguard" ) )
					act( "{g$n says, {G'{gStrength for your sword, Lord $N.{G'{x", ch, NULL, pers, TO_ROOM );
				else if ( pers->race == race_lookup( "malkier" ) )
					act( "{g$n says, {G'{gI had heard the Golden Crane flew again. Grace favor you, Lord $N.{G'{x", ch, NULL, pers, TO_ROOM );
				else if ( pers->race == race_lookup( "kandor" )
				|| pers->race == race_lookup( "arafel" )
				|| pers->race == race_lookup( "shienar" )
				|| pers->race == race_lookup( "saldaea" ) )
					act( "{g$n asks, {G'{gLong way down from the borderlands, aren't you, $N?{G'{x", ch, NULL, pers, TO_ROOM );
				else if ( ch->race == race_lookup( "tuathaan" ) )
					act( "{g$n says, {G'{gFlaming tinkers... Don't be trying to snatch any children around here, $N.{G'{x", ch, NULL, pers, TO_ROOM );
				else if ( !str_cmp( clan_table[pers->clan].name, "thestump" )
				|| !str_cmp( clan_table[pers->clan].name, "treebrother" )
				|| !str_cmp( clan_table[pers->clan].name, "treesister" ) )
					act( "{g$n says in an old language, {G'{gKiserai ti Wansho! We welcome you to Caemlyn, $N.{G'{x", ch, NULL, pers, TO_ROOM );
				else if ( !str_cmp( clan_table[pers->clan].name, "thieftaker" ) )
					act( "{g$n says, {G'{gThe Thief Takers are welcome in Caemlyn, $N.{G'{x", ch, NULL, pers, TO_ROOM );
				else if ( !str_cmp( clan_table[pers->clan].name, "blightguard" ) )
					act( "{g$n says, {G'{gA long way from the blight border aren't you, $N?{G'{x", ch, NULL, pers, TO_ROOM );
				else if ( !str_cmp( clan_table[pers->clan].name, "band" ) )
					act( "{g$n says, {G'{gHey, $N! Want to meet me at the Crown for an ale later tonight?{G'{x", ch, NULL, pers, TO_ROOM );
				else if ( !str_cmp( clan_table[pers->clan].name, "children" ) )
					act( "{g$n mutters, {G'{gThe Children of the Light hold no writ in Caemlyn, $N...{G'{x", ch, NULL, pers, TO_ROOM );
				else if ( !str_cmp( clan_table[pers->clan].name, "gleeman" ) )
					act( "{g$n exclaims, {G'{gHai, $N! Are you putting on a show hereabouts?{G'{x", ch, NULL, pers, TO_ROOM );
				else if ( !str_cmp( clan_table[pers->clan].name, "ashaman" ) )
					act( "{g$n mutters, {G'{g$N, why don't you take yorself back to your mad brothers in that forsaken Tower?{G'{x", ch, NULL, pers, TO_ROOM );
				else if ( pers->race == race_lookup( "aiel" ) )
				{
					act( "{g$n mutters, {G'{gAiel in Caemlyn... Not starting another war are you, $N?{G'{x", ch, NULL, pers, TO_ROOM );
					if( chance( 50 ) )
						act( "{g$n says, {G'{gIf you are, take it up to Cairhien. Heard there was some of your kind up that way already.{G'{x", ch, NULL, pers, TO_ROOM );
					else
						act( "{g$n says, {G'{gI still got scars from the last time your kind came down looking for trouble.{G'{x", ch, NULL, pers, TO_ROOM );
				}
				else if ( pers->race == race_lookup( "trolloc" ) )
				{
					do_look( ch, pers->name );
					act( "{g$n shouts, {G'{gTrollocs are in Caemlyn! Rouse the guard!{G'{x", ch, NULL, pers, TO_ROOM );
				}
			}
			return TRUE;
		break;
	}

    return FALSE;
}