circlemud_squared_0.5.153/cnf/
circlemud_squared_0.5.153/etc/
circlemud_squared_0.5.153/etc/etc/
circlemud_squared_0.5.153/etc/house/
circlemud_squared_0.5.153/etc/misc/
circlemud_squared_0.5.153/etc/plralias/A-E/
circlemud_squared_0.5.153/etc/plralias/F-J/
circlemud_squared_0.5.153/etc/plralias/K-O/
circlemud_squared_0.5.153/etc/plralias/P-T/
circlemud_squared_0.5.153/etc/plralias/U-Z/
circlemud_squared_0.5.153/etc/plralias/ZZZ/
circlemud_squared_0.5.153/etc/plrobjs/
circlemud_squared_0.5.153/etc/plrobjs/A-E/
circlemud_squared_0.5.153/etc/plrobjs/F-J/
circlemud_squared_0.5.153/etc/plrobjs/K-O/
circlemud_squared_0.5.153/etc/plrobjs/P-T/
circlemud_squared_0.5.153/etc/plrobjs/U-Z/
circlemud_squared_0.5.153/etc/plrobjs/ZZZ/
circlemud_squared_0.5.153/etc/text/
circlemud_squared_0.5.153/etc/text/help/
circlemud_squared_0.5.153/src/util/
circlemud_squared_0.5.153/src/util/worldconv/
/**
 * @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__ */