/*
 *	Item generator 2, a simpler approch to the creation system
 */

#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#endif
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "merc.h"
#include "interp.h"
#include "magic.h"
#include "recycle.h"
#include "tables.h"

OBJ_DATA *
new_gen_weapon (OBJ_DATA * obj, int level)
{
	int weapon_type = number_range(1, 6);
	char name_set[MSL];
	char shor_set[MSL];
	char long_set[MSL];
	int weapon_type_1_name = number_range(1, level / 5);
	int weapon_type_2_name = number_range(1, level / 5);
	int weapon_type_3_name = number_range(1, level / 5);
//	int weapon_type_4_name = number_range(1, 5);
	int weapon_type_5_name = number_range(1, level / 5);
	int weapon_type_6_name = number_range(1, level / 5);

	// Get the weapon type
	switch(weapon_type)
	{
		// case 1, slasher
		case 1:
		obj = create_object (get_obj_index (900), 0);
		break;
		// case 2, slicer
		case 2:
		obj = create_object (get_obj_index (901), 0);
		break;
		// case 3, pound
		case 3:
		obj = create_object (get_obj_index (902), 0);
		break;
		// case 4, crusher
		case 4:
		obj = create_object (get_obj_index (903), 0);
		break;
		// case 5, piercer
		case 5:
		obj = create_object (get_obj_index (904), 0);
		break;
		// case 6, Whip
		case 6:
		obj = create_object (get_obj_index (905), 0);
		break;
		default:
		obj = create_object (get_obj_index (900), 0);
		break;
	}

	// Now we set the name of the object as well as type

	/* Slashing weapons first */
	if ( (weapon_type == 1) || (weapon_type == 2) )
	{
		switch(weapon_type_1_name)
		{
			case 1:
			obj->value[0] = 1;
			sprintf(name_set, "crude shortsword");
			sprintf(shor_set, "crude Shortsword");
			sprintf(long_set, "a crude Shortsword is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 3;
                     obj->value[2] = 7;
                     obj->level    = 5;
			break;

			case 2:
			obj->value[0] = 1;
			sprintf(name_set, "crude broadsword");
			sprintf(shor_set, "crude broadsword");
			sprintf(long_set, "a crude broadsword is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 5;
                     obj->value[2] = 15;
                     obj->level    = 10;
			break;

			case 3:
			obj->value[0] = 1;
			sprintf(name_set, "crude longsword");
			sprintf(shor_set, "crude longsword");
			sprintf(long_set, "a crude longsword is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 10;
                     obj->value[2] = 20;
                     obj->level    = 15;
			break;

			case 4:
			obj->value[0] = 1;
			sprintf(name_set, "crude scimitar");
			sprintf(shor_set, "crude scimitar");
			sprintf(long_set, "a crude scimitar is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 15;
                     obj->value[2] = 25;
                     obj->level    = 20;
			break;

			case 5:
			obj->value[0] = 1;
			sprintf(name_set, "crude bastard sword");
			sprintf(shor_set, "crude bastard sword");
			sprintf(long_set, "a crude bastard sword is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 20;
                     obj->value[2] = 30;
                     obj->level    = 25;
			break;

			case 6:
			obj->value[0] = 1;
			sprintf(name_set, "crude claymore");
			sprintf(shor_set, "crude claymore");
			sprintf(long_set, "a crude claymore is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 25;
                     obj->value[2] = 35;
                     obj->level    = 30;
			break;

			case 7:
			obj->value[0] = 1;
			sprintf(name_set, "shortsword");
			sprintf(shor_set, "shortsword");
			sprintf(long_set, "a shortsword is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 30;
                     obj->value[2] = 40;
                     obj->level    = 35;
			break;

			case 8:
			obj->value[0] = 1;
			sprintf(name_set, "broadsword");
			sprintf(shor_set, "broadsword");
			sprintf(long_set, "a broadsword is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 35;
                     obj->value[2] = 45;
                     obj->level    = 40;
			break;

			case 9:
			obj->value[0] = 1;
			sprintf(name_set, "longsword");
			sprintf(shor_set, "longsword");
			sprintf(long_set, "a longsword is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 40;
                     obj->value[2] = 50;
                     obj->level    = 45;
			break;

			case 10:
			obj->value[0] = 1;
			sprintf(name_set, "scimitar");
			sprintf(shor_set, "scimitar");
			sprintf(long_set, "a scimitar is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 42;
                     obj->value[2] = 58;
                     obj->level    = 50;
			break;

			case 11:
			obj->value[0] = 1;
			sprintf(name_set, "bastard sword");
			sprintf(shor_set, "bastard sword");
			sprintf(long_set, "a bastard sword is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 43;
                     obj->value[2] = 67;
                     obj->level    = 55;
			break;

			case 12:
			obj->value[0] = 1;
			sprintf(name_set, "claymore");
			sprintf(shor_set, "claymore");
			sprintf(long_set, "a claymore is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 45;
                     obj->value[2] = 75;
                     obj->level    = 60;
			break;

			case 13:
			obj->value[0] = 1;
			sprintf(name_set, "iron shortsword");
			sprintf(shor_set, "iron shortsword");
			sprintf(long_set, "a iron shortsword is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 47;
                     obj->value[2] = 83;
                     obj->level    = 65;
			break;

			case 14:
			obj->value[0] = 1;
			sprintf(name_set, "iron broadsword");
			sprintf(shor_set, "iron broadsword");
			sprintf(long_set, "a iron broadsword is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 50;
                     obj->value[2] = 90;
                     obj->level    = 70;
			break;

			case 15:
			obj->value[0] = 1;
			sprintf(name_set, "iron longsword");
			sprintf(shor_set, "iron longsword");
			sprintf(long_set, "a iron longsword is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 52;
                     obj->value[2] = 98;
                     obj->level    = 75;
			break;

			case 16:
			obj->value[0] = 1;
			sprintf(name_set, "iron scimitar");
			sprintf(shor_set, "iron scimitar");
			sprintf(long_set, "a iron scimitar is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 55;
                     obj->value[2] = 105;
                     obj->level    = 80;
			break;

			case 17:
			obj->value[0] = 1;
			sprintf(name_set, "iron bastard sword");
			sprintf(shor_set, "iron bastard sword");
			sprintf(long_set, "a iron bastard sword is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 58;
                     obj->value[2] = 112;
                     obj->level    = 85;
			break;

			case 18:
			obj->value[0] = 1;
			sprintf(name_set, "iron claymore");
			sprintf(shor_set, "iron claymore");
			sprintf(long_set, "a iron claymore is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 61;
                     obj->value[2] = 119;
                     obj->level    = 90;
			break;

			case 19:
			obj->value[0] = 1;
			sprintf(name_set, "steel shortsword");
			sprintf(shor_set, "steel shortsword");
			sprintf(long_set, "a steel shortsword is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 64;
                     obj->value[2] = 136;
                     obj->level    = 100;
			break;

			case 20:
			obj->value[0] = 1;
			sprintf(name_set, "steel boardsword");
			sprintf(shor_set, "steel boardsword");
			sprintf(long_set, "a steel boardsword is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 66;
                     obj->value[2] = 144;
                     obj->level    = 103;	// 105
			break;

			case 21:
			obj->value[0] = 1;
			sprintf(name_set, "steel longsword");
			sprintf(shor_set, "steel longsword");
			sprintf(long_set, "a steel longsword is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 69;
                     obj->value[2] = 151;
                     obj->level    = 105;	// 110
			break;

			case 22:
			obj->value[0] = 1;
			sprintf(name_set, "steel scimitar");
			sprintf(shor_set, "steel scimitar");
			sprintf(long_set, "a steel scimitar is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 70;
                     obj->value[2] = 160;
                     obj->level    = 107;	// 115
			break;

			case 23:
			obj->value[0] = 1;
			sprintf(name_set, "steel bastard sword");
			sprintf(shor_set, "steel bastard sword");
			sprintf(long_set, "a steel bastard sword is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 72;
                     obj->value[2] = 168;
                     obj->level    = 109;	// 120
			break;

			case 24:
			obj->value[0] = 1;
			sprintf(name_set, "steel claymore");
			sprintf(shor_set, "steel claymore");
			sprintf(long_set, "a steel claymore is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 73;
                     obj->value[2] = 177;
                     obj->level    = 111;	// 125
			break;

			case 25:
			obj->value[0] = 1;
			sprintf(name_set, "zweihander");
			sprintf(shor_set, "zweihander");
			sprintf(long_set, "a zweihander is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 75;
                     obj->value[2] = 185;
                     obj->level    = 113;		// 130
			break;

		}
	}

	/* Pound and crush */
	if ( (weapon_type == 3) || (weapon_type == 4) )
	{
		switch(weapon_type_3_name)
		{
                     case 1:
                     obj->value[0] = 4;
                     sprintf(name_set, "crude club");
                     sprintf(shor_set, "crude club");
                     sprintf(long_set, "a crude club is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 4;
                     obj->value[2] = 6;
                     obj->level    = 5;
                     break;

                     case 2:
                     obj->value[0] = 4;
                     sprintf(name_set, "crude spiked club");
                     sprintf(shor_set, "crude spiked club");
                     sprintf(long_set, "a crude spiked club is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 8;
                     obj->value[2] = 12;
                     obj->level    = 10;
                     break;

                     case 3:
                     obj->value[0] = 4;
                     sprintf(name_set, "crude mace");
                     sprintf(shor_set, "crude mace");
                     sprintf(long_set, "a crude mace is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 13;
                     obj->value[2] = 17;
                     obj->level    = 15;
                     break;

                     case 4:
                     obj->value[0] = 4;
                     sprintf(name_set, "crude morning star");
                     sprintf(shor_set, "crude morning star");
                     sprintf(long_set, "a crude morning star is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 18;
                     obj->value[2] = 22;
                     obj->level    = 20;
                     break;

                     case 5:
                     obj->value[0] = 4;
                     sprintf(name_set, "crude flail");
                     sprintf(shor_set, "crude flail");
                     sprintf(long_set, "a crude flail is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 22;
                     obj->value[2] = 27;
                     obj->level    = 25;
                     break;

                     case 6:
                     obj->value[0] = 4;
                     sprintf(name_set, "crude war hammer");
                     sprintf(shor_set, "crude war hammer");
                     sprintf(long_set, "a crude war hammer is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 27;
                     obj->value[2] = 33;
                     obj->level    = 30;
                     break;

                     case 7:
                     obj->value[0] = 4;
                     sprintf(name_set, "club");
                     sprintf(shor_set, "club");
                     sprintf(long_set, "a club is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 32;
                     obj->value[2] = 37;
                     obj->level    = 35;
                     break;

                     case 8:
                     obj->value[0] = 4;
                     sprintf(name_set, "spiked club");
                     sprintf(shor_set, "spiked club");
                     sprintf(long_set, "a spiked club is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 37;
                     obj->value[2] = 43;
                     obj->level    = 40;
                     break;

                     case 9:
                     obj->value[0] = 4;
                     sprintf(name_set, "mace");
                     sprintf(shor_set, "mace");
                     sprintf(long_set, "a mace is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 42;
                     obj->value[2] = 58;
                     obj->level    = 45;
                     break;

                     case 10:
                     obj->value[0] = 4;
                     sprintf(name_set, "morning star");
                     sprintf(shor_set, "morning star");
                     sprintf(long_set, "a morning star is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 46;
                     obj->value[2] = 56;
                     obj->level    = 50;
                     break;

                     case 11:
                     obj->value[0] = 4;
                     sprintf(name_set, "flail");
                     sprintf(shor_set, "flail");
                     sprintf(long_set, "a flail is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 51;
                     obj->value[2] = 59;
                     obj->level    = 55;
                     break;

                     case 12:
                     obj->value[0] = 4;
                     sprintf(name_set, "war hammer");
                     sprintf(shor_set, "war hammer");
                     sprintf(long_set, "a war hammer is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 56;
                     obj->value[2] = 64;
                     obj->level    = 60;
                     break;

                     case 13:
                     obj->value[0] = 4;
                     sprintf(name_set, "iron club");
                     sprintf(shor_set, "iron club");
                     sprintf(long_set, "a iron club is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 61;
                     obj->value[2] = 69;
                     obj->level    = 65;
                     break;

                     case 14:
                     obj->value[0] = 4;
                     sprintf(name_set, "iron spiked club");
                     sprintf(shor_set, "iron spiked club");
                     sprintf(long_set, "a iron spiked club is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 66;
                     obj->value[2] = 74;
                     obj->level    = 70;
                     break;

                     case 15:
                     obj->value[0] = 4;
                     sprintf(name_set, "iron mace");
                     sprintf(shor_set, "iron mace");
                     sprintf(long_set, "a iron mace is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 70;
                     obj->value[2] = 80;
                     obj->level    = 75;
                     break;

                     case 16:
                     obj->value[0] = 4;
                     sprintf(name_set, "iron morning star");
                     sprintf(shor_set, "iron morning star");
                     sprintf(long_set, "a iron morning star is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 75;
                     obj->value[2] = 85;
                     obj->level    = 80;
                     break;

                     case 17:
                     obj->value[0] = 4;
                     sprintf(name_set, "iron flail");
                     sprintf(shor_set, "iron flail");
                     sprintf(long_set, "a iron flail is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 80;
                     obj->value[2] = 90;
                     obj->level    = 85;
                     break;

                     case 18:
                     obj->value[0] = 4;
                     sprintf(name_set, "iron war hammer");
                     sprintf(shor_set, "iron war hammer");
                     sprintf(long_set, "a iron war hammer is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 85;
                     obj->value[2] = 95;
                     obj->level    = 90;
                     break;

                     case 19:
                     obj->value[0] = 4;
                     sprintf(name_set, "copper club");
                     sprintf(shor_set, "copper club");
                     sprintf(long_set, "a copper club is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 90;
                     obj->value[2] = 100;
                     obj->level    = 95;
                     break;

                     case 20:
                     obj->value[0] = 4;
                     sprintf(name_set, "copper spiked club");
                     sprintf(shor_set, "copper spiked club");
                     sprintf(long_set, "a copper spiked club is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 90;
                     obj->value[2] = 110;
                     obj->level    = 100;
                     break;

                     case 21:
                     obj->value[0] = 4;
                     sprintf(name_set, "copper mace");
                     sprintf(shor_set, "copper mace");
                     sprintf(long_set, "a copper mace is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 95;
                     obj->value[2] = 115;
                     obj->level    = 103; //105
                     break;

                     case 22:
                     obj->value[0] = 4;
                     sprintf(name_set, "copper morning star");
                     sprintf(shor_set, "morning star");
                     sprintf(long_set, "a morning star is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 100;
                     obj->value[2] = 120;
                     obj->level    = 107;   //110
                     break;

                     case 23:
                     obj->value[0] = 4;
                     sprintf(name_set, "copper flail");
                     sprintf(shor_set, "copper flail");
                     sprintf(long_set, "a copper flail is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 100;
                     obj->value[2] = 140;
                     obj->level    = 109;   //120
                     break;

                     case 24:
                     obj->value[0] = 4;
                     sprintf(name_set, "copper war hammer");
                     sprintf(shor_set, "copper war hammer");
                     sprintf(long_set, "a copper war hammer is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 100;
                     obj->value[2] = 150;
                     obj->level    = 111;   //125
                     break;

                     case 25:
                     obj->value[0] = 4;
                     sprintf(name_set, "maul");
                     sprintf(shor_set, "maul");
                     sprintf(long_set, "a maul is on the ground here.");
                     obj->name        = str_dup (name_set);
                     obj->short_descr = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 120;
                     obj->value[2] = 140;

                     obj->level    = 113;   //130
                     break;
              }
	}

	if (weapon_type == 5)
	{
		switch(weapon_type_5_name)
		{

                     case 1:
                     obj->value[0] = 2;
                     sprintf(name_set, "crude dagger dagger");
                     sprintf(shor_set, "crude dagger");
                     sprintf(long_set, "a crude dagger is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 3;
                     obj->value[2] = 13;
                     obj->level    = 5;
                     break;

                     case 2:
                     obj->value[0] = 2;
                     sprintf(name_set, "crude dirk dagger");
                     sprintf(shor_set, "crude dirk");
                     sprintf(long_set, "a crude dirk is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 7;
                     obj->value[2] = 23;
                     obj->level    = 10;
                     break;

                     case 3:
                     obj->value[0] = 2;
                     sprintf(name_set, "crude kris dagger");
                     sprintf(shor_set, "crude kris");
                     sprintf(long_set, "a crude kris is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 10;
                     obj->value[2] = 30;
                     obj->level    = 15;
                     break;

                     case 4:
                     obj->value[0] = 2;
                     sprintf(name_set, "crude stilleto dagger");
                     sprintf(shor_set, "crude stilleto");
                     sprintf(long_set, "a crude stilleto is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 13;
                     obj->value[2] = 37;
                     obj->level    = 20;
                     break;

                     case 5:
                     obj->value[0] = 2;
                     sprintf(name_set, "crude bone knife dagger");
                     sprintf(shor_set, "crude bone knife");
                     sprintf(long_set, "a crude bone knife is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 15;
                     obj->value[2] = 35;
                     obj->level    = 25;
                     break;

                     case 6:
                     obj->value[0] = 2;
                     sprintf(name_set, "dagger dagger");
                     sprintf(shor_set, "dagger");
                     sprintf(long_set, "a dagger is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 19;
                     obj->value[2] = 51;
                     obj->level    = 30;
                     break;

                     case 7:
                     obj->value[0] = 2;
                     sprintf(name_set, "dirk dagger");
                     sprintf(shor_set, "dirk");
                     sprintf(long_set, "a dirk is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 22;
                     obj->value[2] = 58;
                     obj->level    = 35;
                     break;

                     case 8:
                     obj->value[0] = 2;
                     sprintf(name_set, "kris dagger");
                     sprintf(shor_set, "kris");
                     sprintf(long_set, "a kris is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 25;
                     obj->value[2] = 65;
                     obj->level    = 40;
                     break;

                     case 9:
                     obj->value[0] = 2;
                     sprintf(name_set, "stilleto dagger");
                     sprintf(shor_set, "stilleto");
                     sprintf(long_set, "a stilleto is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 28;
                     obj->value[2] = 62;
                     obj->level    = 45;
                     break;

                     case 10:
                     obj->value[0] = 2;
                     sprintf(name_set, "bone knife dagger");
                     sprintf(shor_set, "bone knife");
                     sprintf(long_set, "a bone knife is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 31;
                     obj->value[2] = 69;
                     obj->level    = 50;
                     break;

                     case 11:
                     obj->value[0] = 2;
                     sprintf(name_set, "iron dagger dagger");
                     sprintf(shor_set, "iron dagger");
                     sprintf(long_set, "a iron dagger is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 34;
                     obj->value[2] = 76;
                     obj->level    = 55;
                     break;

                     case 12:
                     obj->value[0] = 2;
                     sprintf(name_set, "iron dirk dagger");
                     sprintf(shor_set, "iron dirk");
                     sprintf(long_set, "a iron dirk is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 36;
                     obj->value[2] = 84;
                     obj->level    = 60;
                     break;

                     case 13:
                     obj->value[0] = 2;
                     sprintf(name_set, "iron kris dagger");
                     sprintf(shor_set, "iron kris");
                     sprintf(long_set, "a iron kris is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 38;
                     obj->value[2] = 92;
                     obj->level    = 65;
                     break;

                     case 14:
                     obj->value[0] = 2;
                     sprintf(name_set, "iron stilleto dagger");
                     sprintf(shor_set, "iron stilleto");
                     sprintf(long_set, "a iron stilleto is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 40;
                     obj->value[2] = 100;
                     obj->level    = 70;
                     break;

                     case 15:
                     obj->value[0] = 2;
                     sprintf(name_set, "iron bone knife dagger");
                     sprintf(shor_set, "iron bone knife");
                     sprintf(long_set, "a iron bone knife is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 42;
                     obj->value[2] = 108;
                     obj->level    = 75;
                     break;

                     case 16:
                     obj->value[0] = 2;
                     sprintf(name_set, "steel dirk dagger");
                     sprintf(shor_set, "steel dirk");
                     sprintf(long_set, "a steel dirk is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 44;
                     obj->value[2] = 116;
                     obj->level    = 80;
                     break;

                     case 17:
                     obj->value[0] = 2;
                     sprintf(name_set, "steel kris dagger");
                     sprintf(shor_set, "steel kris");
                     sprintf(long_set, "a steel kris is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 46;
                     obj->value[2] = 124;
                     obj->level    = 85;
                     break;

                     case 18:
                     obj->value[0] = 2;
                     sprintf(name_set, "steel stilleto dagger");
                     sprintf(shor_set, "steel stilleto");
                     sprintf(long_set, "a steel stilleto is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 48;
                     obj->value[2] = 132;
                     obj->level    = 90;
                     break;

                     case 19:
                     obj->value[0] = 2;
                     sprintf(name_set, "steel bone knife dagger");
                     sprintf(shor_set, "steel bone knife");
                     sprintf(long_set, "a steel bone knife is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 50;
                     obj->value[2] = 140;
                     obj->level    = 95;
                     break;

                     case 20:
                     obj->value[0] = 2;
                     sprintf(name_set, "elvish dagger dagger");
                     sprintf(shor_set, "elvish dagger");
                     sprintf(long_set, "a elvish dagger is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 52;
                     obj->value[2] = 148;
                     obj->level    = 100;
                     break;

                     case 21:
                     obj->value[0] = 2;
                     sprintf(name_set, "elvish dirk dagger");
                     sprintf(shor_set, "elvish dirk");
                     sprintf(long_set, "a elvish dirk is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 54;
                     obj->value[2] = 166;
                     obj->level    = 105;        // 110
                     break;

                     case 22:
                     obj->value[0] = 2;
                     sprintf(name_set, "elvish kris dagger");
                     sprintf(shor_set, "elvish kris");
                     sprintf(long_set, "a elvish kris is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 56;
                     obj->value[2] = 174;
                     obj->level    = 107;        // 115
                     break;

                     case 23:
                     obj->value[0] = 2;
                     sprintf(name_set, "elvish stilleto dagger");
                     sprintf(shor_set, "elvish stilleto");
                     sprintf(long_set, "a elvish stilleto is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 57;
                     obj->value[2] = 183;
                     obj->level    = 109;        // 120
                     break;

                     case 24:
                     obj->value[0] = 2;
                     sprintf(name_set, "mithril point dagger");
                     sprintf(shor_set, "mithril point");
                     sprintf(long_set, "a mithril point is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 58;
                     obj->value[2] = 192;
                     obj->level    = 111;        // 125
                     break;

                     case 25:
                     obj->value[0] = 2;
                     sprintf(name_set, "dwarven dagger dagger");
                     sprintf(shor_set, "dwarven dagger");
                     sprintf(long_set, "a dwarven dagger is on the ground here.");
                     obj->name         = str_dup (name_set);
                     obj->short_descr  = str_dup (shor_set);
                     obj->description  = str_dup (long_set);
                     obj->value[1] = 60;
                     obj->value[2] = 200;
                     obj->level    = 113;        // 130
                     break;
		}
	}

	if (weapon_type == 6)
	{
		switch(weapon_type_6_name)
		{

			case 1:
			obj->value[0] = 7;
			sprintf(name_set, "crude whip whip");
			sprintf(shor_set, "crude whip");
			sprintf(long_set, "a crude whip is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 10;
                     obj->level    = 5;
			break;

			case 2:
			obj->value[0] = 7;
			sprintf(name_set, "crude flog whip");
			sprintf(shor_set, "crude flog");
			sprintf(long_set, "a crude flog is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 20;
                     obj->level    = 10;
			break;

			case 3:
			obj->value[0] = 7;
			sprintf(name_set, "crude lash whip");
			sprintf(shor_set, "crude lash");
			sprintf(long_set, "a crude lash is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 30;
                     obj->level    = 15;
			break;

			case 4:
			obj->value[0] = 7;
			sprintf(name_set, "crude chain whip whip");
			sprintf(shor_set, "crude chain whip");
			sprintf(long_set, "a crude chain whip is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 40;
                     obj->level    = 20;
			break;

			case 5:
			obj->value[0] = 7;
			sprintf(name_set, "crude barbed whip whip");
			sprintf(shor_set, "crude barbed whip");
			sprintf(long_set, "a crude barbed whip is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 50;
                     obj->level    = 25;
			break;

			case 6:
			obj->value[0] = 7;
			sprintf(name_set, "whip whip");
			sprintf(shor_set, "whip");
			sprintf(long_set, "a whip is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 60;
                     obj->level    = 30;
			break;

			case 7:
			obj->value[0] = 7;
			sprintf(name_set, "flog whip");
			sprintf(shor_set, "flog");
			sprintf(long_set, "a flog is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 70;
                     obj->level    = 35;
			break;

			case 8:
			obj->value[0] = 7;
			sprintf(name_set, "lash whip");
			sprintf(shor_set, "lash");
			sprintf(long_set, "a lash is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 80;
                     obj->level    = 40;
			break;

			case 9:
			obj->value[0] = 7;
			sprintf(name_set, "chain whip whip");
			sprintf(shor_set, "chain whip");
			sprintf(long_set, "a chain whip is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 90;
                     obj->level    = 45;
			break;

			case 10:
			obj->value[0] = 7;
			sprintf(name_set, "barbed whip whip");
			sprintf(shor_set, "barbed whip");
			sprintf(long_set, "a barbed whip is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 100;
                     obj->level    = 50;
			break;

			case 11:
			obj->value[0] = 7;
			sprintf(name_set, "leather whip whip");
			sprintf(shor_set, "leather whip");
			sprintf(long_set, "a leather whip is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 110;
                     obj->level    = 55;
			break;

			case 12:
			obj->value[0] = 7;
			sprintf(name_set, "leather flog whip");
			sprintf(shor_set, "leather flog");
			sprintf(long_set, "a leather flog is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 120;
                     obj->level    = 60;
			break;

			case 13:
			obj->value[0] = 7;
			sprintf(name_set, "leather lash whip");
			sprintf(shor_set, "leather lash");
			sprintf(long_set, "a leather lash is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 130;
                     obj->level    = 65;
			break;

			case 14:
			obj->value[0] = 7;
			sprintf(name_set, "leather chain whip whip");
			sprintf(shor_set, "leather chain whip");
			sprintf(long_set, "a leather chain whip is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 140;
                     obj->level    = 70;
			break;

			case 15:
			obj->value[0] = 7;
			sprintf(name_set, "leather barbed whip whip");
			sprintf(shor_set, "leather barbed whip");
			sprintf(long_set, "a leather barbed whip is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 150;
                     obj->level    = 75;
			break;

			case 16:
			obj->value[0] = 7;
			sprintf(name_set, "snake headed whip whip");
			sprintf(shor_set, "snake headed whip");
			sprintf(long_set, "a snake headed whip is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 160;
                     obj->level    = 80;
			break;

			case 17:
			obj->value[0] = 7;
			sprintf(name_set, "snake headed flog whip");
			sprintf(shor_set, "snake headed flog");
			sprintf(long_set, "a snake headed flog is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 170;
                     obj->level    = 85;
			break;

			case 18:
			obj->value[0] = 7;
			sprintf(name_set, "snake headed chain whip whip");
			sprintf(shor_set, "snake headed chain whip");
			sprintf(long_set, "a snake headed chain whip is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 180;
                     obj->level    = 90;
			break;

			case 19:
			obj->value[0] = 7;
			sprintf(name_set, "snake headed barbed whip whip");
			sprintf(shor_set, "snake headed barbed whip");
			sprintf(long_set, "a snake headed barbed whip is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 190;
                     obj->level    = 95;
			break;

			case 20:
			obj->value[0] = 7;
			sprintf(name_set, "dragon tailed whip whip");
			sprintf(shor_set, "dragon tailed whip");
			sprintf(long_set, "a dragon tailed whip is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 200;
                     obj->level    = 100;
			break;

			case 21:
			obj->value[0] = 7;
			sprintf(name_set, "dragon tailed flog whip");
			sprintf(shor_set, "dragon tailed flog");
			sprintf(long_set, "a dragon tailed flog is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 210;
                     obj->level    = 103;	// 105
			break;

			case 22:
			obj->value[0] = 7;
			sprintf(name_set, "dragon tailed lash whip");
			sprintf(shor_set, "dragon tailed lash");
			sprintf(long_set, "a dragon tailed lash is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 220;
                     obj->level    = 105;	// 110
			break;

			case 23:
			obj->value[0] = 7;
			sprintf(name_set, "dragon tailed chain whip whip");
			sprintf(shor_set, "dragon tailed chain whip");
			sprintf(long_set, "a dragon tailed chain whip is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 230;
                     obj->level    = 107;	// 115
			break;

			case 24:
			obj->value[0] = 7;
			sprintf(name_set, "dragon tailed barbed whip whip");
			sprintf(shor_set, "dragon tailed barbed whip");
			sprintf(long_set, "a dragon tailed barbed whip is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 240;
                     obj->level    = 111;	// 120
			break;

			case 25:
			obj->value[0] = 7;
			sprintf(name_set, "Cat-o-nine-tails whip");
			sprintf(shor_set, "Cat-o-nine-tails");
			sprintf(long_set, "a Cat-o-nine-tails is on the ground here.");
			obj->name        = str_dup (name_set);
			obj->short_descr = str_dup (shor_set);
			obj->description  = str_dup (long_set);
                     obj->value[1] = 1;
                     obj->value[2] = 250;
                     obj->level    = 113;	// 125
			break;
		}
	}

gen_weapon_choice(obj, level);


/* END : Set the Damage of the weapon */
   obj->weight   = number_range(3, 8);
   obj->cost     = number_range(1, (level * 5) );

   return (obj);
}