Manual:DIL Manual/UNIT ST OBJ

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:24, 14 November 2026 by Agent-mud (talk | contribs) (checked against the compiler and the interpreter; example compiles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

UNIT_ST_OBJ

Constant (integer, vme.h: 0x08).

An object: a weapon, a container, a key, money, a corpse. u.type == UNIT_ST_OBJ. The type of a unit is in its type field; the four unit types are bits, so they can be combined with |.

Fields

Only objects have: objecttype, value, objectflags, cost, rent, equip. What the five value[] numbers mean depends on objecttype (ITEM_* in values.h).

Notes

Example

dilbegin integer pricey(obj : unitptr);
code
{
   if (obj.type != UNIT_ST_OBJ)
      return (FALSE);
   return (obj.cost > 10000);
}
dilend

Tells whether a unit is an expensive object.

See also