/** * @file item.h * @ingroup item * * Item based code * * @author Geoff Davis <geoff@circlemudsquared.org> * @author Greg Buxton <greg@circlemudsquared.org> * * @par Copyright: * Copyright (C) 2006 Geoff Davis <geoff@circlemudsquared.org><br> * Greg Buxton <greg@circlemudsquared.org> * * @par * Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University<br> * CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * * @par * All rights reserved. See license.doc for complete information. * * @package cs * @version 1.0 */ #ifndef __ITEM_H__ #define __ITEM_H__ #include "base.h" #include "dao.h" /* ************************************************************************ */ /* Structure Definitions */ /* ************************************************************************ */ /** * @ingroup item * * @brief Memory structure for items * * This structure combines the old itemData_t and itemFlags_t structures into * one single structure. * * @defgroup itemDataStruct * @{ */ struct _itemData_t { itemVnum_t vnum; /**< VNum for the item */ zoneData_t *zone; /**< Zone item is in */ itemData_t *prototype; /**< Prototype of this object */ char *name; /**< Keywords (for GET, LOOK, etc) */ char *description; /**< Description when in room */ char *shortDescription; /**< Description when in inventory */ char *actionDescription; /**< Description when "in use" */ extraDescData_t *exDescription; /**< Extra Descriptions */ int number; /**< Number in existance */ roomData_t *room; /**< Room item is in */ itemData_t *inObj; /**< Item it's in or NULL */ itemData_t *contains; /**< Items contained */ itemData_t *nextContent; /**< Next 'contains' item */ itemData_t *key; /**< Pointer to prototype for key */ char *keyStr; /**< String value for key vnum */ charData_t *carriedBy; /**< PC/NPC or NULL */ charData_t *wornBy; /**< PC/NPC or NULL */ int wornOn; /**< Location worn */ int value[4]; /**< Values of the item */ int typeFlag; /**< Type of item */ int wearFlags; /**< Where item can be worn */ int extraFlags; /**< Extra flags (glow, hum, ...) */ int weight; /**< Weight of item */ int cost; /**< Value when sold */ int costPerDay; /**< Cost to keep per RL day */ int timer; /**< Timer for object */ int bitvector; /**< To set char's bits */ itemEffectData_t affected[MAX_ITEM_AFFECT]; /**< Affects */ SPECIAL(*func); /**< spec_proc function pointer */ itemData_t *next; /**< Will be removed. For object_list */ }; /** * @} */ /* ************************************************************************ */ /* Public functions */ /* ************************************************************************ */ void itemData_toDao(daoData_t *parentDao, itemData_t *item); void itemData_setName(itemData_t *item, char *name); void itemData_setDescription(itemData_t *item, char *description); void itemData_setShortDescription(itemData_t *item, char *shortDescription); void itemData_setActionDescription(itemData_t *item, char *actionDescription); void itemData_loadItemsInZone(zoneData_t *zone, daoData_t *itemListDao); bool itemData_isPrototype(itemData_t *item); itemData_t *itemData_newPrototype(zoneData_t *zone, itemVnum_t iVnum); itemData_t *itemData_findPrototypeInZone(zoneData_t *zone, itemVnum_t iVnum); itemData_t *itemData_findPrototype(itemData_t *item); itemData_t *itemData_find(char *strVnum); itemData_t *itemData_findForChar(charData_t *ch, char *strVnum); itemData_t *itemData_getInList(itemData_t *list, itemData_t *itemProto); itemData_t *itemData_getInWorld(itemData_t *itemProto); #endif /* __ITEM_H__ */