<?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%2Fweapons</id>
	<title>Manual:DIL Manual/weapons - 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%2Fweapons"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/weapons&amp;action=history"/>
	<updated>2026-11-23T20:26:47Z</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/weapons&amp;diff=2917&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/weapons&amp;diff=2917&amp;oldid=prev"/>
		<updated>2026-11-14T23:12:41Z</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;= weapons =&lt;br /&gt;
'''Field''' (integer, read/write; units: characters).&lt;br /&gt;
&lt;br /&gt;
 ch.weapons[idx : integer] : integer&lt;br /&gt;
&lt;br /&gt;
A character's skill, in percent, with a weapon. The index is a &amp;lt;code&amp;gt;WPN_*&amp;lt;/code&amp;gt; constant: the weapon groups (&amp;lt;code&amp;gt;WPN_AXE_HAM&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;WPN_SWORD&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;WPN_CLUB_MACE&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;WPN_POLEARM&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;WPN_UNARMED&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;WPN_SPECIAL&amp;lt;/code&amp;gt;) are in vme.h, the single weapons (&amp;lt;code&amp;gt;WPN_DAGGER&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;WPN_LONG_SWORD&amp;lt;/code&amp;gt;, ...) in values.h.&lt;br /&gt;
&lt;br /&gt;
Players have a skill for every weapon, index 0 to &amp;lt;code&amp;gt;WPN_TREE_MAX&amp;lt;/code&amp;gt; - 1. NPCs have one for each weapon group only, index 0 to &amp;lt;code&amp;gt;WPN_GROUP_MAX&amp;lt;/code&amp;gt; - 1 (0 to 6).&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* An index out of range fails: on an NPC, &amp;lt;code&amp;gt;u.weapons[WPN_DAGGER]&amp;lt;/code&amp;gt; fails, because a dagger is not a group.&lt;br /&gt;
* A player's skills can be assigned only by 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;), such as basis.zon, which sets a new player's first skills. 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. An NPC's skills can be assigned from any zone. Reading works everywhere.&lt;br /&gt;
* On null it fails. On an object or a room it is a type error, logged in vme.log.&lt;br /&gt;
* Stored as a 16-bit signed number.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin integer backstab_chance(pc : unitptr);&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   if (pc.type != UNIT_ST_PC)&lt;br /&gt;
      return (0);&lt;br /&gt;
   return ((pc.abilities[ABIL_DEX] + pc.weapons[WPN_DAGGER]) / 2);&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Combines a player's dexterity with the dagger skill, as thievesguild.zon does.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/weapon levels|weapon_levels]]&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/weapon info()|weapon_info()]]&lt;br /&gt;
* [[Manual:DIL Manual/skills|skills]]&lt;br /&gt;
* [[Manual:DIL Manual/access|access]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>