Difference between revisions of "Script/Creature"

From SF3
Jump to: navigation, search
(Status)
 
(69 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
==class Creature==
 
==class Creature==
 
Represents a reference to a creature in the game world.
 
Represents a reference to a creature in the game world.
 +
An instance of this class acts like a weak pointer to an existing creature in the game world and provides an interface to interact
 +
with it.
 +
Before interacting with the creature, you should call Exists() in order to check if the creature actually (still) exists.
 +
IMPORTANT: This class must NOT be stored as a class member. If you want to store the creature for later reference, store the id
 +
obtained by GetId instead. You can then later retrieve the creature from the LevelReference class by calling GetCreatureById. 
 +
 +
'''Inherits from:''' [[../Entity|Entity]]
 
=== Class Methods ===
 
=== Class Methods ===
 +
==== Basic Information ====
 
{| border='0' style ='border:solid 1px #eeeedd; color: black; width: 1200px;background-color: #ffffcc;' cellspacing='0' cellpadding='7'
 
{| border='0' style ='border:solid 1px #eeeedd; color: black; width: 1200px;background-color: #ffffcc;' cellspacing='0' cellpadding='7'
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|string]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|string]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''GetDescriptionName''' () const
+
| style='color: black; width: 90%; line-height: 1.0;' | '''GetDescriptionName''' () const
 
|-
 
|-
 
|
 
|
 
| style = 'color: #505050; line-height: 0.5;' |''get creature description name''
 
| style = 'color: #505050; line-height: 0.5;' |''get creature description name''
 
|-
 
|-
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|string]]  
+
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../LogicEnums#ECreatureType|ECreatureType]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''GetCreatureType''' () const
+
| style='color: black; width: 90%; line-height: 1.0;' | '''GetCreatureType''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''get creature type''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Sector|Sector@]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''GetCurrentSector''' ([[../LevelReference|LevelReference@]] ''_Level'') const
 
|-
 
|-
 
|
 
|
| style = 'color: #505050; line-height: 0.5;' |''get creature type name''
+
| style = 'color: #505050; line-height: 0.5;' |''get the sector the creature is currently in, MAY RETURN NULL!''
 +
|-
 +
|}
 +
 
 +
==== Status ====
 +
Functions for checking or manipulating the creature's status.
 +
{| border='0' style ='border:solid 1px #eeeedd; color: black; width: 1200px;background-color: #ffffcc;' cellspacing='0' cellpadding='7'
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|int]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|int]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''GetCurrentHP''' () const
+
| style='color: black; width: 90%; line-height: 1.0;' | '''GetCurrentHP''' () const
 
|-
 
|-
 
|
 
|
Line 23: Line 43:
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|int]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|int]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''GetMaxHP''' () const
+
| style='color: black; width: 90%; line-height: 1.0;' | '''GetMaxHP''' () const
 
|-
 
|-
 
|
 
|
 
| style = 'color: #505050; line-height: 0.5;' |''get maximum creature health''
 
| style = 'color: #505050; line-height: 0.5;' |''get maximum creature health''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''Heal''' (const [[../BasicDataTypes|uint]] ''_uHP'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''heal the creature for _uHP health points''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''IsPlayerControllable''' () const
+
| style='color: black; width: 90%; line-height: 1.0;' | '''Damage''' (const [[../LogicEnums#EDamageType|EDamageType]] ''_DamageType'', const [[../BasicDataTypes|uint]] ''_uAmount'')
 
|-
 
|-
 
|
 
|
| style = 'color: #505050; line-height: 0.5;' |''can the creature be given commands by the player?''
+
| style = 'color: #505050; line-height: 0.5;' |''damage the creature for _uAmount HP of the given damage type, returns true if killed''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''Kill''' ()
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''immediately kill the creature''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''KillAndPreserve''' ([[../LevelReference|LevelReference@]] ''_Level'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''immediately kill the creature and preserve its body (prevent it from vanishing after the usual timer)''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''Revive''' ()
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''revive the creature if it's dead and refill its health''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''ReviveInstant''' ([[../LevelReference|LevelReference@]] ''_Level'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''instantly revive the creature''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''EnableHealthRegen''' (const [[../BasicDataTypes|bool]] ''_bEnableHealthRegen'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''enable health regen''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''SetPlayerControllable''' (const [[../BasicDataTypes|bool]] ''_bControllable'')
+
| style='color: black; width: 90%; line-height: 1.0;' | '''EnableFocusRegen''' (const [[../BasicDataTypes|bool]] ''_bEnableFocusRegen'')
 
|-
 
|-
 
|
 
|
| style = 'color: #505050; line-height: 0.5;' |''set whether the creature can be controlled by the player''
+
| style = 'color: #505050; line-height: 0.5;' |''enable focus regen''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''IsImmovable''' () const
+
| style='color: black; width: 90%; line-height: 1.0;' | '''IsImmovable''' () const
 
|-
 
|-
 
|
 
|
Line 47: Line 103:
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''SetImmovable''' (const [[../BasicDataTypes|bool]] ''_bImmovable'')
+
| style='color: black; width: 90%; line-height: 1.0;' | '''SetImmovable''' (const [[../BasicDataTypes|bool]] ''_bImmovable'')
 
|-
 
|-
 
|
 
|
Line 53: Line 109:
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''Damage''' (const [[../BasicDataTypes|string]]&in ''_sDamageTypeName'', const [[../BasicDataTypes|uint]] ''_uAmount'')
+
| style='color: black; width: 90%; line-height: 1.0;' | '''IsImmortal''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''can the creature die (this does not mean invincibility, the creature can simply never fall below 1 HP)''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''SetImmortal''' (const [[../BasicDataTypes|bool]] ''_bImmortal'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''set whether the creature is immortal (immortality will prevent the creature from falling below 1 HP but will still alow it to take damage)''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''DoesAutoRevive''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''will this creature automatically revive after death (and after any potential help up time has run out)?''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''SetAutoRevive''' (const [[../BasicDataTypes|bool]] ''_bRevive'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''set whether this creature should revive automatically after death (and after any potential help up time has run out)''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''ShouldPreserveBody''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''whether the body of this creature will be prevented from vanishing after its death''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''SetPreserveBody''' (const [[../BasicDataTypes|bool]] ''_bPreserve'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''set whether the body of this creature should be preserved (i.e. never vanish) after its death''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''IsHeroDespawnPrevented''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''if this is true, this hero will not be despawned when entering the level, even if he is not in the player's party''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''PreventHeroDespawn''' (const [[../BasicDataTypes|bool]] ''_bPrevent'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''prevent this hero from being despawned when the player enters the level without him in the party''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''IsHelpUpAllowed''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''are heroes allowed to revive this creature after its HP have reached 0?''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''SetHelpUpAllowed''' (const [[../BasicDataTypes|bool]] ''_bAllow'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''set whether heroes are allowed to revive this creature after its HP have reached 0.''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''HasCondition''' (const [[../BasicDataTypes|uint]] ''_uDescriptionId'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''check if creature has condition with given _uDescriptionId''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''ApplyCondition''' (const [[../BasicDataTypes|uint]] ''_uDescriptionId'', const [[../BasicDataTypes|int]] ''_iDuration'', const [[../BasicDataTypes|uint8]] ''_Faction'' = kMaxFactions, const [[../BasicDataTypes|uint]] ''_uScalingPercentage'' = 100)
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''try to apply condition with given _uDescriptionId to creature for the defined _uDuration in seconds (-1 for infinite) - returns true if applied''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''RemoveCondition''' (const [[../BasicDataTypes|uint]] ''_uDescriptionId'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''try to remove condition with given _uDescriptionId from creature - returns true if removed''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''RemoveAllConditions''' ()
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''remove all current conditions from this creature''
 +
|-
 +
|}
 +
 
 +
==== RPG ====
 +
Functions for manipulating values relevant to the game's RPG mechanics.
 +
{| border='0' style ='border:solid 1px #eeeedd; color: black; width: 1200px;background-color: #ffffcc;' cellspacing='0' cellpadding='7'
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|string]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''GetClass''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''get technical name of this character's class (if they have one)''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../string|string[]@]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''GetAbilityTrees''' ([[../LevelReference|const LevelReference@]] ''_Level'') const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''get list of ability tree names of this character''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Creature|Creature[]@]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''GetSummonedCreatures''' ([[../LevelReference|const LevelReference@]] ''_Level'') const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''get a list of currently alive creatures this creature has summoned''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|int8]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''GetAttribute''' (const [[../LogicEnums#ECreatureAttribute|ECreatureAttribute]] ''_Attribute'') const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''get current attribute value''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''AddAttributePoints''' (const [[../BasicDataTypes|uint8]] ''_uNumPoints'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''give the creature attribute points that the player can spend however they wish (only works for heroes)''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''AddAbilityPoints''' (const [[../BasicDataTypes|uint8]] ''_uNumPoints'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''give the creature ability points that the player can spend however they wish (only works for heroes)''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''ModifyBaseAttribute''' (const [[../BasicDataTypes|ECreatureAttribute]] ''_Attribute'', const [[../BasicDataTypes|int8]] ''_iAmount'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''modify the creature's base attribute value by the given number of points''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|int]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''GetResistance''' (const [[../BasicDataTypes|EDamageType]] ''_DamageType'') const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''get resistance to a given damage type (usually in the range [-100;100])''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''AddSpell''' (const [[../LevelReference|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sSpellName'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''unlock the given spell for this creature''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''RemoveSpell''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sSpellName'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''remove the given spell from this creature''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''PrepareSpell''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sSpellName'', const [[../BasicDataTypes|uint]] ''_uSlot'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''add the given spell to the creature's quick slots''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''AddPerk''' (const [[../LevelReference|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sPerkName'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''add the given perk to this creature''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''RemovePerk''' (const [[../LevelReference|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sPerkName'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''add the given perk to this creature''
 +
|-
 +
|}
 +
 
 +
==== Dialogues ====
 +
Functions concerning dialogues
 +
{| border='0' style ='border:solid 1px #eeeedd; color: black; width: 1200px;background-color: #ffffcc;' cellspacing='0' cellpadding='7'
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''IsInDialogue''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''is the creature currently engaged in a dialogue?''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''CancelDialogue''' ()
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''cancel whatever dialogue the creature is currently participating in''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Creature|Creature[]@]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''GetDialogueParticipants''' ([[../LevelReference|LevelReference@]] ''_Level'') const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''get a list of all creatures participating in this creature's current dialogue''
 +
|-
 +
|}
 +
 
 +
==== Equipment and Loot ====
 +
Functions for manipulating the creature's equipment and loot.
 +
{| border='0' style ='border:solid 1px #eeeedd; color: black; width: 1200px;background-color: #ffffcc;' cellspacing='0' cellpadding='7'
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''AreWeaponsHidden''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''are the creature's weapons currently hidden?''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''HideWeapons''' (const [[../BasicDataTypes|bool]] ''_bHide'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''hide or show the creature's weapons''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''PreventLootDrops''' (const [[../BasicDataTypes|bool]] ''_bPrevent'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''prevent or allow the creature to drop loot upon death''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''GetEquipment''' (const [[../LogicEnums#EItemSlot|EItemSlot]] ''_Slot'', [[../BasicDataTypes|string]]&out ''_sOutItemName'') const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''get the item currently equipped in the given slot of the creature. returns false if there was no item in the given slot.''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''Equip''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../LogicEnums#EItemSlot|EItemSlot]] ''_Slot'', const [[../BasicDataTypes|string]]&in ''_sItemName'', const [[../LogicEnums#ECreatureEquipMode|ECreatureEquipMode]] ''_Mode'', const [[../BasicDataTypes|uint16]] ''_uAmount'' = 1)
 
|-
 
|-
 
|
 
|
| style = 'color: #505050; line-height: 0.5;' |''damage the creature for _uAmount HP of the given damage type, returns true if killed''
+
| style = 'color: #505050; line-height: 0.5;' |''equip the given item in the given slot. returns true if successful.
 +
NOTE: This will NOT trigger an inventory equip event for heroes.''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''Unequip''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../LogicEnums#EItemSlot|EItemSlot]] ''_Slot'', const [[../LogicEnums#ECreatureUnequipMode|ECreatureUnequipMode]] ''_Mode'', const [[../BasicDataTypes|uint16]] ''_uAmount'' = uint16 ( - 1 ))
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''unequip the item currently in the given slot. returns false if there was no item in the given slot.
 +
NOTE: This will NOT trigger an inventory unequip event for heroes.''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''ChangeEquipmentSet''' (const [[../BasicDataTypes|string]]&in ''_sSetName'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''change the equipment of the creature to the given set built in the data editor. use set index -1 to unequip everything.''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''ChangeEquipmentSet''' (const [[../BasicDataTypes|int]] ''_iSetIndex'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''change the equipment of the creature to the given set built in the data editor. use empty set name to unequip everything.''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''IsItemSlotLocked''' (const [[../BasicDataTypes|EItemSlot]] ''_Slot'') const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''check wether the given item slot is currently locked''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''LockItemSlot''' (const [[../BasicDataTypes|EItemSlot]] ''_Slot'', const [[../BasicDataTypes|bool]] ''_bLock'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''lock a specific item slot (can't be equipped/unequipped/consumed/used etc.)''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''UseEquippedItem''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../Entity|Entity]]&in ''_Target'' = Entity ( ))
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''use item currently equipped in the creature's Item slot (only valid for heroes!)''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''DropItem''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sItemName'', const [[../BasicDataTypes|uint]] ''_uAmount'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''drop the given item at the creature's feet''
 +
|-
 +
|}
 +
 
 +
==== Behavior====
 +
Functions for controlling a creature's behavior.
 +
{| border='0' style ='border:solid 1px #eeeedd; color: black; width: 1200px;background-color: #ffffcc;' cellspacing='0' cellpadding='7'
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''AreAttacksAllowed''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''can the creature perform attacks?''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''AllowAttacks''' (const [[../BasicDataTypes|bool]] ''_bAllow'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''set whether the creature can perform attacks''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''IsInDefensiveMode''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''check if creature is in defensive mode''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''SetDefensiveMode''' (const [[../BasicDataTypes|bool]] ''_bActive'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''set creature to defensive mode''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''CanVisitPOIs''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''can the creature visit POIs?''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''IsPOIVisitingBehaviorEnabled''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''is the creature's POI visiting behavior currently enabled?''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''EnablePOIVisitingBehavior''' (const [[../BasicDataTypes|bool]] ''_bEnable'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''enable or disable POI visiting behavior (only works for creatures where CanVisitPOIs is true)''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''SetPOICategories''' (const [[../LevelReference|LevelReference@]] ''_Level'', const [[../string|string[]]]&in ''_CategoryNames'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''set the POI categories to be visited by this creature''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''IsTrader''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''is trading possible for this character?''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''IsTradeEnabled''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''is trading allowed for this character?''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''EnableTrade''' (const [[../BasicDataTypes|bool]] ''_bEnable'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''set whether this character is allowed to trade (only works if the character is already a trader)''
 +
|-
 +
|}
 +
 
 +
==== Commands ====
 +
Functions for controlling the creature's actions.
 +
{| border='0' style ='border:solid 1px #eeeedd; color: black; width: 1200px;background-color: #ffffcc;' cellspacing='0' cellpadding='7'
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''IsPlayerControllable''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''can the creature be given commands by the player?''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''Kill''' ()
+
| style='color: black; width: 90%; line-height: 1.0;' | '''SetPlayerControllable''' (const [[../BasicDataTypes|bool]] ''_bControllable'')
 
|-
 
|-
 
|
 
|
| style = 'color: #505050; line-height: 0.5;' |''immediately kill the creature''
+
| style = 'color: #505050; line-height: 0.5;' |''set whether the creature can be controlled by the player''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''Stop''' ([[../LevelReference|LevelReference@]] ''_Level'')
+
| style='color: black; width: 90%; line-height: 1.0;' | '''Stop''' ([[../LevelReference|LevelReference@]] ''_Level'')
 
|-
 
|-
 
|
 
|
Line 71: Line 477:
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''FollowPath''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sPathName'', const [[../BasicDataTypes|bool]] ''_bForward'', const [[../BasicDataTypes|bool]] ''_bQueued'')
+
| style='color: black; width: 90%; line-height: 1.0;' | '''FollowPath''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sPathName'', const [[../BasicDataTypes|bool]] ''_bForward'', const [[../BasicDataTypes|bool]] ''_bQueued'', const [[../BasicDataTypes|bool]] ''_bWalk'' = false)
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''make the creature walk along the given path (creature will go to the closest point on the given path and follow it from there)''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''FollowPathFromBeginning''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sPathName'', const [[../BasicDataTypes|bool]] ''_bForward'', const [[../BasicDataTypes|bool]] ''_bQueued'', const [[../BasicDataTypes|bool]] ''_bWalk'' = false)
 
|-
 
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''make the creature walk along the given path (creature will go to the beginning of the path and follow it from there)''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''GoTo''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|uint]] ''_uMinDistance'', const [[../BasicDataTypes|uint]] ''_uMaxDistance'', const [[../BasicDataTypes|bool]] ''_bQueued'')
+
| style='color: black; width: 90%; line-height: 1.0;' | '''FollowPathWait''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sPathName'', const [[../BasicDataTypes|bool]] ''_bForward'', const [[../BasicDataTypes|bool]] ''_bFromBeginning'', const [[../BasicDataTypes|uint8]] ''_WaitForHeroesFaction'', const [[../LogicEnums#EFollowPathWaitMode|EFollowPathWaitMode]] ''_WaitMode'', const [[../BasicDataTypes|bool]] ''_bQueued'' = false, const [[../BasicDataTypes|bool]] ''_bWalk'' = false)
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''make the creature walk along the given path, but wait for heroes of the given party to be nearby before continuing to the next waypoint''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''Patrol''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sPathName'', const [[../BasicDataTypes|bool]] ''_bPingPong'', const [[../BasicDataTypes|bool]] ''_bForward'', const [[../BasicDataTypes|bool]] ''_bSmooth'', const [[../BasicDataTypes|bool]] ''_bQueued'' = false, const [[../BasicDataTypes|bool]] ''_bWalk'' = false)
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 1.0;' |''make the creature continuously patrol along the given path. if _bPingPong is true, the group will alternate between walking the path forward and backward. otherwise, it will start over from the beginning after reaching the end.''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''FollowCreature''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../Creature|Creature]]&in ''_Target'', const [[../BasicDataTypes|uint]] ''_uMaxDistance'', const [[../BasicDataTypes|uint]] ''_uMinDistance'', const [[../BasicDataTypes|bool]] ''_bQueued'', const [[../BasicDataTypes|bool]] ''_bWalk'' = false)
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''make the creature follow another creature''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''Attack''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''attack the given target entity''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''AttackPosition''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'', const [[../BasicDataTypes|bool]] ''_bWalk'' = false)
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''attack everything in the general vicinity of the target entity (if _bWalk is true, the creature will walk to the target area and only start running once it spots an enemy)''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''Cast''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sSpellName'', const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''make the creature cast a spell at the given target (_Target may be Entity()/invalid if the spell is self-cast)''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''ForceCast''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sSpellName'', const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''forced version of Cast that skips all CheckCaster calls (spellbook, silence, etc.)''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''GoTo''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|uint]] ''_uMinDistance'', const [[../BasicDataTypes|uint]] ''_uMaxDistance'', const [[../BasicDataTypes|bool]] ''_bQueued'', const [[../BasicDataTypes|bool]] ''_bWalk'' = false)
 
|-
 
|-
 
|
 
|
 
| style = 'color: #505050; line-height: 0.5;' |''make the creature walk to the given target''
 
| style = 'color: #505050; line-height: 0.5;' |''make the creature walk to the given target''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''GoToPosition''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'', const [[../BasicDataTypes|bool]] ''_bWalk'' = false)
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''make the creature go to the CURRENT POSITION of the given target.''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''ForceGoTo''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|uint]] ''_uMinDistance'', const [[../BasicDataTypes|uint]] ''_uMaxDistance'', const [[../BasicDataTypes|bool]] ''_bQueued'', const [[../BasicDataTypes|bool]] ''_bWalk'' = false)
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''forced version of GoTo that cannot be aborted by anything other than the creature's death''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''Teleport''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../Entity|Entity]]&in ''_Target'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''teleport the creature next to the given target''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''StartTimedAction''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../LogicEnums#ECreatureAnimation|ECreatureAnimation]] ''_Animation'', const [[../BasicDataTypes|uint]] ''_uDurationMS'', const [[../Entity|Entity]]&in ''_TargetEntity'' = Entity ( ), const [[../BasicDataTypes|uint]] ''_uTargetDistance'' = 10, const [[../BasicDataTypes|bool]] ''_bCancelOnDamage'' = true, const [[../BasicDataTypes|bool]] ''_bCanCancel'' = true, const [[../BasicDataTypes|bool]] ''_bQueued'' = false)
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''start a timed action with the creature. Note: _uDurationMS is the duration of the action in milliseconds!''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''Interact''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'')
+
| style='color: black; width: 90%; line-height: 1.0;' | '''Interact''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'', const [[../BasicDataTypes|uint8]] ''_uFaction'' = kMaxFactions, const [[../BasicDataTypes|uint8]] ''_uControlIndex'' = 0)
 
|-
 
|-
 
|
 
|
 
| style = 'color: #505050; line-height: 0.5;' |''make the creature interact with the given target''
 
| style = 'color: #505050; line-height: 0.5;' |''make the creature interact with the given target''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''Trade''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../Creature|Creature]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'', const [[../BasicDataTypes|uint8]] ''_uFaction'' = kMaxFactions, const [[../BasicDataTypes|uint8]] ''_uControlIndex'' = 0)
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''make creature start a trade with the given target character''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''Talk''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|string]]&in ''_sContainerName'', const [[../BasicDataTypes|string]]&in ''_sTopicName'', const [[../BasicDataTypes|bool]] ''_bQueued'')
+
| style='color: black; width: 90%; line-height: 1.0;' | '''Talk''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|string]]&in ''_sContainerName'', const [[../BasicDataTypes|string]]&in ''_sTopicName'', const [[../BasicDataTypes|bool]] ''_bQueued'', const [[../BasicDataTypes|uint8]] ''_uFaction'' = kMaxFactions, const [[../BasicDataTypes|uint8]] ''_uControlIndex'' = 0)
 
|-
 
|-
 
|
 
|
Line 93: Line 579:
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''Shoutout''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sContainerName'', const [[../BasicDataTypes|string]]&in ''_sTopicName'', const [[../BasicDataTypes|bool]] ''_bQueued'')
+
| style='color: black; width: 90%; line-height: 1.0;' | '''Shoutout''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sContainerName'', const [[../BasicDataTypes|string]]&in ''_sTopicName'', const [[../BasicDataTypes|bool]] ''_bQueued'', const [[../BasicDataTypes|uint8]] ''_uFaction'' = kMaxFactions, const [[../BasicDataTypes|uint8]] ''_uControlIndex'' = 0)
 
|-
 
|-
 
|
 
|
Line 99: Line 585:
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''DropItem''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sItemName'', const [[../BasicDataTypes|uint]] ''_uAmount'')
+
| style='color: black; width: 90%; line-height: 1.0;' | '''PlayAnimation''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../BasicDataTypes|ECreatureAnimation]] ''_Animation'', const [[../BasicDataTypes|int8]] ''_iVariant'', const [[../BasicDataTypes|uint]] ''_uDurationMS'', const [[../BasicDataTypes|bool]] ''_bLoop'', const [[../BasicDataTypes|bool]] ''_bQueued'', const [[../Entity|Entity]]&in ''_EntityToFace'' = Entity ( ), const [[../BasicDataTypes|bool]] ''_bAllowAutoAttacks'' = false)
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''play the given animation for _uDurationMS milli(!)seconds. If _iVariant is < 0, a random animation variant will be played.''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''PlayCommandFeedback''' ([[../LevelReference|LevelReference@]] ''_Level'', const [[../LogicEnums#ECreatureCommand|ECreatureCommand]] ''_CommandType'')
 
|-
 
|-
 
|
 
|
| style = 'color: #505050; line-height: 0.5;' |''drop the given item at the creature's feet''
+
| style = 'color: #505050; line-height: 0.5;' |''play audio command feedback as if the player issued the given command to the creature''
 +
|-
 +
|}
 +
 
 +
==== Operators ====
 +
{| border='0' style ='border:solid 1px #eeeedd; color: black; width: 1200px;background-color: #ffffcc;' cellspacing='0' cellpadding='7'
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Creature|Creature]]&  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Creature|Creature]]&  
| style='color: black; width: 90%; line-height: 0.8;' | '''operator=''' (const [[../Creature|Creature]]&in)
+
| style='color: black; width: 90%; line-height: 1.0;' | '''operator=''' (const [[../Creature|Creature]]&in)
 
|-
 
|-
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''operator==''' (const [[../Creature|Creature]]&in)
+
| style='color: black; width: 90%; line-height: 1.0;' | '''operator==''' (const [[../Creature|Creature]]&in)
 
|-
 
|-
 +
|-
 +
|}
 +
 +
==== Inherited Functions ====
 +
Functions inherited from [[../Entity|Entity]].
 +
{| border='0' style ='border:solid 1px #eeeedd; color: black; width: 1200px;background-color: #ffffcc;' cellspacing='0' cellpadding='7'
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''operator==''' (const [[../Entity|Entity]]&in)
+
| style='color: black; width: 90%; line-height: 1.0;' | '''operator==''' (const [[../Entity|Entity]]&in)
 
|-
 
|-
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''Exists''' () const
+
| style='color: black; width: 90%; line-height: 1.0;' | '''Exists''' () const
 
|-
 
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''does the entity actually exist? (always check this before doing anything with the entity!)''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|uint]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|uint]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''GetId''' () const
+
| style='color: black; width: 90%; line-height: 1.0;' | '''GetId''' () const
 
|-
 
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''get persistent entity id, use this to save the entity for later reference.''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|uint8]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|uint8]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''GetFaction''' () const
+
| style='color: black; width: 90%; line-height: 1.0;' | '''GetFaction''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''get owner faction''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''SetFaction''' (const [[../BasicDataTypes|uint8]] ''_Faction'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''set owner faction''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../LogicEnums#EEntityType|EEntityType]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''GetEntityType''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''get entity type''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''IsEnabled''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''whether the entity is currently enabled (i.e. is visible in the game world)''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''Enable''' (const [[../BasicDataTypes|bool]] ''_bEnabled'')
 
|-
 
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''enabled or disable the entity''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''IsInteractive''' () const
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''can the entity be interacted with?''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''SetFaction''' (const [[../BasicDataTypes|uint8]] ''_Faction'')
+
| style='color: black; width: 90%; line-height: 1.0;' | '''SetInteractive''' (const [[../BasicDataTypes|bool]] ''_bInteractive'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''set whether the entity can be interacted with''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''IsSelectable''' () const
 
|-
 
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''can the entity (theoretically) be selected by the player?''
 
|-
 
|-
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|string]]  
+
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''GetEntityType''' () const
+
| style='color: black; width: 90%; line-height: 1.0;' | '''SetSelectable''' (const [[../BasicDataTypes|bool]] ''_bSelectable'')
 
|-
 
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''set whether the entity can be selected by the player
 +
(note that depending on the type of entity, there may be additional checks preventing the entity from being selected)''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''IsEnabled''' () const
+
| style='color: black; width: 90%; line-height: 1.0;' | '''IsBusy''' () const
 
|-
 
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''is the entity currently marked as busy?''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''Enable''' (const [[../BasicDataTypes|bool]] ''_bEnabled'')
+
| style='color: black; width: 90%; line-height: 1.0;' | '''SetBusy''' (const [[../BasicDataTypes|bool]] ''_bBusy'')
 
|-
 
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''mark the entity as busy''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''IsInteractive''' () const
+
| style='color: black; width: 90%; line-height: 1.0;' | '''HasInspectionText''' () const
 
|-
 
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''check whether the entity currently has an inspection text''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''SetInteractive''' (const [[../BasicDataTypes|bool]] ''_bInteractive'')
+
| style='color: black; width: 90%; line-height: 1.0;' | '''SetInspectionText''' (const [[../BasicDataTypes|uint]] ''_uTextId'')
 
|-
 
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''make the entity inspectable and set the text to be displayed upon inspection''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''CanBeAttacked''' () const
+
| style='color: black; width: 90%; line-height: 1.0;' | '''CanBeAttacked''' () const
 
|-
 
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''can the entity be attacked?''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''SetAttackable''' (const [[../BasicDataTypes|bool]] ''_bAttackable'')
+
| style='color: black; width: 90%; line-height: 1.0;' | '''SetAttackable''' (const [[../BasicDataTypes|bool]] ''_bAttackable'')
 
|-
 
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''set whether the entity can be attacked''
 
|-
 
|-
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Entity|Entity]]  
 
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Entity|Entity]]  
| style='color: black; width: 90%; line-height: 0.8;' | '''opImplConv''' () const
+
| style='color: black; width: 90%; line-height: 1.0;' | '''opImplConv''' () const
 
|-
 
|-
 
|}
 
|}

Latest revision as of 13:15, 26 January 2018

class Creature

Represents a reference to a creature in the game world. An instance of this class acts like a weak pointer to an existing creature in the game world and provides an interface to interact with it. Before interacting with the creature, you should call Exists() in order to check if the creature actually (still) exists. IMPORTANT: This class must NOT be stored as a class member. If you want to store the creature for later reference, store the id obtained by GetId instead. You can then later retrieve the creature from the LevelReference class by calling GetCreatureById.

Inherits from: Entity

Class Methods

Basic Information

string GetDescriptionName () const
get creature description name
ECreatureType GetCreatureType () const
get creature type
Sector@ GetCurrentSector (LevelReference@ _Level) const
get the sector the creature is currently in, MAY RETURN NULL!

Status

Functions for checking or manipulating the creature's status.

int GetCurrentHP () const
get current creature health
int GetMaxHP () const
get maximum creature health
void Heal (const uint _uHP)
heal the creature for _uHP health points
bool Damage (const EDamageType _DamageType, const uint _uAmount)
damage the creature for _uAmount HP of the given damage type, returns true if killed
void Kill ()
immediately kill the creature
void KillAndPreserve (LevelReference@ _Level)
immediately kill the creature and preserve its body (prevent it from vanishing after the usual timer)
void Revive ()
revive the creature if it's dead and refill its health
void ReviveInstant (LevelReference@ _Level)
instantly revive the creature
void EnableHealthRegen (const bool _bEnableHealthRegen)
enable health regen
void EnableFocusRegen (const bool _bEnableFocusRegen)
enable focus regen
bool IsImmovable () const
can the creature be pushed around by others while idle?
void SetImmovable (const bool _bImmovable)
set whether the creature can be pushed around by others while idle (only valid until the creature gets another command).
bool IsImmortal () const
can the creature die (this does not mean invincibility, the creature can simply never fall below 1 HP)
void SetImmortal (const bool _bImmortal)
set whether the creature is immortal (immortality will prevent the creature from falling below 1 HP but will still alow it to take damage)
bool DoesAutoRevive () const
will this creature automatically revive after death (and after any potential help up time has run out)?
void SetAutoRevive (const bool _bRevive)
set whether this creature should revive automatically after death (and after any potential help up time has run out)
bool ShouldPreserveBody () const
whether the body of this creature will be prevented from vanishing after its death
void SetPreserveBody (const bool _bPreserve)
set whether the body of this creature should be preserved (i.e. never vanish) after its death
bool IsHeroDespawnPrevented () const
if this is true, this hero will not be despawned when entering the level, even if he is not in the player's party
void PreventHeroDespawn (const bool _bPrevent)
prevent this hero from being despawned when the player enters the level without him in the party
bool IsHelpUpAllowed () const
are heroes allowed to revive this creature after its HP have reached 0?
void SetHelpUpAllowed (const bool _bAllow)
set whether heroes are allowed to revive this creature after its HP have reached 0.
bool HasCondition (const uint _uDescriptionId)
check if creature has condition with given _uDescriptionId
bool ApplyCondition (const uint _uDescriptionId, const int _iDuration, const uint8 _Faction = kMaxFactions, const uint _uScalingPercentage = 100)
try to apply condition with given _uDescriptionId to creature for the defined _uDuration in seconds (-1 for infinite) - returns true if applied
bool RemoveCondition (const uint _uDescriptionId)
try to remove condition with given _uDescriptionId from creature - returns true if removed
void RemoveAllConditions ()
remove all current conditions from this creature

RPG

Functions for manipulating values relevant to the game's RPG mechanics.

string GetClass () const
get technical name of this character's class (if they have one)
string[]@ GetAbilityTrees (const LevelReference@ _Level) const
get list of ability tree names of this character
Creature[]@ GetSummonedCreatures (const LevelReference@ _Level) const
get a list of currently alive creatures this creature has summoned
int8 GetAttribute (const ECreatureAttribute _Attribute) const
get current attribute value
void AddAttributePoints (const uint8 _uNumPoints)
give the creature attribute points that the player can spend however they wish (only works for heroes)
void AddAbilityPoints (const uint8 _uNumPoints)
give the creature ability points that the player can spend however they wish (only works for heroes)
void ModifyBaseAttribute (const ECreatureAttribute _Attribute, const int8 _iAmount)
modify the creature's base attribute value by the given number of points
int GetResistance (const EDamageType _DamageType) const
get resistance to a given damage type (usually in the range [-100;100])
void AddSpell (const LevelReference@ _Level, const string&in _sSpellName)
unlock the given spell for this creature
void RemoveSpell (LevelReference@ _Level, const string&in _sSpellName)
remove the given spell from this creature
void PrepareSpell (LevelReference@ _Level, const string&in _sSpellName, const uint _uSlot)
add the given spell to the creature's quick slots
void AddPerk (const LevelReference@ _Level, const string&in _sPerkName)
add the given perk to this creature
void RemovePerk (const LevelReference@ _Level, const string&in _sPerkName)
add the given perk to this creature

Dialogues

Functions concerning dialogues

bool IsInDialogue () const
is the creature currently engaged in a dialogue?
void CancelDialogue ()
cancel whatever dialogue the creature is currently participating in
Creature[]@ GetDialogueParticipants (LevelReference@ _Level) const
get a list of all creatures participating in this creature's current dialogue

Equipment and Loot

Functions for manipulating the creature's equipment and loot.

bool AreWeaponsHidden () const
are the creature's weapons currently hidden?
void HideWeapons (const bool _bHide)
hide or show the creature's weapons
void PreventLootDrops (const bool _bPrevent)
prevent or allow the creature to drop loot upon death
bool GetEquipment (const EItemSlot _Slot, string&out _sOutItemName) const
get the item currently equipped in the given slot of the creature. returns false if there was no item in the given slot.
bool Equip (LevelReference@ _Level, const EItemSlot _Slot, const string&in _sItemName, const ECreatureEquipMode _Mode, const uint16 _uAmount = 1)
equip the given item in the given slot. returns true if successful.

NOTE: This will NOT trigger an inventory equip event for heroes.

bool Unequip (LevelReference@ _Level, const EItemSlot _Slot, const ECreatureUnequipMode _Mode, const uint16 _uAmount = uint16 ( - 1 ))
unequip the item currently in the given slot. returns false if there was no item in the given slot.

NOTE: This will NOT trigger an inventory unequip event for heroes.

void ChangeEquipmentSet (const string&in _sSetName)
change the equipment of the creature to the given set built in the data editor. use set index -1 to unequip everything.
void ChangeEquipmentSet (const int _iSetIndex)
change the equipment of the creature to the given set built in the data editor. use empty set name to unequip everything.
bool IsItemSlotLocked (const EItemSlot _Slot) const
check wether the given item slot is currently locked
void LockItemSlot (const EItemSlot _Slot, const bool _bLock)
lock a specific item slot (can't be equipped/unequipped/consumed/used etc.)
void UseEquippedItem (LevelReference@ _Level, const Entity&in _Target = Entity ( ))
use item currently equipped in the creature's Item slot (only valid for heroes!)
void DropItem (LevelReference@ _Level, const string&in _sItemName, const uint _uAmount)
drop the given item at the creature's feet

Behavior

Functions for controlling a creature's behavior.

bool AreAttacksAllowed () const
can the creature perform attacks?
void AllowAttacks (const bool _bAllow)
set whether the creature can perform attacks
bool IsInDefensiveMode () const
check if creature is in defensive mode
void SetDefensiveMode (const bool _bActive)
set creature to defensive mode
bool CanVisitPOIs () const
can the creature visit POIs?
bool IsPOIVisitingBehaviorEnabled () const
is the creature's POI visiting behavior currently enabled?
void EnablePOIVisitingBehavior (const bool _bEnable)
enable or disable POI visiting behavior (only works for creatures where CanVisitPOIs is true)
void SetPOICategories (const LevelReference@ _Level, const string[]&in _CategoryNames)
set the POI categories to be visited by this creature
bool IsTrader () const
is trading possible for this character?
bool IsTradeEnabled () const
is trading allowed for this character?
void EnableTrade (const bool _bEnable)
set whether this character is allowed to trade (only works if the character is already a trader)

Commands

Functions for controlling the creature's actions.

bool IsPlayerControllable () const
can the creature be given commands by the player?
void SetPlayerControllable (const bool _bControllable)
set whether the creature can be controlled by the player
void Stop (LevelReference@ _Level)
stop the creature dead in its tracks immediately. cancels any pending orders.
void FollowPath (LevelReference@ _Level, const string&in _sPathName, const bool _bForward, const bool _bQueued, const bool _bWalk = false)
make the creature walk along the given path (creature will go to the closest point on the given path and follow it from there)
void FollowPathFromBeginning (LevelReference@ _Level, const string&in _sPathName, const bool _bForward, const bool _bQueued, const bool _bWalk = false)
make the creature walk along the given path (creature will go to the beginning of the path and follow it from there)
void FollowPathWait (LevelReference@ _Level, const string&in _sPathName, const bool _bForward, const bool _bFromBeginning, const uint8 _WaitForHeroesFaction, const EFollowPathWaitMode _WaitMode, const bool _bQueued = false, const bool _bWalk = false)
make the creature walk along the given path, but wait for heroes of the given party to be nearby before continuing to the next waypoint
void Patrol (LevelReference@ _Level, const string&in _sPathName, const bool _bPingPong, const bool _bForward, const bool _bSmooth, const bool _bQueued = false, const bool _bWalk = false)
make the creature continuously patrol along the given path. if _bPingPong is true, the group will alternate between walking the path forward and backward. otherwise, it will start over from the beginning after reaching the end.
void FollowCreature (LevelReference@ _Level, const Creature&in _Target, const uint _uMaxDistance, const uint _uMinDistance, const bool _bQueued, const bool _bWalk = false)
make the creature follow another creature
void Attack (LevelReference@ _Level, const Entity&in _Target, const bool _bQueued)
attack the given target entity
void AttackPosition (LevelReference@ _Level, const Entity&in _Target, const bool _bQueued, const bool _bWalk = false)
attack everything in the general vicinity of the target entity (if _bWalk is true, the creature will walk to the target area and only start running once it spots an enemy)
void Cast (LevelReference@ _Level, const string&in _sSpellName, const Entity&in _Target, const bool _bQueued)
make the creature cast a spell at the given target (_Target may be Entity()/invalid if the spell is self-cast)
void ForceCast (LevelReference@ _Level, const string&in _sSpellName, const Entity&in _Target, const bool _bQueued)
forced version of Cast that skips all CheckCaster calls (spellbook, silence, etc.)
void GoTo (LevelReference@ _Level, const Entity&in _Target, const uint _uMinDistance, const uint _uMaxDistance, const bool _bQueued, const bool _bWalk = false)
make the creature walk to the given target
void GoToPosition (LevelReference@ _Level, const Entity&in _Target, const bool _bQueued, const bool _bWalk = false)
make the creature go to the CURRENT POSITION of the given target.
void ForceGoTo (LevelReference@ _Level, const Entity&in _Target, const uint _uMinDistance, const uint _uMaxDistance, const bool _bQueued, const bool _bWalk = false)
forced version of GoTo that cannot be aborted by anything other than the creature's death
void Teleport (LevelReference@ _Level, const Entity&in _Target)
teleport the creature next to the given target
void StartTimedAction (LevelReference@ _Level, const ECreatureAnimation _Animation, const uint _uDurationMS, const Entity&in _TargetEntity = Entity ( ), const uint _uTargetDistance = 10, const bool _bCancelOnDamage = true, const bool _bCanCancel = true, const bool _bQueued = false)
start a timed action with the creature. Note: _uDurationMS is the duration of the action in milliseconds!
bool Interact (LevelReference@ _Level, const Entity&in _Target, const bool _bQueued, const uint8 _uFaction = kMaxFactions, const uint8 _uControlIndex = 0)
make the creature interact with the given target
void Trade (LevelReference@ _Level, const Creature&in _Target, const bool _bQueued, const uint8 _uFaction = kMaxFactions, const uint8 _uControlIndex = 0)
make creature start a trade with the given target character
bool Talk (LevelReference@ _Level, const Entity&in _Target, const string&in _sContainerName, const string&in _sTopicName, const bool _bQueued, const uint8 _uFaction = kMaxFactions, const uint8 _uControlIndex = 0)
make the creature talk to the given target
bool Shoutout (LevelReference@ _Level, const string&in _sContainerName, const string&in _sTopicName, const bool _bQueued, const uint8 _uFaction = kMaxFactions, const uint8 _uControlIndex = 0)
make the creature talk to itself.
void PlayAnimation (LevelReference@ _Level, const ECreatureAnimation _Animation, const int8 _iVariant, const uint _uDurationMS, const bool _bLoop, const bool _bQueued, const Entity&in _EntityToFace = Entity ( ), const bool _bAllowAutoAttacks = false)
play the given animation for _uDurationMS milli(!)seconds. If _iVariant is < 0, a random animation variant will be played.
void PlayCommandFeedback (LevelReference@ _Level, const ECreatureCommand _CommandType)
play audio command feedback as if the player issued the given command to the creature

Operators

Creature& operator= (const Creature&in)
bool operator== (const Creature&in)

Inherited Functions

Functions inherited from Entity.

bool operator== (const Entity&in)
bool Exists () const
does the entity actually exist? (always check this before doing anything with the entity!)
uint GetId () const
get persistent entity id, use this to save the entity for later reference.
uint8 GetFaction () const
get owner faction
void SetFaction (const uint8 _Faction)
set owner faction
EEntityType GetEntityType () const
get entity type
bool IsEnabled () const
whether the entity is currently enabled (i.e. is visible in the game world)
void Enable (const bool _bEnabled)
enabled or disable the entity
bool IsInteractive () const
can the entity be interacted with?
void SetInteractive (const bool _bInteractive)
set whether the entity can be interacted with
bool IsSelectable () const
can the entity (theoretically) be selected by the player?
void SetSelectable (const bool _bSelectable)
set whether the entity can be selected by the player

(note that depending on the type of entity, there may be additional checks preventing the entity from being selected)

bool IsBusy () const
is the entity currently marked as busy?
void SetBusy (const bool _bBusy)
mark the entity as busy
bool HasInspectionText () const
check whether the entity currently has an inspection text
void SetInspectionText (const uint _uTextId)
make the entity inspectable and set the text to be displayed upon inspection
bool CanBeAttacked () const
can the entity be attacked?
void SetAttackable (const bool _bAttackable)
set whether the entity can be attacked
Entity opImplConv () const

class Creature

Represents a reference to a creature in the game world.

Class Methods

string GetDescriptionName () const
get creature description name
string GetCreatureType () const
get creature type name
int GetCurrentHP () const
get current creature health
int GetMaxHP () const
get maximum creature health
bool IsPlayerControllable () const
can the creature be given commands by the player?
void SetPlayerControllable (const bool _bControllable)
set whether the creature can be controlled by the player
bool IsImmovable () const
can the creature be pushed around by others while idle?
void SetImmovable (const bool _bImmovable)
set whether the creature can be pushed around by others while idle (only valid until the creature gets another command).
bool Damage (const string&in _sDamageTypeName, const uint _uAmount)
damage the creature for _uAmount HP of the given damage type, returns true if killed
void Kill ()
immediately kill the creature
void Stop (LevelReference@ _Level)
stop the creature dead in its tracks immediately. cancels any pending orders.
void FollowPath (LevelReference@ _Level, const string&in _sPathName, const bool _bForward, const bool _bQueued)
void GoTo (LevelReference@ _Level, const Entity&in _Target, const uint _uMinDistance, const uint _uMaxDistance, const bool _bQueued)
make the creature walk to the given target
bool Interact (LevelReference@ _Level, const Entity&in _Target, const bool _bQueued)
make the creature interact with the given target
bool Talk (LevelReference@ _Level, const Entity&in _Target, const string&in _sContainerName, const string&in _sTopicName, const bool _bQueued)
make the creature talk to the given target
bool Shoutout (LevelReference@ _Level, const string&in _sContainerName, const string&in _sTopicName, const bool _bQueued)
make the creature talk to itself.
void DropItem (LevelReference@ _Level, const string&in _sItemName, const uint _uAmount)
drop the given item at the creature's feet
Creature& operator= (const Creature&in)
bool operator== (const Creature&in)
bool operator== (const Entity&in)
bool Exists () const
uint GetId () const
uint8 GetFaction () const
void SetFaction (const uint8 _Faction)
string GetEntityType () const
bool IsEnabled () const
void Enable (const bool _bEnabled)
bool IsInteractive () const
void SetInteractive (const bool _bInteractive)
bool CanBeAttacked () const
void SetAttackable (const bool _bAttackable)
Entity opImplConv () const