Manual:DIL Manual/skills

From DikuMUD Wiki
Jump to navigation Jump to search

skills

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

pc.skills[index] : integer

A player's skill, in percent, in the skill with that index. The indexes are the SKI_* constants in vme/include/values.h (SKI_FIRST_AID, SKI_SEARCH, ...), from 0 to SKI_TREE_MAX - 1 (vme.h). Training at a guild raises it; skill_name(index) gives the skill's name.

Notes

  • Players only. On an NPC, an object, a room or null the field fails; so does an index outside 0 to SKI_TREE_MAX - 1.
  • Only a program in a zone with access level 0 (the fourth column of vme/etc/zonelist) can assign it, as basis.zon does to give a new player the starting skills. Elsewhere vmc accepts the assignment, but at run time the program logs "DIL SERIOUS: ... Type error in lvalue assignemt" and stops. Reading works in every zone.
  • Stored as a signed 16-bit number: values outside -32768 to 32767 wrap around.
  • NPCs have no skills of this kind; use weapons and spells for them.

Example

dilbegin integer first_aid_roll(pc : unitptr);
code
{
   if (pc.type != UNIT_ST_PC)
      return (FALSE);
   return (openroll(60, 5) < pc.skills[SKI_FIRST_AID]);
}
dilend

Rolls against a player's first aid skill, as the healing balm in udgaard.zon does.

See also