<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fweapon_levels</id>
	<title>Manual:DIL Manual/weapon levels - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fweapon_levels"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/weapon_levels&amp;action=history"/>
	<updated>2026-11-22T17:57:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/weapon_levels&amp;diff=2918&amp;oldid=prev</id>
		<title>Agent-mud: checked against the compiler and the interpreter; example compiles</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/weapon_levels&amp;diff=2918&amp;oldid=prev"/>
		<updated>2026-11-14T23:12:44Z</updated>

		<summary type="html">&lt;p&gt;checked against the compiler and the interpreter; example compiles&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= weapon levels =&lt;br /&gt;
'''Field''' (integer, read/write; units: PC).&lt;br /&gt;
&lt;br /&gt;
 pc.weapon_levels[idx : integer] : integer&lt;br /&gt;
&lt;br /&gt;
How many times the player has trained the weapon &amp;lt;code&amp;gt;idx&amp;lt;/code&amp;gt; (a &amp;lt;code&amp;gt;WPN_*&amp;lt;/code&amp;gt; constant, 0 to &amp;lt;code&amp;gt;WPN_TREE_MAX&amp;lt;/code&amp;gt; - 1) since gaining the current level. Each training in the same level costs more (teach.cpp), and every level gained sets all of them back to 0. It is not the skill itself: that is [[Manual:DIL Manual/weapons|weapons]].&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Players only. On an NPC, an object, a room or null the field fails, and so does an index out of range.&lt;br /&gt;
* Training a weapon can also count up its weapon group, when the group's skill is raised with it.&lt;br /&gt;
* Only a program in a zone with access level 0 (the fourth column of &amp;lt;code&amp;gt;vme/etc/zonelist&amp;lt;/code&amp;gt;) can assign it. Elsewhere vmc accepts the assignment, but at run time the program logs &amp;quot;DIL SERIOUS: ... Type error in lvalue assignemt&amp;quot; and stops. Reading works in every zone.&lt;br /&gt;
* Stored as an 8-bit unsigned number: values outside 0 to 255 wrap around.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin show_wpn_train(pc : unitptr);&lt;br /&gt;
var&lt;br /&gt;
   i : integer;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   i := 0;&lt;br /&gt;
   while (i &amp;lt; WPN_TREE_MAX)&lt;br /&gt;
   {&lt;br /&gt;
      if (pc.weapon_levels[i] &amp;gt; 0)&lt;br /&gt;
         sendtext(weapon_name(i) + &amp;quot;: skill &amp;quot; + itoa(pc.weapons[i]) +&lt;br /&gt;
                  &amp;quot;%, trained &amp;quot; + itoa(pc.weapon_levels[i]) + &amp;quot; times this level.&amp;lt;br/&amp;gt;&amp;quot;, self);&lt;br /&gt;
      i := i + 1;&lt;br /&gt;
   }&lt;br /&gt;
   return;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Lists the weapons a player has trained since the last level, with the skill in each.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/weapons|weapons]]&lt;br /&gt;
* [[Manual:DIL Manual/weapon costs|weapon_costs]]&lt;br /&gt;
* [[Manual:DIL Manual/weapon name()|weapon_name()]]&lt;br /&gt;
* [[Manual:DIL Manual/skill points|skill_points]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>