415a416,469
> 
> /*
>  * Strip an "object name" into a buffer
>  */
> static void strip_name_art(char *buf, int a_idx)
> {
> 	char *t, *tt;
> 	int i;
> 	object_type		localObject;
> 	object_type *	q_ptr;
> 	artifact_type	*a_ptr = &a_info[a_idx];
> 
> 	char str[80];
> 
> 
> 	/* Get local object */
> 	q_ptr = &localObject;
> 
> 	/* Wipe the object */
> 	object_wipe(q_ptr);
> 
> 	/* Acquire the "kind" index */
> 	i = lookup_kind(a_ptr->tval, a_ptr->sval);
> 
> 	/* Oops */
> 	if (!i) return;
> 
> 	/* Create the artifact */
> 	object_prep(q_ptr, i);
> 
> 	/* Save the name */
> 	q_ptr->name1 = a_idx;
> 
> 	/* Make it known to us */
> 	q_ptr->ident |= IDENT_KNOWN;
> 
> 	/* Create the artifact description*/
> 	object_desc(str, q_ptr, FALSE, FALSE);
> 
> 	t = str;
> 
> 	/* Skip past leading characters */
> 	while ((*t == ' ') || (*t == '&'))  t++;
> 
> 	/* Copy useful chars */
> 	for (tt = buf; *t; t++)
> 	{
> 		if (*t != '~') *tt++ = *t;
> 	}
> 
> 	/* Terminate the new name */
> 	*tt = '\0';
> }
> 
424a479,510
> typedef struct
> {
> 	byte tval;
> 	cptr name;
> } art_group;
> 
> 
> static art_group group_artifact[] =
> {
> 	{ TV_SWORD,			"Edged Weapons" },
> 	{ TV_POLEARM,		"Polearms" },
> 	{ TV_HAFTED,		"Hafted Weapons" },
> 	{ TV_BOW,			"Bows" },
> 	{ TV_SOFT_ARMOR,	"Soft Armor" },
> 	{ TV_HARD_ARMOR,	"Hard Armour" },
> 	{ TV_DRAG_ARMOR,	"Dragon Scale Armour" },
> 	{ TV_CLOAK,			"Cloaks" },
> 	{ TV_SHIELD,		"Shields" },
> 	{ TV_HELM,			"Helms" },
> 	{ TV_CROWN,			"Crowns" },
> 	{ TV_GLOVES,		"Gloves" },
> 	{ TV_BOOTS,			"Boots" },
> 	{ TV_LITE,			"Light Sources" },
> 	{ TV_AMULET,		"Amulets" },
> 	{ TV_RING,			"Rings" },
> 	{ 0, NULL }
> };
> 
> 
> 
> 
> 
430c516
< static int wiz_create_itemtype(void)
---
> static int wiz_create_itemtype(bool isArtifact)
443d528
< 
447,448c532,543
< 	/* Print all tval's and their descriptions */
< 	for (num = 0; (num < 60) && tvals[num].tval; num++)
---
> 	if( !isArtifact )
> 	{
> 		/* Print all tval's and their descriptions */
> 		for (num = 0; (num < 60) && tvals[num].tval; num++)
> 		{
> 			row = 2 + (num % 20);
> 			col = 30 * (num / 20);
> 			ch = head[num/20] + (num%20);
> 			prt(format("[%c] %s", ch, tvals[num].desc), row, col);
> 		}
> 	}
> 	else
450,453c545,552
< 		row = 2 + (num % 20);
< 		col = 30 * (num / 20);
< 		ch = head[num/20] + (num%20);
< 		prt(format("[%c] %s", ch, tvals[num].desc), row, col);
---
> 		/* Print all tval's and their descriptions */
> 		for (num = 0; (num < 60) && group_artifact[num].tval; num++)
> 		{
> 			row = 2 + (num % 20);
> 			col = 30 * (num / 20);
> 			ch = head[num/20] + (num%20);
> 			prt(format("[%c] %s", ch, group_artifact[num].name), row, col);
> 		}
471,474d569
< 	/* Base object type chosen, fill in tval */
< 	tval = tvals[num].tval;
< 	tval_desc = tvals[num].desc;
< 
481,482c576
< 	/* We have to search the whole itemlist. */
< 	for (num = 0, i = 1; (num < 60) && (i < MAX_K_IDX); i++)
---
> 	if( !isArtifact )
484c578,580
< 		object_kind *k_ptr = &k_info[i];
---
> 		/* Base object type chosen, fill in tval */
> 		tval = tvals[num].tval;
> 		tval_desc = tvals[num].desc;
486,487c582,583
< 		/* Analyze matching items */
< 		if (k_ptr->tval == tval)
---
> 		/* We have to search the whole itemlist. */
> 		for (num = 0, i = 1; (num < 60) && (i < MAX_K_IDX); i++)
489,490c585
< 			/* Hack -- Skip instant artifacts */
< 			if (k_ptr->flags3 & (TR3_INSTA_ART)) continue;
---
> 			object_kind *k_ptr = &k_info[i];
492,495c587,626
< 			/* Prepare it */
< 			row = 2 + (num % 20);
< 			col = 30 * (num / 20);
< 			ch = head[num/20] + (num%20);
---
> 			/* Analyze matching items */
> 			if (k_ptr->tval == tval)
> 			{
> 				/* Hack -- Skip instant artifacts */
> 				if (k_ptr->flags3 & (TR3_INSTA_ART)) continue;
> 
> 				/* Prepare it */
> 				row = 2 + (num % 20);
> 				col = 30 * (num / 20);
> 				ch = head[num/20] + (num%20);
> 
> 				/* Acquire the "name" of object "i" */
> 				strip_name(buf, i);
> 
> 				/* Print it */
> 				prt(format("[%c] %s", ch, buf), row, col);
> 
> 				/* Remember the object index */
> 				choice[num++] = i;
> 			}
> 		}
> 	}
> 	else
> 	{
> 		/* Base object type chosen, fill in tval */
> 		tval = group_artifact[num].tval;
> 		tval_desc = group_artifact[num].name;
> 
> 		/* We have to search the whole  artifact list. */
> 		for (num = 0, i = 1; (num < 60) && (i < MAX_A_IDX); i++)
> 		{
> 			artifact_type *a_ptr = &a_info[i];
> 
> 			/* Analyze matching items */
> 			if (a_ptr->tval == tval)
> 			{
> 				/* Prepare it */
> 				row = 2 + (num % 20);
> 				col = 30 * (num / 20);
> 				ch = head[num/20] + (num%20);
497,498c628,629
< 			/* Acquire the "name" of object "i" */
< 			strip_name(buf, i);
---
> 				/* Acquire the "name" of object "i" */
> 				strip_name_art(buf, i);
500,501c631,632
< 			/* Print it */
< 			prt(format("[%c] %s", ch, buf), row, col);
---
> 				/* Print it */
> 				prt(format("[%c] %s", ch, buf ), row, col);
503,504c634,636
< 			/* Remember the object index */
< 			choice[num++] = i;
---
> 				/* Remember the object index */
> 				choice[num++] = i;
> 			}
1003c1135
< 	k_idx = wiz_create_itemtype();
---
> 	k_idx = wiz_create_itemtype( 0 );
1028a1161,1221
> // Create an artifact
> static void wiz_create_artifact()
> {
> 
> 	object_type forge;
> 	object_type *q_ptr;
> 	int i;
> 	int a_idx;
> 	artifact_type *a_ptr;// = &a_info[a_idx];
> 
> 
> 	/* Save screen */
> 	screen_save();
> 
> 	/* Get object base type */
> 	a_idx = wiz_create_itemtype( 1 );
> 
> 	/* Load screen */
> 	screen_load();
> 
> 	/* Get the particular artifact */
> 	a_ptr = &a_info[a_idx];
> 
> 	/* Get local object */
> 	q_ptr = &forge;
> 
> 	/* Wipe the object */
> 	object_wipe(q_ptr);
> 
> 	/* Ignore "empty" artifacts */
> 	if (!a_ptr->name) return;
> 
> 	/* Acquire the "kind" index */
> 	i = lookup_kind(a_ptr->tval, a_ptr->sval);
> 
> 	/* Oops */
> 	if (!i) return;
> 
> 	/* Create the artifact */
> 	object_prep(q_ptr, i);
> 
> 	/* Save the name */
> 	q_ptr->name1 = a_idx;
> 
> 	/* Extract the fields */
> 	q_ptr->pval = a_ptr->pval;
> 	q_ptr->ac = a_ptr->ac;
> 	q_ptr->dd = a_ptr->dd;
> 	q_ptr->ds = a_ptr->ds;
> 	q_ptr->to_a = a_ptr->to_a;
> 	q_ptr->to_h = a_ptr->to_h;
> 	q_ptr->to_d = a_ptr->to_d;
> 	q_ptr->weight = a_ptr->weight;
> 
> 	/* Drop the artifact from heaven */
> 	drop_near(q_ptr, -1, p_ptr->py, p_ptr->px);
> 
> 	/* All done */
> 	msg_print("Allocated.");
> }
> 
1465a1659,1665
> 			break;
> 		}
> 
> 		/* Create an artifact */
> 		case 'C':
> 		{
> 			wiz_create_artifact();
