<?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%2Fnpcflags</id>
	<title>Manual:DIL Manual/npcflags - 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%2Fnpcflags"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/npcflags&amp;action=history"/>
	<updated>2026-11-23T22:15:23Z</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/npcflags&amp;diff=2921&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/npcflags&amp;diff=2921&amp;oldid=prev"/>
		<updated>2026-11-14T23:12:53Z</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;= npcflags =&lt;br /&gt;
'''Field''' (integer, read/write; units: NPC).&lt;br /&gt;
&lt;br /&gt;
 npc.npcflags : integer&lt;br /&gt;
&lt;br /&gt;
An NPC's NPC flags, a bit field set in the zone file with &amp;lt;code&amp;gt;npcflags {...}&amp;lt;/code&amp;gt; in the mobile. The only constant in vme.h is &amp;lt;code&amp;gt;NPC_NICE_THIEF&amp;lt;/code&amp;gt; (an NPC that should treat thieves non-violently); &amp;lt;code&amp;gt;wstat&amp;lt;/code&amp;gt; also names bits for sentinel, scavenger, aggressive and stay-zone, without constants.&lt;br /&gt;
&lt;br /&gt;
The server itself does nothing with these bits besides showing them in &amp;lt;code&amp;gt;wstat&amp;lt;/code&amp;gt; and saving them, and nothing in the zones tests them. Test and change them with [[Manual:DIL Manual/isset()|isset()]], [[Manual:DIL Manual/set()|set()]] and [[Manual:DIL Manual/unset()|unset()]] if your own programs use them.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* NPCs only. On a player, an object, a room or null the field fails.&lt;br /&gt;
* Stored as an 8-bit unsigned number: only the lowest 8 bits are kept.&lt;br /&gt;
* Not to be confused with [[Manual:DIL Manual/charflags|charflags]] (every character) or [[Manual:DIL Manual/flags|flags]] (unit flags).&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin integer nice_to_thieves(npc : unitptr);&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   if (npc.type != UNIT_ST_NPC)&lt;br /&gt;
      return (FALSE);&lt;br /&gt;
   return (isset(npc.npcflags, NPC_NICE_THIEF));&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&lt;br /&gt;
dilbegin make_nice(npc : unitptr);&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   if (npc.type == UNIT_ST_NPC)&lt;br /&gt;
      set(npc.npcflags, NPC_NICE_THIEF);&lt;br /&gt;
   return;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tests and sets the &amp;lt;code&amp;gt;NPC_NICE_THIEF&amp;lt;/code&amp;gt; bit, for a program that decides how an NPC answers a theft.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/charflags|charflags]]&lt;br /&gt;
* [[Manual:DIL Manual/flags|flags]]&lt;br /&gt;
* [[Manual:DIL Manual/defaultpos|defaultpos]]&lt;br /&gt;
* [[Manual:DIL Manual/isset()|isset()]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>