<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://te4.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Grazz</id>
		<title>Tales of Maj'Eyal - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://te4.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Grazz"/>
		<link rel="alternate" type="text/html" href="https://te4.org/wiki/Special:Contributions/Grazz"/>
		<updated>2026-04-13T13:12:52Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Talents&amp;diff=6180</id>
		<title>T4 Modules Howto Guide/Talents</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Talents&amp;diff=6180"/>
				<updated>2013-10-21T07:42:56Z</updated>
		
		<summary type="html">&lt;p&gt;Grazz: /* Talent Definitions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Talents: Your special skills=&lt;br /&gt;
&lt;br /&gt;
==Talent Definitions==&lt;br /&gt;
&lt;br /&gt;
By default, Talent definitions are stored in the /data/talents.lua file.  This file can include other files through the use of the Load(file) method.&lt;br /&gt;
&lt;br /&gt;
Talent definitions require talent type definitions first.  These are defined in newTalentType{...} blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Important TalentType Variables&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Display name of this talent type.  REQUIRED.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;type&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Identifier of this talent type.  REQUIRED.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;description&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;String description of this talent type.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;points&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Maximum amount of points in this talent type.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: If you are writing your own module you will need to add code to check how many points are in a talent as the engine's canLearnTalent function ignores the points definition when checking if a talent is learnable. &lt;br /&gt;
&lt;br /&gt;
Talent definitions are defined in newTalent{...} blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Important Talent Variables&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Displayed Talent name. REQUIRED.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;short_name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Talent identifier.  name is used if unset.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;points&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Maximum amount of points that can be put into the talent.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;require&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Requirements table for adding points.  See the requirements definition below.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;mode&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Talent mode.  One of either: &amp;amp;quot;passive&amp;amp;quot; - always on, &amp;amp;quot;sustained&amp;amp;quot; - can be turned on or off and &amp;amp;quot;activated&amp;amp;quot; - can be used.  Default is &amp;amp;quot;activated&amp;amp;quot;.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;info&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;String description of the talent.  REQUIRED.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;type&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Talent group. REQUIRED.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;cooldown&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Amount of turns to wait before a talent can be used again.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;range&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Range of talent.  May be a number or function, but use getTalentRange(t) below as a getter in that case.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Identifiers for the talents are created by uppercasing the short_name (or name if no short_name is defined), replacing spaces with underscores ('_') and appending T_ in the front.  These can then be accessed statically through [ActorTalents.*].&lt;br /&gt;
&lt;br /&gt;
In this way the talent &amp;amp;quot;Wind Walk&amp;amp;quot; can be accessed by [ActorTalents.T_WIND_WALK].&lt;br /&gt;
&lt;br /&gt;
Some talent variables require functions to be defined.  These are of the form function(self, t), where self is the invoking actor and t is the talent being invoked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Important Talent Functions&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Use&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;action&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;amp;quot;activated&amp;amp;quot; mode talents only. Function that gets used when talent is activated.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;activate&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;amp;quot;sustained&amp;amp;quot; mode talents only.  Function that gets used when talent gets turned on.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;deactivate&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;amp;quot;sustained&amp;amp;quot; mode talents only.  Function that gets used when talent gets turned off.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;on_learn&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Function that gets used when talent is learned.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;on_unlearn&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Function that gets used when talent is unlearned.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to add stat, level or other talent requirements, a requirement table is required.  These are the recognised variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Requirement Definition&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Use&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;stat&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Actor must have these stats at these levels.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;level&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Actor must be at least this level.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;talent&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Prerequisite talents.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For instance if a talent requires another talent and stats you can use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;require = { stat = { str = 10, dex = 10 }, talent = { Talents.T_STONE_SKIN }, },&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a talent requires that another talent NOT be taken you can use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;require = { talent = { { Talents.T_STONE_SKIN, false }, }, },&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Talent Targeting==&lt;br /&gt;
&lt;br /&gt;
Many activatable talents require some user targeting input.  This is done through a coroutine.  This is an example of the standard targeting and dealing damage case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;local tg = {type=&amp;amp;quot;bolt&amp;amp;quot;, range=self:getTalentRange(t), talent=t}&lt;br /&gt;
local x, y = self:getTarget(tg)&lt;br /&gt;
if not x or not y then return nil end&lt;br /&gt;
self:project(tg, x, y, DamageType.FIRE, 10, nil)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, tg contains the targeting and damage settings.  Possible variables are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Targeting Settings&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;type&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Targeting type. See below.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;range&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Range limit.  Usually always self:getTalentRange(t).&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;talent&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;The talent being used.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;friendlyfire&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;(?) Defaults to true.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;no_restrict&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Makes no restrictions regarding targeting&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;stop_block&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Denotes that the projection will be blocked by entities that block move (bolts have this true by default)&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;radius&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;amp;quot;ball&amp;amp;quot; and &amp;amp;quot;cone&amp;amp;quot; targeting modes use this.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;cone_angle&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;amp;quot;cone&amp;amp;quot; targeting mode uses this.  Defaults to 55.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;msg&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Message to display during targeting.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The possible targeting modes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;type&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;hit&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Simple single target.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;bolt&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Hits first thing in path.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;beam&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Hits everything in path.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;ball&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Hits everything in a ball around the target.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;cone&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Hits everything in a cone in the direction.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
getTarget(tg) is a method that is overriden by an AI for NPCs, or by the game module class.&lt;br /&gt;
&lt;br /&gt;
Note that the last parameter of the project() method is the particle system to use.&lt;br /&gt;
&lt;br /&gt;
==ActorTalents Class==&lt;br /&gt;
&lt;br /&gt;
By default, Actors inherit from the ActorTalents class, even in the example module.  This class provides an interface for manipulating and accessing talents.  These are some of the valuable methods.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Useful Talent Related ActorTalents class methods&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Use&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;useTalent(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Forces the Actor to use the talent.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;useTalents()&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Shows the use talent dialog.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;knowTalent(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Returns true if the talent is known.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;knowTalentType(tt)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Returns true if the talent group is known.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;learnTalent(t, force, nb)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Has an Actor learn a talent.  force prevents a canLearnTalent(t) test. nb is the amount of points to put into the talent.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;unlearnTalent(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Makes the Actor forget the talent.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;learnTalentType(tt, v)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Has the Actor learns a Talent Type. (v is true or false?)&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;unlearnTalentType(tt)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Has the Actor forget a Talent Type.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;canLearnTalent(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Returns true if the Actor meets the requirements for the talent.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;getTalentLevel(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Gets the amount of points in talent.  0 if unlearned.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;isTalentCoolingDown(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Returns true if the specified talent is in the process of cooldown.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;getTalentRange(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Returns the talent range.  Use this instead of checking the range variable, since this allows the range variable to be either a function or a number.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;cooldownTalents()&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Cools down all talents by 1.  This needs to be in your act() method.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All of the above methods can also be redefined in your own class if their functionality needs to be expanded.  In addition, the following may also be useful to redefine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Method&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Use&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;preUseTalent(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Called before an actor uses a talent.  Not returning true stops the talent from invoking.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;postUseTalent(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Called after an actor uses a talent.  Not returning true stops stops cooldown or sustained state from happening.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;getTalentFullDescription(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Used in Dialogs.  Overload to add more information such as mana use.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>Grazz</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/NPCs&amp;diff=6179</id>
		<title>T4 Modules Howto Guide/NPCs</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/NPCs&amp;diff=6179"/>
				<updated>2013-10-19T16:44:20Z</updated>
		
		<summary type="html">&lt;p&gt;Grazz: warning on setting rarity to 0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1 id=&amp;quot;toc0&amp;quot;&amp;gt;Actors: NPCs and Monsters&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc1&amp;quot;&amp;gt;Important NPC Definitions&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that these are also used in the copy table in a player descriptor. These expand on the properties available to all entities, see [[Entities]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Variable&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Displayed NPC name.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;short_name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;NPC identifier. name is used if unset&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;desc&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Optional description of NPC.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;type&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;NPC Type (No known hardcoded types)&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;subtype&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Better categorization for NPC.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;display&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Character that the NPC is displayed as in text mode.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;faction&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Actor faction.  Defaults to &amp;amp;quot;enemies&amp;amp;quot;.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;ai&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Selects which ai to use for NPC.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;ai_state&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;(?) Depends on AI class.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;rarity&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;How common this NPC is to generate.  Higher is rarer.  If not set will not ever generate. Do not set to 0, this is bad.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;level_range&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Minimum and maximum levels for NPC. Read NPC Level Scaling below.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;autolevel&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Which leveling function to use to level up NPC.  Read NPC Level Scaling below.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;max_life&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Max life at level 1.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;energy.mod&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Scales how much energy is gained per tick.  Defaults to 1.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;sight&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Sight radius.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;exp_mod&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Scales how much exp is needed to reach a new level.  Defaults to 1.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;exp_worth&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Indicator of Actor exp value.  By default, exp for killing an Actor is its level times this value.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;egos&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;See ego section in [[Entities]]&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;egos_chance&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;See ego section in [[Entities]]&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These variables are not set in the definitions file, though they can be.  They can be useful to access in code however.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Important runtime variables&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;energy.value&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Current energy of this actor. Defaults to 0.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;self.energy.used&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Set to true if some energy was used this tick.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;life&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Current life.  Defaults to max_life.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;dead&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;true if entity is dead.  Different from undead.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;level&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Current Actor level.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;exp&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Current experience.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;max_level&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Maximum level for the Actor.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example module implements several other variables in its Actor class and Combat interface.  These are not hardcoded, but can be used as a base or example for implementing your own module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Variable&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;combat_armor&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Removes this amount from damage taken.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;combat.dam&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;This is added to strength to determine the damage done by attacks.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc2&amp;quot;&amp;gt;Actor class important methods&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more information, read the documentation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Method&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Purpose&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;act()&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Code that gets executed every time the entity gets to act.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;canSee(actor)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Test if the actor can see the target actor.  This does not check LOS or such, only the actual ability to see it, such as influenced by stealth, invisibility or telepathy.  Returns true or false and a number from 0 to 100 representing the 'chance' to be seen.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;getTarget()&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Gets the Actor target. Redefined by player and AI.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;setTarget(target)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Sets the actor target.  Redefined by player and AI.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;move(x, y, force)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;text-align: left;&amp;quot;&amp;gt;Do NOT manually set the actor's x and y values.  Use this method instead.  Set force to true to not test for the presence of other entities.  Returns true if a move was attempted and energy should propably be used.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;moveDir(dir)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Moves in a certain direction.  Calls move() internally.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;canMove(x, y, terrain_only)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Checks if the Actor can go there.  if terrain_only is true it only checks terrain and ignores the presence of actors and other entities.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;teleportRandom(x, y, dist, min_dist)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Teleports randomly to x,y.  dist is the radius of the effect, min_dist is a minimum radius of the effect and defaults to 0.  Set dist to 0 for precise teleport.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;useEnergy(amount)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Amount of energy to subtract from the actor in energy based time systems.  Often used in the act() method after taking an action that takes time.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;reactionToward(target)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Uses factions to check for hostility.  -100 is fully hostile, 0 is neutral and 100 is friendly.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;addTemporaryValue(prop, v, noupdate)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Changes a property on the actor, but returns an id so the value change can be reversed with a call to removeTemporaryValue(). If noupdate is true the property is not actually changed.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;removeTemporaryValue(prop, id, noupdate)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Reverses a previous call to addTemporaryValue().  Use its returned id to reverse its change.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;onTemporaryValueChange(prop, sub, v)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Does nothing.  Redefine to perform some action when temporary values are applied or removed.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;attr(prop, v, fix)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Non-temporarily increases or decreases an actor property. Use this for compatibility with temporary values above.  If fix is set the property is set to v, not increased or decreased. Commonly, attr(prop) alone is used to check for the existance of a property instead of modifying it.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;isNear(x, y, radius)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Checks whether the actor is within a certain radius of the passed coordinate.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, defining stats automatically creates a getStat() function.  For example, defining the stat str creates a getStr() function for you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc3&amp;quot;&amp;gt;NPC Egos&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc4&amp;quot;&amp;gt;NPC Level Scaling&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Depending on the zone settings, the spawned creatures can actually level with the player.  This requires a level_range variable to be properly set and a levelup() method in the Actor class.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The level_range variable defines the possible range the creature can be. The entity will always be leveled up to at least its minimum level in the level range.  It will also never be leveled above that range either.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The leveling method should be defined in Actor.lua.  In ToME this method adds to the life, stamina and mana of actors.  Alternatively, you can create several, and use the autolevel variable to pick which to call.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;All creatures are always generated at level 1, then leveled up to reach their required level.  Keep this is mind when creating the NPC descriptor.  Note also that you can create your own levelup() function in the NPC descriptor if a unique levelup method is needed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;See [[Dev-Zones]] for more info&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>Grazz</name></author>	</entry>

	</feed>