<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=NPC_scripting</id>
	<title>NPC scripting - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=NPC_scripting"/>
	<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=NPC_scripting&amp;action=history"/>
	<updated>2026-09-28T21:24:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://g1r-mp.com/wiki/index.php?title=NPC_scripting&amp;diff=1074&amp;oldid=prev</id>
		<title>QCherry: Release G1R:MP 0.1.5 BUILD144 / Protocol 37; update availability and migration</title>
		<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=NPC_scripting&amp;diff=1074&amp;oldid=prev"/>
		<updated>2026-09-26T07:33:39Z</updated>

		<summary type="html">&lt;p&gt;Release G1R:MP 0.1.5 BUILD144 / Protocol 37; update availability and migration&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 07:33, 26 September 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= NPC scripting =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= NPC scripting =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;Available from update 0.1.5.&#039;&#039;&#039; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Upcoming-release documentation; these additions are not included &lt;/del&gt;in public 0.1.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;4&lt;/del&gt;. See [[Update 0.1.5]] for the complete function/event index.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;Available from update 0.1.5.&#039;&#039;&#039; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Included &lt;/ins&gt;in &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;the &lt;/ins&gt;public 0.1.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;5 release (Protocol 37)&lt;/ins&gt;. See [[Update 0.1.5]] for the complete function/event index.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Ownership, units and defaults ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Ownership, units and defaults ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>QCherry</name></author>
	</entry>
	<entry>
		<id>https://g1r-mp.com/wiki/index.php?title=NPC_scripting&amp;diff=1055&amp;oldid=prev</id>
		<title>QCherry: Document new NPC/player-mode API and events available from 0.1.5</title>
		<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=NPC_scripting&amp;diff=1055&amp;oldid=prev"/>
		<updated>2026-09-25T17:37:25Z</updated>

		<summary type="html">&lt;p&gt;Document new NPC/player-mode API and events available from 0.1.5&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:37, 25 September 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l303&quot;&gt;Line 303:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 303:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:NPC Functions]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:NPC Functions]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Lua Examples]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Lua Examples]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;!-- npc-appearance015:start --&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== NPC appearance since 0.1.5 ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The following are server-side functions for human NPCs created by [[spawnNpc]]. Only the owning resource can change them. They use the existing remote-character appearance pipeline, not a second body mesh or player inventory. Authoritative values are replayed on relevance entry and late join.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[setNpcIdentity]] / [[getNpcIdentity]] choose/read the matched identity profile and head. [[getNpcIdentityNames]] lists the same named identities as the player API. Use &quot;default&quot; to explicitly return to the Nameless Hero identity. Armor and independent color/tattoo overrides are preserved.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[setNpcSkinColor]] / [[getNpcSkinColor]] / [[resetNpcSkinColor]] control independent skin tint. RGB channels are integer sRGB bytes, 0..255. The getter returns {r,g,b}, or false when no override is enabled or the NPC is unavailable.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[setNpcTattoo]] / [[getNpcTattoo]] / [[resetNpcTattoo]] control the tattoo override. [[getNpcTattooNames]] returns the fixed catalog from [[Player tattoo catalog]]. &quot;none&quot; explicitly removes tattoos; reset restores inherited materials. These are different operations.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Existing [[setNpcSkin]] remains a legacy surface preset, not an alias for setNpcIdentity. NPCs that have never called setNpcIdentity keep the old skin behaviour. After an explicit identity is selected, setNpcSkin does not replace that identity. [[getNpcData]] adds identity and identityExplicit to distinguish these states. getNpcIdentity returns &quot;default&quot; before the first explicit identity selection; this does not describe any legacy skin fallback.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[setNpcArmor]] changes the independent garment; [[setNpcWeapon]] changes the equipped weapon. Neither new cosmetic setters nor their resets change authoritative HP, equipment, patrol or combat configuration. Appearance rebuilding is asynchronous: true confirms acceptance, not that the render has already finished. Tattoos are visible only on exposed body regions supported by the chosen preset; no new geometry, outfit replacement or arbitrary textures are loaded from scripts.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight lang=&quot;lua&quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;local npc = spawnNpc(&quot;Guide&quot;, &quot;default&quot;, x, y, z, 0)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;if npc then&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    setNpcIdentity(npc, &quot;milten&quot;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    setNpcArmor(npc, &quot;water_robe&quot;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    setNpcSkinColor(npc, 90, 60, 40)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    setNpcTattoo(npc, &quot;templar1&quot;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    -- Later, independently:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    setNpcIdentity(npc, &quot;default&quot;) -- keeps armor, tint and tattoo&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    resetNpcSkinColor(npc)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    resetNpcTattoo(npc)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;State lasts for this NPC&#039;s lifetime. For persistence across a server restart, store the keys/RGB in your resource database and reapply after spawning a new NPC. No client event is automatically trusted or exposed by these APIs.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;!-- npc-appearance015:end --&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>QCherry</name></author>
	</entry>
	<entry>
		<id>https://g1r-mp.com/wiki/index.php?title=NPC_scripting&amp;diff=1010&amp;oldid=prev</id>
		<title>QCherry: Document new NPC/player-mode API and events available from 0.1.5</title>
		<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=NPC_scripting&amp;diff=1010&amp;oldid=prev"/>
		<updated>2026-09-25T17:14:29Z</updated>

		<summary type="html">&lt;p&gt;Document new NPC/player-mode API and events available from 0.1.5&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= NPC scripting =&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Available from update 0.1.5.&amp;#039;&amp;#039;&amp;#039; Upcoming-release documentation; these additions are not included in public 0.1.4. See [[Update 0.1.5]] for the complete function/event index.&lt;br /&gt;
&lt;br /&gt;
== Ownership, units and defaults ==&lt;br /&gt;
These are &amp;#039;&amp;#039;&amp;#039;server-side&amp;#039;&amp;#039;&amp;#039; resource APIs. Use [[spawnNpc]] to create a human NPC. Mutations require its owning resource; never authorize an incoming client event merely because it contains a valid NPC ID. Validate [[getEventClient]], permissions and gameplay conditions in any remote handler. NPC IDs and player IDs are not interchangeable. Invalid typed values/settings normally return false; wrong Lua argument types can raise binding errors and should be avoided.&lt;br /&gt;
&lt;br /&gt;
Positions/ranges use &amp;#039;&amp;#039;&amp;#039;metres&amp;#039;&amp;#039;&amp;#039;, speeds metres per second, yaw/FOV degrees, animation blending seconds, projectile timing milliseconds. IDs remain opaque identifiers.&lt;br /&gt;
&lt;br /&gt;
Defaults: health/maxHealth=100, invulnerable=true, weapon mode=none, combatTarget=0, melee damage=10; mana=0/maxMana=100, arrows=0, bolts=0. Merely spawning, equipping or setting HP does not start combat. No automatic retaliation, faction hostility or resurrection is installed.&lt;br /&gt;
&lt;br /&gt;
== Equipment and animation ==&lt;br /&gt;
* [[setNpcWeapon]] selects an item; [[setNpcWeaponMode]] draws it. Modes: none, fist, melee, bow, crossbow, magic. [[getNpcWeaponMode]] reads the mode. Changing to a different item holsters; repeating the same item does not.&lt;br /&gt;
* [[startNpcAnim]] uses [[Player animation catalog]] aliases (not raw asset paths); [[stopNpcAnim]] stops them. Weapons must be holstered. Drawing cancels scripted animation. Animations suspend routes/goals/waits rather than discarding them; one-shots finish automatically, loops need a stop.&lt;br /&gt;
* [[setNpcRotation]] sets yaw once. [[setNpcLookAt]] turns the whole NPC toward the player&amp;#039;s current position once. Neither implements head-only tracking; movement may later update yaw.&lt;br /&gt;
* [[getPlayerWeaponMode]] is a separate player observation API: none/fist/melee/bow/crossbow/magic or false if unavailable. [[onPlayerWeaponModeChange]] reports changes after the initial baseline, not inventory slot changes.&lt;br /&gt;
&lt;br /&gt;
== Health and optional melee combat ==&lt;br /&gt;
Use [[setNpcMaxHealth]], [[setNpcHealth]], [[getNpcHealth]], [[getNpcMaxHealth]] and [[setNpcInvulnerable]]. Increasing maximum HP does not heal. HP=0 causes death; positive HP revives without restoring old combat targeting. Invulnerability blocks damage but not authorized script setters.&lt;br /&gt;
&lt;br /&gt;
[[setNpcAttackDamage]] sets base &amp;#039;&amp;#039;&amp;#039;melee-only&amp;#039;&amp;#039;&amp;#039; damage. Zero is explicitly non-damaging. [[setNpcCombatTarget]] selects a live player for continuous combat; pass false to stop. Draw a supported mode first. No automatic aggression is enabled. [[npcAttack]] is for one ranged/magic attempt, not melee.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Run in the resource owning the NPC; playerId/x/y/z must be validated.&lt;br /&gt;
local npc = spawnNpc(&amp;quot;Guard&amp;quot;, &amp;quot;milten&amp;quot;, x, y, z, 0)&lt;br /&gt;
if npc then&lt;br /&gt;
    setNpcMaxHealth(npc, 250)&lt;br /&gt;
    setNpcHealth(npc, 250)&lt;br /&gt;
    setNpcInvulnerable(npc, false)&lt;br /&gt;
    setNpcWeapon(npc, &amp;quot;1h_sword_short_02&amp;quot;)&lt;br /&gt;
    setNpcWeaponMode(npc, &amp;quot;melee&amp;quot;)&lt;br /&gt;
    setNpcAttackDamage(npc, 10)&lt;br /&gt;
    setNpcCombatMovement(npc, {mode=&amp;quot;run&amp;quot;, chase=true})&lt;br /&gt;
    setNpcCombatTarget(npc, playerId)&lt;br /&gt;
end&lt;br /&gt;
-- Later: setNpcCombatTarget(npc, false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Combat temporarily suspends script routes/goals; they can resume after stopping. Target loss, death, pause, weapon changes and damage reactions cancel pending preparation. Already released projectiles can still hit. NPC armor protection follows the verified server garment catalog; unknown bonuses are not guessed. Incoming player hits are validated server-side. [[onNpcDamage]], [[onNpcDeath]] and [[onNpcAttack]] report committed results; do not apply the same damage again in handlers.&lt;br /&gt;
&lt;br /&gt;
== Combat movement ==&lt;br /&gt;
[[setNpcCombatMovement]] accepts a partial table; unknown fields/types or an invalid combination reject the entire change. [[getNpcCombatMovement]] returns {chase, mode, speed}.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field !! Values !! Default&lt;br /&gt;
|-&lt;br /&gt;
| chase || boolean; false holds position while permitting in-range attacks || true&lt;br /&gt;
|-&lt;br /&gt;
| mode || walk or run || walk&lt;br /&gt;
|-&lt;br /&gt;
| speed || walk: 0.1..2.5 m/s; run: 2.6..8 m/s || 1.8&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Specifying mode without speed chooses walk=1.8 or run=4.5. Changing chase alone preserves mode/speed. This configuration does not start combat, replace a route speed or replay equipment/aim preparation. Use [[setNpcPaused]] for a full pause.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setNpcCombatMovement(npc, {mode=&amp;quot;run&amp;quot;, speed=4.5, chase=true})&lt;br /&gt;
setNpcCombatMovement(npc, {chase=false}) -- hold, but may attack in range&lt;br /&gt;
setNpcCombatMovement(npc, {chase=true})  -- resume pursuit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pursuit still follows server navigation and dynamic capsule checks. Combat targeting is abandoned beyond 50 metres horizontally or 5 metres vertically; this is distinct from projectile attack range and the configurable perception query. A blocked route is not bypassed with a teleport.&lt;br /&gt;
&lt;br /&gt;
== Spells and projectiles ==&lt;br /&gt;
Supported spell keys: fire_bolt, fire_ball, fire_ball_milten, ice_bolt, ice_block, ball_lightning, fist_of_wind. Fire Ball, Milten Fire Ball and Ball Lightning support levels 1..3; the others accept level 1. Catalog-only spells such as sleep/heal are not supported by this NPC combat API.&lt;br /&gt;
&lt;br /&gt;
[[setNpcSpell]] selects the spell/level; none clears it. It stops targeting and holsters magic. Draw with setNpcWeaponMode(npc,&amp;quot;magic&amp;quot;). [[getNpcSpell]] returns the key, not the level. Use [[setNpcMana]], [[setNpcMaxMana]], [[getNpcMana]], [[getNpcMaxMana]], [[setNpcAmmo]] and [[getNpcAmmo]] for finite resources. Initial mana and ammo must be supplied explicitly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Existing NPC owned by this resource; attacks cause real gameplay damage.&lt;br /&gt;
setNpcSpell(npc, &amp;quot;fire_ball&amp;quot;, 1)&lt;br /&gt;
setNpcMaxMana(npc, 200)&lt;br /&gt;
setNpcMana(npc, 200)&lt;br /&gt;
setNpcWeaponMode(npc, &amp;quot;magic&amp;quot;)&lt;br /&gt;
setNpcCombatConfig(npc, {range=3, consumeMana=true})&lt;br /&gt;
setNpcCombatMovement(npc, {mode=&amp;quot;run&amp;quot;, chase=true})&lt;br /&gt;
setNpcCombatTarget(npc, playerId)&lt;br /&gt;
-- Runs into range, stops to cast; when target leaves range, pursues again.&lt;br /&gt;
-- For one attempt instead of continuous combat: npcAttack(npc, playerId)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setNpcCombatTarget(npc, false)&lt;br /&gt;
setNpcWeapon(npc, &amp;quot;bow_small_01&amp;quot;)&lt;br /&gt;
setNpcAmmo(npc, &amp;quot;arrows&amp;quot;, 20)&lt;br /&gt;
setNpcWeaponMode(npc, &amp;quot;bow&amp;quot;)&lt;br /&gt;
npcAttack(npc, playerId)&lt;br /&gt;
-- Crossbow alternative: crossbow_01, bolts, mode crossbow.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[setNpcCombatConfig]] / [[getNpcCombatConfig]]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field !! Allowed values !! Default&lt;br /&gt;
|-&lt;br /&gt;
| range || 1..40 metres; spell range can further constrain it || 15&lt;br /&gt;
|-&lt;br /&gt;
| dexterity || 0..100000 || 10&lt;br /&gt;
|-&lt;br /&gt;
| skillTier || integer 0 untrained / 1 trained / 2 master || 0&lt;br /&gt;
|-&lt;br /&gt;
| aimTimeMs || integer 150..30000 || 600&lt;br /&gt;
|-&lt;br /&gt;
| cooldownMs || integer 360..60000; spell cooldown/recovery still apply || 1000&lt;br /&gt;
|-&lt;br /&gt;
| consumeAmmo, consumeMana || boolean || true&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Changing resource/config settings can cancel preparation; do not reapply them every frame. Disabling consumption preserves resources after release, but sufficient initial resources are still required. Ranged damage uses dexterity/skill; spell damage uses the existing spell catalog, not setNpcAttackDamage. Server [ranged] enabled and [magic] enabled switches are respected.&lt;br /&gt;
&lt;br /&gt;
== Visibility and collision ==&lt;br /&gt;
[[isNpcSeeingPlayer]] tests distance, horizontal cone and custom server sight blockers. Defaults: 15 metres / 120 degrees. [[setNpcLookAt]] is independent: it only faces once.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This is not complete native-world physics.&amp;#039;&amp;#039;&amp;#039; Server-authoritative NPC projectiles consider actor capsules and enabled custom navigation prisms with blocksSight=true. They stop on the first blocker; area/cone spell effects check per-target occlusion. Terrain/buildings/doors/native meshes without matching server blocker geometry are not automatically covered. A map-editor object&amp;#039;s collision=true does not create a server sight blocker.&lt;br /&gt;
&lt;br /&gt;
Create a prism using [[createAiNavigationBlocker]] (default blocksSight=true). Use [[setAiNavigationBlockerBlocksSight]] to make it navigation-only; use [[setAiNavigationBlockerEnabled]], [[updateAiNavigationBlocker]] and [[destroyAiNavigationBlocker]] for lifecycle changes. Disabling/destroying is respected without reloading. For a scripted moving door, synchronize its matching blocker rather than treating it as permanently closed. Ownership/normal navigation limits still apply.&lt;br /&gt;
&lt;br /&gt;
== Combat status ==&lt;br /&gt;
[[getNpcCombatState]] returns {phase, rejectReason, target, mode, mana, maxMana, arrows, bolts}. phase is a controller string: idle, blocked-or-out-of-range, casting, prepare, draw-or-loaded, aim, recovery or rejected. It is not a complete melee animation state machine. rejectReason is a numeric code for the current ranged/magic subsystem.&lt;br /&gt;
&lt;br /&gt;
[[onNpcProjectileState]] sends numeric phase/result/rejectReason and a domain string (ranged or magic). The tables below list the exact protocol enum mapping; they are not new Lua global constants.&lt;br /&gt;
&lt;br /&gt;
=== SpellCastPhase ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Equip&lt;br /&gt;
|-&lt;br /&gt;
| 2 || CastStart&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Charging&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Channeling&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Release&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Recovery&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Cancel&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SpellCastResult ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Pending&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Accepted&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Rejected&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Completed&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Cancelled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SpellRejectReason ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ServerDisabled&lt;br /&gt;
|-&lt;br /&gt;
| 2 || CatalogMismatch&lt;br /&gt;
|-&lt;br /&gt;
| 3 || InvalidSpell&lt;br /&gt;
|-&lt;br /&gt;
| 4 || NotImplemented&lt;br /&gt;
|-&lt;br /&gt;
| 5 || NotGranted&lt;br /&gt;
|-&lt;br /&gt;
| 6 || CircleTooLow&lt;br /&gt;
|-&lt;br /&gt;
| 7 || NotEnoughMana&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Cooldown&lt;br /&gt;
|-&lt;br /&gt;
| 9 || InvalidPhase&lt;br /&gt;
|-&lt;br /&gt;
| 10 || DuplicateCast&lt;br /&gt;
|-&lt;br /&gt;
| 11 || RateLimited&lt;br /&gt;
|-&lt;br /&gt;
| 12 || InvalidOrigin&lt;br /&gt;
|-&lt;br /&gt;
| 13 || InvalidAim&lt;br /&gt;
|-&lt;br /&gt;
| 14 || InvalidTarget&lt;br /&gt;
|-&lt;br /&gt;
| 15 || OutOfRange&lt;br /&gt;
|-&lt;br /&gt;
| 16 || StaleSnapshot&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== RangedPhase ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Equipped&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Relaxed&lt;br /&gt;
|-&lt;br /&gt;
| 3 || AimStart&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Aiming&lt;br /&gt;
|-&lt;br /&gt;
| 5 || NotchStart&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Notched&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DrawStart&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Drawing&lt;br /&gt;
|-&lt;br /&gt;
| 9 || DrawHold&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Release&lt;br /&gt;
|-&lt;br /&gt;
| 11 || QuickRelease&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Recovery&lt;br /&gt;
|-&lt;br /&gt;
| 13 || ReloadStart&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Reloading&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Loaded&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Cancelled&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Unequipped&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== RangedActionResult ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Pending&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Accepted&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Rejected&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Completed&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Cancelled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== RangedRejectReason ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ServerDisabled&lt;br /&gt;
|-&lt;br /&gt;
| 2 || InvalidPlayer&lt;br /&gt;
|-&lt;br /&gt;
| 3 || InvalidSequence&lt;br /&gt;
|-&lt;br /&gt;
| 4 || InvalidWeapon&lt;br /&gt;
|-&lt;br /&gt;
| 5 || WeaponNotEquipped&lt;br /&gt;
|-&lt;br /&gt;
| 6 || WeaponNotInHand&lt;br /&gt;
|-&lt;br /&gt;
| 7 || InvalidPhase&lt;br /&gt;
|-&lt;br /&gt;
| 8 || DuplicateShot&lt;br /&gt;
|-&lt;br /&gt;
| 9 || RateLimited&lt;br /&gt;
|-&lt;br /&gt;
| 10 || InvalidOrigin&lt;br /&gt;
|-&lt;br /&gt;
| 11 || InvalidAim&lt;br /&gt;
|-&lt;br /&gt;
| 12 || InvalidTarget&lt;br /&gt;
|-&lt;br /&gt;
| 13 || OutOfRange&lt;br /&gt;
|-&lt;br /&gt;
| 14 || StaleSnapshot&lt;br /&gt;
|-&lt;br /&gt;
| 15 || NoAmmo&lt;br /&gt;
|-&lt;br /&gt;
| 16 || NotLoaded&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ChargeTooShort&lt;br /&gt;
|-&lt;br /&gt;
| 18 || ReloadIncomplete&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Synchronization and cleanup ==&lt;br /&gt;
Current appearance, equipment/drawn state, life state, ongoing action/cast timing and current projectiles are replayed on relevance entry/late join, without replaying historical damage/releases. Each NPC keeps independent state. Stopping the owner resource/destroying the NPC cleans its state and projectile subsystem; death alone does not necessarily remove projectiles already released.&lt;br /&gt;
&lt;br /&gt;
The update also improves NPC melee hit presentation, bow visibility and return to locomotion after ended attacks. Human crouch/sneak replication and remote attack recovery are automatic presentation changes, not new Lua functions. No local inventory manipulation, head-only gaze or full-world collision expansion is promised by these APIs.&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua API]]&lt;br /&gt;
[[Category:NPC Functions]]&lt;br /&gt;
[[Category:Lua Examples]]&lt;/div&gt;</summary>
		<author><name>QCherry</name></author>
	</entry>
</feed>