Manual:DIL Manual/reset vlevel()
Jump to navigation
Jump to search
reset_vlevel()
Procedure. Sets a mortal player's virtual level back to 1.
reset_vlevel(pc : unitptr)
Sets vlevel to 1 and changes nothing else. Experience, abilities, skills and hit points stay as they are; a reroll changes those separately.
Only a program started in a zone with access level 0 or 1 (the fourth column of vme/etc/zonelist) can use it. What counts is the zone of the program's first template, the one that was dilcopy'd or run as a command. Elsewhere the zone log gets "attempt to reset vlevel w/o access" and the program stops.
Parameters
| Name | Type | Meaning |
|---|---|---|
| pc | unitptr | The player. |
Notes
- Nothing happens to NPCs, objects and rooms, or to immortals (level
IMMORTAL_LEVELand up). - A null unit variable is logged ("reset_vlevel with no unit") and nothing happens.
Example
dilbegin back_to_one(pc : unitptr);
code
{
if ((pc.type != UNIT_ST_PC) or (pc.level >= IMMORTAL_LEVEL))
return;
reset_level(pc);
reset_vlevel(pc);
reset_race(pc);
sendtext("You are back at level 1.<br/>", pc);
}
dilend
Puts a mortal player back to level 1, and resets the virtual level and the race's values (reset_race()) too.