Here is my 'exhibit' function for use at shopkeepers :
void shopping_exhibit(char *arg, struct char_data * ch, struct char_data
* keeper, int shop_nr)
{
char *desc;
struct obj_data *obj;
int weapon = 0, use = FALSE;
*buf2 = '\0';
if (!(is_ok(keeper, ch, shop_nr)))
return;
if (!(*arg)) {
sprintf(buf, "%s What do you want me to exhibit?", GET_NAME(ch));
do_tell(keeper, buf, cmd_tell, 0);
return;
}
if (!(obj = get_purchase_obj(ch, arg, keeper, shop_nr, TRUE)))
return;
if (GET_OBJ_TYPE(obj) == ITEM_WEAPON)
weapon = 1;
sprintf(buf, "%s is exhibited to you :\r\n", obj->short_description);
if (GET_OBJ_TYPE(obj) == ITEM_LIGHT) {
if (GET_OBJ_VAL(obj, 2) == -1)
strcat(buf, "This will light your surroundings
indefinitely.\r\n");
else
sprintf(buf + strlen(buf), "This will provide light for about %d
more hours.\r\n",
GET_OBJ_VAL(obj, 2));
}
else if ((desc = find_exdesc(obj->name, obj->ex_description)) != NULL)
sprintf(buf + strlen(buf), "%s", desc);
if ((GET_OBJ_TYPE(obj) == ITEM_WAND) || (GET_OBJ_TYPE(obj) ==
ITEM_STAFF))
if (GET_OBJ_VAL(obj, 2) < GET_OBJ_VAL(obj, 1))
strcat(buf, "It looks to have been partially used.\r\n");
sprintf(buf + strlen(buf), "It looks to weigh about %d pounds\r\n",
GET_OBJ_WEIGHT(obj)));
if (weapon) {
switch GET_OBJ_VAL(obj, 3) {
case 0:
case 3:
case 10:
strcat(buf2, "slashing");
break;
case 1:
case 11:
case 14:
strcat(buf2, "piercing");
break;
case 2:
strcat(buf2, "whipping");
break;
case 4:
case 8:
case 9:
case 13:
strcat(buf2, "unusual");
break;
case 5:
case 6:
case 7:
case 12:
strcat(buf2, "bludgeoning");
break;
default:
break;
}
sprintf(buf + strlen(buf), "It is suited for '%s' attacks.\r\n",
buf2);
}
if ((OBJ_FLAGGED(obj, ITEM_ANTI_GOOD) && IS_GOOD(ch)) ||
(OBJ_FLAGGED(obj, ITEM_ANTI_EVIL) && IS_EVIL(ch)) ||
(OBJ_FLAGGED(obj, ITEM_ANTI_NEUTRAL) && IS_NEUTRAL(ch)))
strcat(buf, "Unfortunately alignment differences will not allow you
to use it.\r\n");
page_string(ch->desc, buf, 1, "");
return;
}
Add 'exhibit' to interpreter.c command list.
Add :
else if (CMD_IS("exhibit")) {
shopping_exhibit(argument, ch, keeper, shop_nr);
return (TRUE);
}
to the shop_keeper special.
And that should add the 'exhibit' command to all the shops you have, and of
course enhance the function!
Have fun,
Melleth
-----Original Message-----
From: Circle Discussion List [mailto:CIRCLE@post.queensu.ca]On Behalf Of
Alex Mann
Sent: 26 November 2000 15:59
To: CIRCLE@post.queensu.ca
Subject: [CIRCLE] Browse function for shops
Hi
I was wondering if anyone had added a browse function to thier shop code,
which would basicly show the look at description of the item the player
wishes to browse. I have done no work what so ever with the shop code so i
don't know quite how this would work.
Cheers
Alex Mann
naryanworld.orisis.net port 4445
____________________________________________________________________________
_________
Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
--
+---------------------------------------------------------------+
| FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
| Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
+---------------------------------------------------------------+
--
+---------------------------------------------------------------+
| FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
| Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
+---------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 04/11/01 PDT