Music/Jukebox code
-----

Original code written by Russ Taylor and the other guys from the ROM team.

/***************************************************************************
*	ROM 2.4 is copyright 1993-1998 Russ Taylor			   *
*	ROM has been brought to you by the ROM consortium		   *
*	    Russ Taylor (rtaylor@hypercube.org)				   *
*	    Gabrielle Taylor (gtaylor@hypercube.org)			   *
*	    Brian Moore (zump@rom.org)					   *
*	By using this code, you have agreed to follow the terms of the	   *
*	ROM license, in the file Rom24/doc/rom.license			   *
***************************************************************************/

SMAUG port written by Blade / Typhon for Lair of Darkness
                                    (lod.arthmoor.com port 4600)

-----
Purpose
-----

I just wanted to spice up LoD so i decided to port this.. Many thanks to Nick Gammon
for helping out with a bug that was driving me crazy :)

This is almost an identical port of the code in ROM 2.4... it basically plays lines
of songs that you can choose. the songs are located in the music.txt file looks like...
artist~
song name~
lyrics1
lyrics2
lyrics3
...
~
At the end of the file you need a #. other then that installation is fairly simple.
any comments/questions/bugs my email is fir3_bird@yahoo.com

-----
Update
-----
Code was changed to so that music can be toggled on and off with chan -music and chan +music

-----
The Code
-----

1 )  Simply add music.c and music.h to your src and place both in the Makefile.	

2 )  Open mud.h. After #DEFINE LEVEL_AVATAR... add
	#include "music.h"
3 )  After #define PULSE_AUCTION... add
	#define PULSE_MUSIC		  ( 6 * PULSE_PER_SECOND)
     Depending on how fast you want the lyrics to scroll through you might want to
     change the 6 higher or lower.

4 )  Search for  
	* Item types.
     and add a ITEM_JUKEBOX at the end. also change 
	#define MAX_ITEM_TYPE		     ITEM_*
     to 
	#define MAX_ITEM_TYPE		     ITEM_JUKEBOX

5 )  Search for
	#define	RACE_LIST	"race.lst"	/* List of races		*/
     and add
	#define MUSIC_FILE	SYSTEM_DIR "music.txt"  /* Songs for the jukebox */

5a ) Search for 
	Channel bits.
     At the end of the list add
	#define	CHANNEL_MUSIC		   BVxx
     Change BVxx to the next available number on the list.. ie BV27 but do not go over
     BV31

6 )  Close mud.h and open db.c
     Search for the function boot_db and find 
	load_projects( );
     right after that, add...
	log_string ("Loading Music");  /*Loads music into global table.*/
	load_songs( );

7 )  In the function create_object search for 
	case ITEM_SHOVEL:
	break;		
     and add
	case ITEM_JUKEBOX:
	    obj->value[0] = 0;
	    obj->value[1] = 0;
	    obj->value[2] = 0;
	    obj->value[3] = 0;
	    obj->value[4] = -1;
	break;

8 )  Close db.c and open up tables.c
     Search for
	if ( !str_cmp( name, "do_pick" ))		return do_pick;
     and add right after
	if ( !str_cmp( name, "do_playjuke" ))		return do_playjuke;

9 )  Search for
	if ( skill == do_pick )		return "do_pick";
     and add right after
	if ( skill == do_playjuke )		return "do_playjuke";

11)  Close tables.c and open update.c
     in the function update_handler, after
	static  int	    pulse_second;
     add
	static  int	    pulse_music;

12)  search for
	if ( --pulse_area     <= 0 )
   	{
		pulse_area	= number_range( PULSE_AREA / 2, 3 * PULSE_AREA / 2 );
		area_update	( );
	}
     and add
       if ( --pulse_music	  <= 0 )
       {
   	   pulse_music	= PULSE_MUSIC;
	   song_update();
       }

12 )  close update.c and open build.c
      search for
	char *	const	o_types	[] =
      and add 
	, "jukebox"
      at the end.

12a ) Open act_info.c and search for
	/* For organization channels (orders, clans, guilds, councils) */
      above that add
	 ch_printf_color( ch, "%s",   !IS_SET( ch->deaf, CHANNEL_MUSIC )   ?
				                " &G+MUSIC" 	          :
						" &g-music" );
13 )  All thats left is to 
	make clean 
      and to add the do_playjuke command either offline or online.

	


