Manual:DIL Manual/opendiff

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:11, 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

opendiff

Field (integer, read/write; units: all, used on containers).

u.opendiff : integer

How hard the unit's lock is to pick. The pick command in skills.zon passes it as the difficulty of the SKI_PICK_LOCK check, so higher is harder and 0 is no extra difficulty. In a zone file it follows the open flags: open {EX_OPEN_CLOSE, EX_CLOSED, EX_LOCKED} difficulty 50, where vmc accepts 0 to 250.

Notes

  • A lock with EX_PICKPROOF in openflags can't be picked whatever this is.
  • A room's exits have their own difficulty, exit_diff.
  • Stored as an 8-bit unsigned number: values outside 0 to 255 wrap around.
  • On null it fails.

Example

dilbegin harden_lock(item : unitptr, more : integer);
var
   d : integer;
code
{
   d := item.opendiff + more;
   if (d > 250)
      d := 250;
   item.opendiff := d;
   return;
}
dilend

Makes a lock harder to pick, keeping it within the range vmc allows.

See also