<?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_costs</id>
	<title>Manual:DIL Manual/weapon costs - 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_costs"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/weapon_costs&amp;action=history"/>
	<updated>2026-11-23T22:10:02Z</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_costs&amp;diff=2919&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_costs&amp;diff=2919&amp;oldid=prev"/>
		<updated>2026-11-14T23:12:47Z</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 costs =&lt;br /&gt;
'''Field''' (integer, read-only at run time; units: PC).&lt;br /&gt;
&lt;br /&gt;
 pc.weapon_costs[idx : integer] : integer&lt;br /&gt;
&lt;br /&gt;
The player's race modifier for 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), from the &amp;lt;code&amp;gt;race &amp;amp;lt;name&amp;amp;gt; = N&amp;lt;/code&amp;gt; lines in &amp;lt;code&amp;gt;vme/etc/weapons.def&amp;lt;/code&amp;gt;. Despite the name, not a price: a positive modifier makes training the weapon cheaper and lets the skill go higher, a negative one does the opposite (teach.cpp). 0 when weapons.def gives the race nothing for that weapon.&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;
* It depends only on the player's [[Manual:DIL Manual/race|race]].&lt;br /&gt;
* The server reads only modifiers from -3 to +3 from weapons.def and skips other values.&lt;br /&gt;
* vmc accepts an assignment, but the value is computed, so at run time the program logs &amp;quot;DIL SERIOUS: ... Type error in lvalue assignemt&amp;quot; and stops.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin string sword_aptitude(pc : unitptr);&lt;br /&gt;
var&lt;br /&gt;
   i : integer;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   i := pc.weapon_costs[WPN_LONG_SWORD];&lt;br /&gt;
   if (i &amp;gt; 0)&lt;br /&gt;
      return (&amp;quot;Your race takes well to the long sword.&amp;quot;);&lt;br /&gt;
   if (i &amp;lt; 0)&lt;br /&gt;
      return (&amp;quot;Your race is clumsy with the long sword.&amp;quot;);&lt;br /&gt;
   return (&amp;quot;Your race has no gift for the long sword either way.&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tells a player what their race's modifier for the long sword means.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/weapons|weapons]]&lt;br /&gt;
* [[Manual:DIL Manual/weapon levels|weapon_levels]]&lt;br /&gt;
* [[Manual:DIL Manual/race|race]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>