Manual:DIL Manual/ability points

From DikuMUD Wiki
Jump to navigation Jump to search

ability points

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

pc.ability_points : integer

The player's unspent ability points: training an ability (strength, dexterity, ...) at a teacher costs them. A player gets more at each level gained (vmelimits.cpp); pcinitabils@basis gives a new (or reborn) player 10.

Notes

  • Players only. On an NPC, an object, a room or null the field fails.
  • Assignable from any zone. Nothing stops a program from setting it below 0.
  • Stored as a 32-bit signed number.
  • Skills, spells and weapons are trained with skill_points instead.

Example

dilbegin reward_training(pc : unitptr, n : integer);
code
{
   if (pc.type != UNIT_ST_PC)
      return;
   pc.ability_points := pc.ability_points + n;
   sendtext("You gain " + itoa(n) + " ability points.<br/>", pc);
   return;
}
dilend

Gives a player extra ability points, for example as a quest reward.

See also