/* Original Code by Jason Huang (god@sure.net).                       */
/* Permission to use this code is granted provided this header is     */
/* retained and unaltered.                                            */ 

void spell_metamorphose( int sn, int level, CHAR_DATA *ch, void *vo )
{
    CHAR_DATA *victim;
    int vnum;

    if ( IIS_NPC(victim) || victim->level > level )
    {
	send_to_char( "You failed.\n\r", ch );
	return;
    }

    switch( number_bits(4) )
    {
	case 0: vnum = MOB_VNUM_CAT; break;
	case 1: vnum = MOB_VNUM_FIDO; break;
	case 2: vnum = MOB_VNUM_COW; break;
	case 3: vnum = MOB_VNUM_WOLF; break;
	case 4: vnum = MOB_VNUM_BEAR; break;
	case 5: vnum = MOB_VNUM_RABBIT; break;
	case 6: vnum = MOB_VNUM_SNAIL; break;
	case 7: vnum = MOB_VNUM_BOAR; break;
	default: vnum = MOB_VNUM_SLIME; break;
    }

    extract_char( victim, TRUE );
    victim = create_mobile( get_mob_index( vnum) );
    char_to_room( victim, ch->in_room );
    act( "$N has been transformed.", ch, NULL, victim , TO_ROOM );
    act( "You have transform $N.", ch, NULL, victim, TO_CHAR);
    do_look( ch, "auto" );
   
    return;
}


