Manual:DIL Manual/exit diff

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

exit_diff

Field (integer, read/write; units: rooms).

room.exit_diff[dir] : integer

The difficulty of the room's exit in direction dir, set with difficulty on the exit in the zone file (0 to 250). The zones use it as the difficulty of a skill check: climbing an EX_CLIMB exit and searching for a hidden one (basemove.zon), picking its lock (skills.zon); the server uses it when a character swims through the exit.

dir is a direction from vme.h, NORTH (0) to SOUTHWEST (9).

Notes

  • It fails when the unit is not a room, when dir is outside 0 to MAX_EXIT, and when the room has no exit that way.
  • Stored as an unsigned 8-bit number: values outside 0 to 255 wrap around. No access level is needed to assign it.

Example

dilbegin integer climb_roll(room : unitptr, dir : integer);
external
   integer skillchecksa@skills(skillidx : integer, abiidx : integer, difficulty : integer);
var
   diff : integer;
code
{
   if (not isset(room.exit_info[dir], EX_CLIMB))
      return (100);
   diff := room.exit_diff[dir];
   if (self.drunk > 0)
      diff := diff + 5 * self.drunk;
   return (skillchecksa@skills(SKI_CLIMB, ABIL_DEX, diff));
}
dilend

Rolls the climbing check for an exit, harder when drunk, as climb does in basemove.zon (a result above 0 is a success).

See also