Manual:DIL Manual/spell levels
Jump to navigation
Jump to search
Contents
spell_levels
Field (integer, read/write; units: PC).
pc.spell_levels[i] : integer
How many times the player has practised spell i (an SPL_* number, 0 to SPL_TREE_MAX - 1) since the last level gained. A guild teacher raises it at each practice (and raises a group's when the group goes up with it), and uses it in the price of the next practice: each practice at the same level costs more, and how many are allowed per level depends on the race and profession. Every level gained sets it back to 0 for all spells.
Notes
- Players only. On an NPC, an object, a room or null, or with an index out of range, the field fails.
- Only a program whose first template is in a zone with access level 0 (fourth column of
vme/etc/zonelist) can assign it. 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 0 to 255: other values wrap around.
Example
dilbegin integer trained_now(pc : unitptr, spl : integer);
code
{
if (pc.type != UNIT_ST_PC)
return (FALSE);
return (pc.spell_levels[spl] > 0);
}
dilend
Tells whether a player has practised a spell since the last level.