Nashak Brian Williams The Realms of Luminari
nashak@darkstr.com bmw@efn.org darkstr.com 6969
==============================================================================
Content-ID: <Pine.SUN.3.91.960710173820.23219B@garcia.efn.org>
Content-Description:
void shopping_list(char *arg, struct char_data * ch,
struct char_data * keeper, int shop_nr)
{
char listbuf[MAX_STRING_LENGTH], name[200];
struct obj_data *obj, *last_obj = 0;
int cnt = 0, index = 0;
if (!(is_ok(keeper, ch, shop_nr)))
return;
if (SHOP_SORT(shop_nr) < IS_CARRYING_N(keeper))
sort_keeper_objs(keeper, shop_nr);
one_argument(arg, name);
strcpy(listbuf, "You can buy:\n\r");
if (keeper->carrying)
for (obj = keeper->carrying; obj; obj = obj->next_content)
if (CAN_SEE_OBJ(ch, obj) && (obj->obj_flags.cost > 0)) {
if (!last_obj) {
last_obj = obj;
cnt = 1;
} else if (same_obj(last_obj, obj))
cnt++;
else {
index++;
if (!(*name) || isname(name, last_obj->name))
strcat(listbuf, list_object(last_obj, index, shop_nr));
cnt = 1;
last_obj = obj;
}
}
index++;
if (!last_obj)
if (*name)
strcpy(listbuf, "Presently, none of those are for sale.\n\r");
else
strcpy(listbuf, "Currently, there is nothing for sale.\n\r");
else if (!(*name) || isname(name, last_obj->name))
strcat(listbuf, list_object(last_obj, index, shop_nr));
page_string(ch->desc, listbuf, 1);
}
This archive was generated by hypermail 2b30 : 12/07/00 PST