<?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%2Fspells</id>
	<title>Manual:DIL Manual/spells - 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%2Fspells"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/spells&amp;action=history"/>
	<updated>2026-11-23T20:59:25Z</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/spells&amp;diff=2897&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/spells&amp;diff=2897&amp;oldid=prev"/>
		<updated>2026-11-14T23:11:40Z</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;= spells =&lt;br /&gt;
'''Field''' (integer, read/write; units: all).&lt;br /&gt;
&lt;br /&gt;
 u.spells[i] : integer&lt;br /&gt;
&lt;br /&gt;
A character's skill in spell &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;; for an object or a room, its magic resistance. The spell numbers are the &amp;lt;code&amp;gt;SPL_*&amp;lt;/code&amp;gt; constants: the twelve groups &amp;lt;code&amp;gt;SPL_ALL&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;SPL_EXTERNAL&amp;lt;/code&amp;gt; in vme.h, the spells themselves in values.h.&lt;br /&gt;
&lt;br /&gt;
What it holds depends on the unit:&lt;br /&gt;
* '''Player''': index 0 to &amp;lt;code&amp;gt;SPL_TREE_MAX&amp;lt;/code&amp;gt; - 1 (499), the player's skill in that group or spell.&lt;br /&gt;
* '''NPC''': only the groups, index 0 to &amp;lt;code&amp;gt;SPL_GROUP_MAX&amp;lt;/code&amp;gt; - 1 (11). Any other index fails.&lt;br /&gt;
* '''Object''' and '''room''': one number, the resistance (an object's &amp;lt;code&amp;gt;spell&amp;lt;/code&amp;gt; line in the zone file). The index is ignored. For potions, scrolls, wands and staffs the server takes the spell power from &amp;lt;code&amp;gt;value[0]&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* On a player, only a program whose first template is in a zone with access level 0 (fourth column of &amp;lt;code&amp;gt;vme/etc/zonelist&amp;lt;/code&amp;gt;) can assign it; a function from such a zone called by another zone's program can't. 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. NPCs, objects and rooms can be changed from any zone.&lt;br /&gt;
* A character's value is a signed 16-bit number; an object's or a room's is 0 to 255 (other values wrap).&lt;br /&gt;
* On null, or with an index out of range, it fails.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin integer summon_pow(ch : unitptr);&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   if ((ch.type != UNIT_ST_PC) and (ch.type != UNIT_ST_NPC))&lt;br /&gt;
      return (0);&lt;br /&gt;
   return (ch.abilities[ABIL_BRA] + ch.spells[SPL_SUMMONING]);&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A character's summoning power, Brawn plus the summoning group, as the summoner in mageguild.zon works it out.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/spell levels|spell_levels]]&lt;br /&gt;
* [[Manual:DIL Manual/spell costs|spell_costs]]&lt;br /&gt;
* [[Manual:DIL Manual/spellindex()|spellindex()]]&lt;br /&gt;
* [[Manual:DIL Manual/spellinfo()|spellinfo()]]&lt;br /&gt;
* [[Manual:DIL Manual/skills|skills]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>