--- deliantra/server/common/item.C 2007/07/10 05:51:37 1.39 +++ deliantra/server/common/item.C 2007/09/30 20:22:12 1.40 @@ -1161,6 +1161,38 @@ return std::string (::describe_item (this, who)); } +void +examine (object *op, object *tmp) +{ + std::string s = tmp->describe (op); + + new_draw_info (NDI_UNIQUE, 0, op, s.c_str ()); +} + +/* + * inventory prints object's inventory. If inv==NULL then print player's + * inventory. + * [ Only items which are applied are showed. Tero.Haatanen@lut.fi ] + */ +const char * +object::query_inventory (object *who, const char *indent) +{ + static dynbuf_text buf; buf.clear (); + + for (object *tmp = inv; tmp; tmp = tmp->below) + if (who && QUERY_FLAG (who, FLAG_WIZ)) + buf.printf ("%s- %-28.28s (%5d) %-8s\n", indent, query_name (tmp), tmp->count, query_weight (tmp)); + else if (!tmp->invisible && (type == CONTAINER || QUERY_FLAG (tmp, FLAG_APPLIED))) + buf.printf ("%s- %-36.36s %-8s\n", indent, query_name (tmp), query_weight (tmp)); + + if (buf.size ()) + buf.printf ("%s(total weight: %s)\n", indent, query_weight (this)); + else + buf.printf ("%s(empty)\n", indent); + + return buf; +} + /* Return true if the item is magical. A magical item is one that * increases/decreases any abilities, provides a resistance, * has a generic magical bonus, or is an artifact.