Difference between revisions of "Manual:DIL Manual/reset vlevel()"

From DikuMUD Wiki
Jump to navigation Jump to search
(XML import)
(checked against the compiler and the interpreter; example compiles)
 
Line 1: Line 1:
−
<span id="bpresetvlevel"></span>
+
= reset_vlevel() =
 +
'''Procedure.''' Sets a mortal player's virtual level back to 1.
  
−
  '''Function:'''  <i><!--CODE-->reset_vlevel( u : unitptr ) ;</i><!--ENDCODE-->
+
  reset_vlevel(pc : unitptr)
  
−
<!--TERM-->  '''u'''
+
Sets [[Manual:DIL Manual/vlevel|vlevel]] to 1 and changes nothing else. Experience, abilities, skills and hit points stay as they are; a reroll changes those separately.
−
<!--DEFINITION-->        player your resetting
 
  
−
This function simply resets a players virtual level.  Can be used in functions
+
Only a program started in a zone with access level 0 or 1 (the fourth column of <code>vme/etc/zonelist</code>) can use it. What counts is the zone of the program's first template, the one that was <code>dilcopy</code>'d or run as a command. Elsewhere the zone log gets "attempt to reset vlevel w/o access" and the program stops.
−
like reroll where you set the players back to the way he first logged on.
 
−
'''Example:  '''<i><!--CODE-->reset_vlevel (u);</i><!--ENDCODE-->
 
−
'''See Also'''
 
−
<i><!--CODE-->
 
−
[[#bpresetlevel|reset a players level]] and
 
−
[[#bpresetrace|reset a players race information]]</i><!--ENDCODE-->
 
−
<span id="bpresetvlevel"></span>
 
  
−
'''Function:'''  <i><!--CODE-->reset_vlevel( u : unitptr ) ;</i><!--ENDCODE-->
+
== Parameters ==
 +
{| class="wikitable"
 +
! Name !! Type !! Meaning
 +
|-
 +
| pc || unitptr || The player.
 +
|}
  
−
<!--TERM--> '''u'''
+
== Notes ==
−
<!--DEFINITION-->         player your resetting
+
* Nothing happens to NPCs, objects and rooms, or to immortals (level <code>IMMORTAL_LEVEL</code> and up).
 +
* A null unit variable is logged ("reset_vlevel with no unit") and nothing happens.
  
−
This function simply resets a players virtual level.  Can be used in functions
+
== Example ==
−
like reroll where you set the players back to the way he first logged on.
+
<pre>
−
'''Example: '''<i><!--CODE-->reset_vlevel (u);</i><!--ENDCODE-->
+
dilbegin back_to_one(pc : unitptr);
−
'''See Also'''
+
code
−
<i><!--CODE-->
+
{
−
[[#bpresetlevel|reset a players level]] and
+
  if ((pc.type != UNIT_ST_PC) or (pc.level >= IMMORTAL_LEVEL))
−
[[#bpresetrace|reset a players race information]]</i><!--ENDCODE-->
+
      return;
 +
  reset_level(pc);
 +
  reset_vlevel(pc);
 +
  reset_race(pc);
 +
  sendtext("You are back at level 1.<br/>", pc);
 +
}
 +
dilend
 +
</pre>
 +
Puts a mortal player back to level 1, and resets the virtual level and the race's values (<code>reset_race()</code>) too.
 +
 
 +
== See also ==
 +
* [[Manual:DIL Manual/reset level()|reset_level()]]
 +
* [[Manual:DIL Manual/reset race()|reset_race()]]
 +
* [[Manual:DIL Manual/level|level]]
 +
* [[Manual:DIL Manual/vlevel|vlevel]]

Latest revision as of 23:17, 14 November 2026

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_LEVEL and 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.

See also