class Npc extends Vob (client-side)
Available since version: 0.3.7.5
This class represents Npc.
Constructor
Npc(userpointer ptr)
Parameters:
userpointerptr: the pointer to the object from the game.
Properties
int idx
Available since version: 0.3.8.0
Represents the current NPC parser idx that is being used by the routine.
string slot
Available since version: 0.3.8.0
Represents the current NPC slot (unused by the game).
string effect (read-only)
Available since version: 0.3.8.0
Represents the current NPC visual effect from Daedalus that is being applied to it's body, example: DRAGON_UNDEAD
int npcType
Available since version: 0.3.8.0
Represents the current NPC type used by the game AI.
int variousFlags
Available since version: 0.3.8.0
Represents the current NPC flags. For more information see NpcFlags.
int damagetype
Available since version: 0.3.8.0
Represents the current NPC damage type.
int guild
Available since version: 0.3.8.0
Represents the current NPC guild.
int level
Available since version: 0.3.8.0
Represents the current NPC level.
int fighttactic
Available since version: 0.3.8.0
Represents the current NPC fight tactic used by the game AI.
int fmode
Available since version: 0.3.8.0
Represents the current NPC fight mode.
int voice
Available since version: 0.3.8.0
Represents the current NPC voice.
int voicePitch
Available since version: 0.3.8.0
Represents the current NPC voice pitch.
int mass
Available since version: 0.3.8.0
Represents the current NPC mass.
int daily_routine
Available since version: 0.3.8.0
Represents the current NPC daily routine daedalus function parser index used by game AI.
int startAIState
Available since version: 0.3.8.0
Represents the current NPC start state used by game AI.
string spawnPoint
Available since version: 0.3.8.0
Represents the current NPC spawn point.
int spawnDelay
Available since version: 0.3.8.0
Represents the current NPC spawn delay.
int senses
Available since version: 0.3.8.0
Represents the current NPC senses used by game AI.
int sensesRange
Available since version: 0.3.8.0
Represents the current NPC senses range used by game AI.
string wpname (read-only)
Available since version: 0.3.8.0
Represents the current NPC waypoint name.
int exp
Available since version: 0.3.8.0
Represents the current NPC experience points.
int expNextLevel
Available since version: 0.3.8.0
Represents the current NPC experience points required for next level.
int learnPoints
Available since version: 0.3.8.0
Represents the current NPC learn points.
int bodyStateInterruptableOverride
Available since version: 0.3.8.0
Represents the current NPC body state interruptable override.
bool noFocus
Available since version: 0.3.8.0
Note
Setting this to true will hide name & health bar when focusing.
Represents the current NPC no focus feature.
int parserEnd
Available since version: 0.3.8.0
Represents the daedalus parser end field (unused by the game).
zlist& timedOverlays (read-only)
Available since version: 0.3.8.0
Represents the list containing all mds overlays applied for given duration.
zarray& talents (read-only)
Available since version: 0.3.8.0
Note
This zarray might contain null entries, if specific talent isn't learned for the npc!
Represents the array containing all npc learned talents.
int spellMana
Available since version: 0.3.8.0
Note
The value of this field is being set via daedalus function AI_ReadySpell.
Represents the initial spell mana for the npc set while spell ready.
Npc& tradeNpc (read-only)
Available since version: 0.3.8.0
Represents the trader npc.
float rangeToPlayer
Available since version: 0.3.8.0
Represents the cutscene range to player (unused by the game).
zarray& listOfVoiceHandles (read-only)
Available since version: 0.3.8.0
Represents the array containing currently played sound ids for the npc.
int voiceIndex (read-only)
Available since version: 0.3.8.0
Represents the currently used voice index by the npc.
zarray& effectList (read-only)
Available since version: 0.3.8.0
Represents the array containing actively processed visual effects on the npc.
bool showAIDebug
Available since version: 0.3.8.0
Represents true if the zspy debug ai messages for AI actions should be displayed, otherwise false.
bool showNews
Available since version: 0.3.8.0
Represents true if the debug AI news messages should be displayed on the screen, otherwise false.
bool csAllowedAsRole
Available since version: 0.3.8.0
Represents true if cutscene processing is enabled for npc, otherwise false.
bool isSummoned
Available since version: 0.3.8.0
Represents if the NPC was summoned (e.g: by the spell).
bool respawnOn
Available since version: 0.3.8.0
Represents if the NPC can respawn after death by the game spawn manager.
bool movementLocked
Available since version: 0.3.8.0
Represents if the NPC is locked in place e.g: cannot move.
bool drunk
Available since version: 0.3.8.0
Represents if the NPC is in drunk state (unused by the game).
bool mad
Available since version: 0.3.8.0
Represents if the NPC is in mad state (unused by the game).
bool overlayWounded (read-only)
Available since version: 0.3.8.0
Represents if the NPC has wounded overlay applied.
bool inOnDamage
Available since version: 0.3.8.0
Represents if the NPC is receiving damage (unused by the game).
bool autoRemoveWeapon
Available since version: 0.3.8.0
Represents if the NPC should automtically remove the weapon (unused by the game).
bool openInventory
Available since version: 0.3.8.0
Represents if the NPC should open it's inventory (unused by the game).
bool askRoutine
Available since version: 0.3.8.0
Represents if the NPC is in ask routine (unused by the game).
bool spawnInRange
Available since version: 0.3.8.0
Represents if the NPC should be spawned when player is getting closer to it by the game spawn manager.
int bodyTexColorNr
Available since version: 0.3.8.0
Note
value can only set in range of [0, 65535]
Represents the NPC body texture variation id.
int bodyTexColorNr
Available since version: 0.3.8.0
Note
value can only set in range of [0, 65535]
Represents the NPC body texture color variation id.
int headTexVarNr
Available since version: 0.3.8.0
Note
value can only set in range of [0, 65535]
Represents the NPC head texture variation id.
int teethTexVarNr
Available since version: 0.3.8.0
Note
value can only set in range of [0, 65535]
Represents the NPC teeth texture variation id.
int guildTrue
Available since version: 0.3.8.0
Note
value can only set in range of [0, 255]
Represents the true guild that NPC belongs to.
int drunkTime
Available since version: 0.3.8.0
Note
value can only set in range of [0, 255]
Represents the time in miliseconds how long the NPC will be in drunk state (cut feature from the game, unused).
int madTime
Available since version: 0.3.8.0
Represents the time in miliseconds how long the NPC will be in mad state (cut feature from the game, unused).
int spells
Available since version: 0.3.8.0
Note
value can only set in range of [0, 255]
Represents the number of spells npc has learned (cut feature from the game, unused).
int bodyState
Available since version: 0.3.8.0
Represents currently used bodystate flags by the NPC.
bool aniMessageRunning (read-only)
Available since version: 0.3.8.0
Represents if the NPC plays animation by game event system.
int instance
Available since version: 0.3.8.0
Represents the currently daedalus instance by the NPC (e.g: PC_HERO).
string mdsName
Available since version: 0.3.8.0
Represents the currently used model script by the NPC (e.g: Humans.mds).
string bodyModel
Available since version: 0.3.8.0
Represents the currently used body model by the NPC (e.g: Hum_Body_Naked0.asc).
string headModel
Available since version: 0.3.8.0
Represents the currently used head model by the NPC (e.g: Hum_Head_Pony.mms).
Vec3& modelScale
Available since version: 0.3.8.0
Represents the current NPC model scale.
float modelFatness
Available since version: 0.3.8.0
Represents the current NPC model fatness.
int namenr
Available since version: 0.3.8.0
Represents a field unused by the game.
float hpHeal
Available since version: 0.3.8.0
Represents a field that tracks the time remaining until the next health point is restored.
float manaHeal
Available since version: 0.3.8.0
Represents a field that tracks the time remaining until the next mana point is restored.
float divetime
Available since version: 0.3.8.0
Represents the maximum duration (in seconds) an NPC can stay underwater before their oxygen supply is depleted.
float swimtime
Available since version: 0.3.8.0
Represents a field that determines if the NPC can swim;
float divectr
Available since version: 0.3.8.0
Represents a countdown timer that tracks remaining oxygen while diving.
Vob fireVob
Available since version: 0.3.8.0
Represents temporary vob attached to the NPC while they are in the "burning" state.
float fireDamage
Available since version: 0.3.8.0
Represents the amount of damage-per-tick applied to the NPC when they are affected by a fire-based effect.
float fireDamageTimer
Available since version: 0.3.8.0
Represents a countdown timer that controls the frequency and duration of recurring damage dealt to the NPC while they are on fire.
int attitude
Available since version: 0.3.8.0
Represents permanent or current baseline attitude towards the player or other guilds.
int tmp_attitude
Available since version: 0.3.8.0
Represents a temporary attitude towards the player or another NPC.
float attTimer
Available since version: 0.3.8.0
Represents a field that determines temporary attitude changes.
int knowsPlayer
Available since version: 0.3.8.0
Represents a field that determines if the NPC has already met or "knows" the player character.
int percActive
Available since version: 0.3.8.0
Represents a field that indicates whether the NPC's active perception system is currently enabled and processing nearby events.
float percActiveTime
Available since version: 0.3.8.0
Represents the total duration for which the NPC's perception system remains active.
float percActiveDelta
Available since version: 0.3.8.0
Represents elapsed time since the last update of the NPC's active perception system.
bool overrideFallDownHeight
Available since version: 0.3.8.0
Represents a boolean flag that, when set to true, allows custom or scripted logic to override the engine's default fall distance and damage calculations.
float fallDownHeight
Available since version: 0.3.8.0
Represents the vertical distance the NPC has fallen, used to calculate damage and determine the landing animation.
int fallDownDamage
Available since version: 0.3.8.0
Represents the amount of damage calculated and applied to the NPC after falling from a height.
zCList& activeSpells
Available since version: 0.3.8.0
Represents list of nearby Vob objects.
int lastHitSpellID
Available since version: 0.3.8.0
Represents unique ID of the last spell that struck the NPC.
int lastHitSpellCat
Available since version: 0.3.8.0
Represents a category of the last spell that struck the NPC.
zCArray& activeOverlays
Available since version: 0.3.8.0
Represents list of nearby Vob objects.
int askNo
Available since version: 0.3.8.0
Unused by the game.
int askYes
Available since version: 0.3.8.0
Unused by the game.
float canTalk
Available since version: 0.3.8.0
Represents A field indicating whether the NPC is currently able to start or continue a dialogue with others.
Npc talkOther (read-only)
Available since version: 0.3.8.0
Represents Npc that this character is currently engaged in a conversation with.
MobInter carry_vob (read-only)
Available since version: 0.3.8.0
Represents Vob object that the NPC is currently carrying or holding in their hands.
MobInter interactMob (read-only)
Available since version: 0.3.8.0
Represents MobInter object that the NPC is currently interacting with.
Item interactItem (read-only)
Available since version: 0.3.8.0
Represents Item object that the NPC is currently using or interacting with.
int interactItemCurrentState
Available since version: 0.3.8.0
Tracks the NPC's current state index during an item or MOB interaction sequence.
int interactItemTargetState
Available since version: 0.3.8.0
Represents final state index an NPC aims to reach when interacting with a MOB or an item.
int script_aiprio
Available since version: 0.3.8.0
Unused by the game.
int old_script_state
Available since version: 0.3.8.0
Represents the previous AI script state ID.
float damageMul
Available since version: 0.3.8.0
Represents a global scaling factor applied to all damage dealt by the NPC.
zCArray& vobList
Available since version: 0.3.8.0
Represents list of nearby Vob objects.
float vobcheck_time
Available since version: 0.3.8.0
Is set to random value upon inicialization, later unused by the game.
float pickvobdelay
Available since version: 0.3.8.0
Throttles focus/object detection frequency for performance.
zCVob& focus_vob
Available since version: 0.3.8.0
Represents currently focused vob.
float fadeAwayTime
Available since version: 0.3.8.0
Represents a countdown timer (in milliseconds) used to calculate the visual transparency (alpha) of an NPC during the fade-out process before being deleted from the world.
float respawnTime
Available since version: 0.3.8.0
Is used to store spawnDelay field value by the game.
int fightRangeBase
Available since version: 0.3.8.0
Represents base fight range.
int fightRangeFist
Available since version: 0.3.8.0
Represents fists fight range.
int fightRangeG
Available since version: 0.3.8.0
Is set by the game upon inicialization, later unused.
float fight_waitTime (read-only)
Available since version: 0.3.8.0
Represents wait time for next action in fight.
float fight_lastStrafeFrame (read-only)
Available since version: 0.3.8.0
Represents last strafe frame.
int soundType
Available since version: 0.3.8.0
Represents the sound type, game sets it to 0 when setting new sound source.
zCVob soundVob
Available since version: 0.3.8.0
Represents the sound vob object.
zVEC3 soundPosition
Available since version: 0.3.8.0
Represents the position of sound source.
static int enabledDialogCamStop
Available since version: 0.3.8.0
Represents dialog cam stop override.
static int targetLocked
Available since version: 0.3.8.0
Represents true if the player is currently locked the focus (by pressing LMB or CTRL), otherwise false.
static Npc& player
Available since version: 0.3.8.0
Represents player object reference.
static int godMode
Available since version: 0.3.8.0
Represents true if god mode is enabled, otherwise false.
static int angleNear
Available since version: 0.3.8.0
Represents angle for auto heading in melee combat.
static int angleFarUp
Available since version: 0.3.8.0
Represents elevation angle for auto heading in range combat.
static int angleFarSide
Available since version: 0.3.8.0
Represents side angle for auto heading in range combat.
static int gameMode
Available since version: 0.3.8.0
Represents the game mode used by the player npc, possible values are: 0 - normal 1 - plunder 2 - steal
static Npc& dontArchiveThisNpc
Available since version: 0.3.8.0
Represents the npc that won't be archived by the game (saved/loaded, mostly used by singleplayer).
static Mat4& playerPositionMatrix
Available since version: 0.3.8.0
Represents player position matrix (unused by the game).
static int aiDisabled
Available since version: 0.3.8.0
Represents true if npc ai is disabled, otherwise false.
Methods
getName
Available since version: 0.3.8.0
Note
NPC name could be written in multiple lines
This function gets NPC name by it's index.
string getName(int index)
Parameters:
intindex: index of line name
Returns string:
NPC name
setName
Available since version: 0.3.8.0
Note
NPC name could be written in multiple lines
This function sets NPC name by it's index.
void setName(int index, string name)
Parameters:
intindex: index of line namestringname: NPC name
getAttribute
Available since version: 0.3.8.0
This function gets NPC attribute by it's index (from 0 to 7).
int getAttribute(int index)
Parameters:
intindex: index of attribute
Returns int:
NPC attribute
setAttribute
Available since version: 0.3.8.0
This function sets NPC attribute by it's index (from 0 to 7).
void setAttribute(int index, int attribute)
Parameters:
intindex: index of attributeintattribute: NPC attribute
getHitChance
Available since version: 0.3.8.0
This function gets NPC hit chance by it's index (from 0 to 4).
int getHitChance(int index)
Parameters:
intindex: index of hit chance
Returns int:
NPC hit chance
setHitChance
Available since version: 0.3.8.0
This function sets NPC hit chance by it's index (from 0 to 4).
void setHitChance(int index, int hitChance)
Parameters:
intindex: index of hit chanceinthitChance: NPC hit chance
getProtection
Available since version: 0.3.8.0
This function gets NPC protection by it's index (from 0 to 7).
int getProtection(int index)
Parameters:
intindex: index of protection
Returns int:
NPC protection
setProtection
Available since version: 0.3.8.0
This function sets NPC protection by it's index (from 0 to 7).
void setProtection(int index, int protection)
Parameters:
intindex: index of protectionintprotection: NPC protection
getDamage
Available since version: 0.3.8.0
This function gets NPC damage by it's index (from 0 to 7).
int getDamage(int index)
Parameters:
intindex: index of damage
Returns int:
NPC damage
setDamage
Available since version: 0.3.8.0
This function sets NPC damage by it's index (from 0 to 7).
void setDamage(int index, int damage)
Parameters:
intindex: index of damageintdamage: NPC damage
getMission
Available since version: 0.3.8.0
This function gets NPC mission by it's index (from 0 to 4).
int getMission(int index)
Parameters:
intindex: index of mission
Returns int:
NPC mission
setMission
Available since version: 0.3.8.0
This function sets NPC mission by it's index (from 0 to 4).
void setMission(int index, int mission)
Parameters:
intindex: index of missionintmission: NPC mission
getAIScriptVars
Available since version: 0.3.8.0
This function gets NPC AI script variables by it's index.
int getAIScriptVars(int index)
Parameters:
intindex: index of AI script variable
Returns int:
NPC AI script variable
setAIScriptVars
Available since version: 0.3.8.0
This function sets NPC mission by it's index.
void setAIScriptVars(int index, int value)
Parameters:
intindex: index of AI script variableintvalue: NPC AI script variable
setVisual
Available since version: 0.3.8.0
Sets the visual of the NPC.
void setVisual(Visual visual)
Parameters:
Visualvisual: the visual to set
shrink
Available since version: 0.3.8.0
Shrinks the NPC and removes its model and AI.
void shrink()
unShrink
Available since version: 0.3.8.0
Restores a previously shrunk NPC.
void unShrink()
avoidShrink
Available since version: 0.3.8.0
Prevents the NPC from shrinking for the specified timeout.
void avoidShrink(int timeout = 1000)
Parameters:
inttimeout: timeout in milliseconds
cleanUp
Available since version: 0.3.8.0
Cleans up the NPC.
void cleanUp()
applyOverlay
Available since version: 0.3.8.0
Applies an animation overlay to the NPC.
bool applyOverlay(string overlay)
Parameters:
stringoverlay: overlay name
Returns bool:
true on success; otherwise, false
removeOverlay
Available since version: 0.3.8.0
Removes an animation overlay from the NPC.
void removeOverlay(string overlay)
Parameters:
stringoverlay: overlay name
initByScript
Available since version: 0.3.8.0
Initializes the NPC from a Daedalus script instance.
void initByScript(int instanceIndex, bool reload = false)
Parameters:
intinstanceIndex: script instance indexboolreload: reload the instance
getInstanceName
Available since version: 0.3.8.0
Gets the NPC instance name.
string getInstanceName()
Returns string:
instance name
getScriptInstance
Available since version: 0.3.8.0
Gets the NPC script instance name and index.
[(string|null getScriptInstance()
Returns [(string|null:
, int]) script instance name and index in a single array
setByScriptInstance
Available since version: 0.3.8.0
Sets the NPC script instance by name.
bool setByScriptInstance(string instanceName)
Parameters:
stringinstanceName: script instance name
Returns bool:
true on success, otherwise false
setByScriptInstance
Available since version: 0.3.8.0
Sets the NPC script instance by index.
bool setByScriptInstance(int instanceIndex)
Parameters:
intinstanceIndex: script instance index
Returns bool:
true on success, otherwise false
getOverlay
Available since version: 0.3.8.0
Gets the current NPC animation overlay name.
string|null getOverlay()
Returns string|null:
overlay name, or an empty string when none is active
setHead
Available since version: 0.3.8.0
Sets the NPC head visual.
void setHead()
setAdditionalVisuals
Available since version: 0.3.8.0
Sets the additional body, head and armor visuals of the NPC.
void setAdditionalVisuals(string bodyVisual, int bodyTexNr, int bodyColor, string headVisual, int headTexNr, int teethTexNr, int armorInstance = -1)
Parameters:
stringbodyVisual: body visual nameintbodyTexNr: body texture variationintbodyColor: body color variationstringheadVisual: head visual nameintheadTexNr: head texture variationintteethTexNr: teeth texture variationintarmorInstance: armor instance
initModel
Available since version: 0.3.8.0
Initializes the NPC model.
void initModel()
checkModelOverlays
Available since version: 0.3.8.0
Checks and applies the NPC model overlays.
void checkModelOverlays()
deleteHumanAI
Available since version: 0.3.8.0
Deletes the NPC human AI.
void deleteHumanAI()
clearEM
Available since version: 0.3.8.0
Clears the NPC event messages.
void clearEM()
startStdFaceAni
Available since version: 0.3.8.0
Starts the standard face animation for the specified attitude.
bool startStdFaceAni(int attitude)
Parameters:
intattitude: NPC attitude
Returns bool:
true on success; otherwise, false
startFaceAni
Available since version: 0.3.8.0
Starts a face animation on the NPC.
bool startFaceAni(string name, float intensity = 1.0, float holdtime = -2.0)
Parameters:
stringname: animation namefloatintensity: animation intensityfloatholdtime: animation hold time
Returns bool:
true on success, otherwise false
stopFaceAni
Available since version: 0.3.8.0
Stops a face animation on the NPC.
bool stopFaceAni(string name)
Parameters:
stringname: animation name
Returns bool:
true on success; otherwise, false
disable
Available since version: 0.3.8.0
Disables the NPC and removes it from the world.
void disable()
enable
Available since version: 0.3.8.0
Enables the NPC and moves it to its current daily-routine position.
void enable(Vec3 position)
Parameters:
Vec3position: enable position
getProtectionByMode
Available since version: 0.3.8.0
This function will get the player protection.
int getProtectionByMode(int damageType)
Parameters:
intdamageType: . For more information see Damage constants.
Returns int:
the protection value for specific damageType.
getWaterLevel
Available since version: 0.3.8.0
This function will get player water level.
int getWaterLevel()
Returns int:
current water level; 0 = outside water, 1 = walking in water, 2 = swimming.
setToMad
Available since version: 0.3.8.0
Sets the NPC to mad state.
void setToMad(float ms)
Parameters:
floatms: time in milliseconds
healFromMad
Available since version: 0.3.8.0
Heals the NPC from mad state.
void healFromMad()
refreshNpc
Available since version: 0.3.8.0
Refreshes the NPC.
void refreshNpc()
readySpell
Available since version: 0.3.8.0
Readies a spell.
bool readySpell(int nSpell, int nMana)
Parameters:
intnSpell: spell idintnMana: mana amount
Returns bool:
true on success; otherwise, false
unreadySpell
Available since version: 0.3.8.0
Unreadies current spell.
bool unreadySpell()
Returns bool:
true on success; otherwise, false
getSpellItem
Available since version: 0.3.8.0
Gets the item associated with a spell.
Item getSpellItem(int nSpell)
Parameters:
intnSpell: spell id
Returns Item:
the spell item, or null
getActiveSpellNr
Available since version: 0.3.8.0
Gets active spell number.
int getActiveSpellNr()
Returns int:
spell number
getActiveSpellCategory
Available since version: 0.3.8.0
Gets active spell category.
int getActiveSpellCategory()
Returns int:
spell category
getActiveSpellLevel
Available since version: 0.3.8.0
Gets active spell level.
int getActiveSpellLevel()
Returns int:
spell level
getActiveSpellIsScroll
Available since version: 0.3.8.0
Checks if active spell is a scroll.
int getActiveSpellIsScroll()
Returns int:
1 if scroll, else 0
setActiveSpellInfo
Available since version: 0.3.8.0
Sets active spell info.
void setActiveSpellInfo(int nr)
Parameters:
intnr: spell number
insertActiveSpell
Available since version: 0.3.8.0
Inserts active spell.
void insertActiveSpell(Spell spell)
Parameters:
Spellspell: the spell to insert
removeActiveSpell
Available since version: 0.3.8.0
Removes active spell.
void removeActiveSpell(Spell spell)
Parameters:
Spellspell: spell object
removeActiveSpell
Available since version: 0.3.8.0
Removes active spell.
void removeActiveSpell(int spellNr)
Parameters:
intspellNr: spell number
doActiveSpells
Available since version: 0.3.8.0
Processes active spells.
bool doActiveSpells()
Returns bool:
true on success; otherwise, false
killActiveSpells
Available since version: 0.3.8.0
Kills active spells.
void killActiveSpells()
isSpellActive
Available since version: 0.3.8.0
Checks if specific spell is active.
Spell isSpellActive(int nr)
Parameters:
intnr: spell number
Returns Spell:
spell object, or null
hasMagic
Available since version: 0.3.8.0
Checks if NPC has magic.
bool hasMagic()
Returns bool:
true if has magic; otherwise, false
getNumberOfSpells
Available since version: 0.3.8.0
Gets the number of spells.
int getNumberOfSpells()
Returns int:
number of spells
openSpellBook
Available since version: 0.3.8.0
Opens the spellbook.
void openSpellBook(bool showMagicCircle = true)
Parameters:
boolshowMagicCircle: optional show magic circle
closeSpellBook
Available since version: 0.3.8.0
Closes the spellbook.
void closeSpellBook(bool removeall)
Parameters:
boolremoveall: remove all flag
makeSpellBook
Available since version: 0.3.8.0
Creates the spellbook.
void makeSpellBook()
destroySpellBook
Available since version: 0.3.8.0
Destroys the spellbook.
void destroySpellBook()
activateDialogCam
Available since version: 0.3.8.0
Activates dialog camera.
bool activateDialogCam(float timems)
Parameters:
floattimems: time in milliseconds
Returns bool:
true on success; otherwise, false
deactivateDialogCam
Available since version: 0.3.8.0
Deactivates dialog camera.
bool deactivateDialogCam()
Returns bool:
true on success; otherwise, false
startFadeAway
Available since version: 0.3.8.0
Starts fade away.
void startFadeAway()
isFadingAway
Available since version: 0.3.8.0
Checks if NPC is fading away.
bool isFadingAway()
Returns bool:
true if fading away; otherwise, false
fadeAway
Available since version: 0.3.8.0
Triggers fade away.
bool fadeAway()
Returns bool:
true on success; otherwise, false
detectItem
Available since version: 0.3.8.0
Detects item around NPC.
Item& detectItem(int flag, bool best = false)
Parameters:
intflag: the flagboolbest: optional search for best item
Returns Item&:
the detected item, or null
findMobInter
Available since version: 0.3.8.0
Finds interact mob by name.
MobInter findMobInter(string name)
Parameters:
stringname: the name
Returns MobInter:
the mob, or null if not found
isInFightMode_S
Available since version: 0.3.8.0
Checks if in specific fight mode.
bool isInFightMode_S(int id)
Parameters:
intid: fight mode id
Returns bool:
true if in fight mode; otherwise, false
isAiming_S
Available since version: 0.3.8.0
Checks if aiming at specific target.
bool isAiming_S(Npc target)
Parameters:
Npctarget: the target
Returns bool:
true if aiming; otherwise, false
setCarryVob
Available since version: 0.3.8.0
Sets the carry vob.
void setCarryVob(Vob v)
Parameters:
Vobv: the vob
setInteractMob
Available since version: 0.3.8.0
Sets the interact mob.
void setInteractMob(MobInter mob)
Parameters:
MobIntermob: the mob
setInteractItem
Available since version: 0.3.8.0
Sets the interacted item.
void setInteractItem(Item item)
Parameters:
Itemitem: the item
getInteractItemMaxState
Available since version: 0.3.8.0
Gets the maximum state for the interacted item sceme.
int getInteractItemMaxState(string sceme)
Parameters:
stringsceme: the item sceme
Returns int:
the maximum state
interactItemIsInState
Available since version: 0.3.8.0
Checks if the interacted item is in the specified state.
bool interactItemIsInState(string sceme, int state)
Parameters:
stringsceme: the item scemeintstate: the state to check
Returns bool:
true if in state; otherwise, false
canUse
Available since version: 0.3.8.0
Checks if the NPC can use the specified item.
bool canUse(Item item)
Parameters:
Itemitem: the item to check
Returns bool:
true if can use; otherwise, false
equip
Available since version: 0.3.8.0
Equips the specified item.
void equip(Item item)
Parameters:
Itemitem: the item to equip
equipItem
Available since version: 0.3.8.0
Equips the specified item.
void equipItem(Item item)
Parameters:
Itemitem: the item to equip
useItem
Available since version: 0.3.8.0
Uses the specified item.
bool useItem(Item item)
Parameters:
Itemitem: the item to use
Returns bool:
true if used; otherwise, false
interrupt
Available since version: 0.3.8.0
Interrupts the current action of the NPC.
void interrupt(bool checkBodyState = false, bool stopWeaponChoose = true)
Parameters:
boolcheckBodyState: optional check body stateboolstopWeaponChoose: optional stop weapon choose
getBodyStateModifierNames
Available since version: 0.3.8.0
Gets the current body state modifier names.
string getBodyStateModifierNames()
Returns string:
The body state modifier names.
isBodyStateInterruptable
Available since version: 0.3.8.0
Checks if the body state is interruptable.
bool isBodyStateInterruptable()
Returns bool:
true if interruptable; otherwise, false
hasBodyStateFreeHands
Available since version: 0.3.8.0
Checks if hands are free in current body state.
bool hasBodyStateFreeHands()
Returns bool:
true if hands are free; otherwise, false
onTouch
Available since version: 0.3.8.0
Called when touched by another vob.
void onTouch(Vob otherVob)
Parameters:
VobotherVob: the other vob
doDoAniEvents
Available since version: 0.3.8.0
Executes animation events.
bool doDoAniEvents()
Returns bool:
true on success; otherwise, false
doModelSwapMesh
Available since version: 0.3.8.0
Swaps the model mesh.
bool doModelSwapMesh(string n1, string n2)
Parameters:
stringn1: old mesh namestringn2: new mesh name
Returns bool:
true on success; otherwise, false
doTakeVob
Available since version: 0.3.8.0
Takes the specified vob.
bool doTakeVob(Vob vob)
Parameters:
Vobvob: the vob to take
Returns bool:
true on success; otherwise, false
doDropVob
Available since version: 0.3.8.0
Drops the specified vob.
bool doDropVob(Vob vob)
Parameters:
Vobvob: the vob to drop
Returns bool:
true on success; otherwise, false
doThrowVob
Available since version: 0.3.8.0
Throws the specified vob at the given distance.
bool doThrowVob(Vob vob, float dist)
Parameters:
Vobvob: the vob to throwfloatdist: the throwing distance
Returns bool:
true on success; otherwise, false
doExchangeTorch
Available since version: 0.3.8.0
Exchanges torch.
bool doExchangeTorch()
Returns bool:
true on success; otherwise, false
hasTorch
Available since version: 0.3.8.0
Checks if the NPC currently has a torch.
bool hasTorch()
Returns bool:
true if NPC has torch; otherwise, false
setTorchAni
Available since version: 0.3.8.0
Sets the torch animation state.
void setTorchAni(bool f, bool now = true)
Parameters:
boolf: torch animation stateboolnow: optional whether to apply immediately
checkSetTorchAni
Available since version: 0.3.8.0
Checks whether the NPC needs to set torch animation.
void checkSetTorchAni()
checkPutbackTorch
Available since version: 0.3.8.0
Checks whether the NPC needs to put back the torch.
void checkPutbackTorch()
getFromInv
Available since version: 0.3.8.0
Gets an item from the inventory.
Item getFromInv(int instance, int amount)
Parameters:
intinstance: the item instance idintamount: the amount to get
Returns Item:
the item, or null if not found
isInInv
Available since version: 0.3.8.0
Checks if an item is in the inventory.
Item isInInv(Item item, int num = 1)
Parameters:
Itemitem: item objecintnum: optional amount
Returns Item:
the item if found, otherwise null
isInInv
Available since version: 0.3.8.0
Checks if an item is in the inventory.
Item isInInv(int instanceId, int num = 1)
Parameters:
intinstanceId: instance idintnum: optional amount
Returns Item:
the item if found, otherwise null
isInInv
Available since version: 0.3.8.0
Checks if an item is in the inventory.
Item isInInv(string instanceName, int num = 1)
Parameters:
stringinstanceName: instance nameintnum: optional amount
Returns Item:
the item if found, otherwise null
canCarry
Available since version: 0.3.8.0
Checks if the NPC can carry a specific item.
bool canCarry(Item item)
Parameters:
Itemitem: the item to check
Returns bool:
true if the NPC can carry the item; otherwise, false
putInInv
Available since version: 0.3.8.0
Puts an item into the inventory.
Item putInInv(Item|int|string itemOrInstance, int num = 1)
Parameters:
Item|int|stringitemOrInstance: item object, instance id or instance nameintnum: optional amount
Returns Item:
the inserted item
removeFromInv
Available since version: 0.3.8.0
Removes an item from the inventory.
Item removeFromInv(Item item, int num = 1)
Parameters:
Itemitem: item objectintnum: optional amount
Returns Item:
the removed item
removeFromInv
Available since version: 0.3.8.0
Removes an item from the inventory.
Item removeFromInv(int instanceId, int num = 1)
Parameters:
intinstanceId: instance idintnum: optional amount
Returns Item:
the removed item
removeFromInv
Available since version: 0.3.8.0
Removes an item from the inventory.
Item removeFromInv(string instanceName, int num = 1)
Parameters:
stringinstanceName: instance nameintnum: optional amount
Returns Item:
the removed item
dropInventory
Available since version: 0.3.8.0
Drops the entire inventory.
void dropInventory()
putInSlot
Available since version: 0.3.8.0
Puts the specified vob into the NPC's slot.
void putInSlot(string slotName, Vob vob, bool inInv = false)
Parameters:
stringslotName:Vobvob:boolinInv:
removeFromSlot
Available since version: 0.3.8.0
Removes the item/vob from the specified slot.
Vob removeFromSlot(string slotName, bool dropIt = true, bool killEffect = true)
Parameters:
stringslotName:booldropIt:boolkillEffect:
Returns Vob:
the removed vob or null.
removeFromAllSlots
Available since version: 0.3.8.0
Removes the NPC's items from all slots on their body.
void removeFromAllSlots(bool dropIt = true)
Parameters:
booldropIt:trueif removed items should be dropped, otherwisefalse.
dropFromSlot
Available since version: 0.3.8.0
Drops the item/vob from the specified slot onto the ground.
Vob dropFromSlot(string slotName)
Parameters:
stringslotName:
Returns Vob:
the dropped vob or null.
setItemEffectControledByModel
Available since version: 0.3.8.0
Controls the effect of an item based on a model node.
void setItemEffectControledByModel(Item item, ModelNodeInst node, bool modelControl, bool forceInvisible = false, bool itemEffectCleanUp = false)
Parameters:
Itemitem: the item whose effect is controlledModelNodeInstnode: the model nodeboolmodelControl: whether the model controls the effectboolforceInvisible: optional force invisible flagboolitemEffectCleanUp: optional cleanup flag
setToSlotPosition
Available since version: 0.3.8.0
Sets the vob to the specified slot position on the NPC.
void setToSlotPosition(Vob vob, string slotName)
Parameters:
Vobvob:stringslotName:
isInvSlotAvailable
Available since version: 0.3.8.0
Checks if the inventory slot is available.
bool isInvSlotAvailable(string name)
Parameters:
stringname:
Returns bool:
createInvSlot
Available since version: 0.3.8.0
Creates a custom inventory slot.
void createInvSlot(string name)
Parameters:
stringname:
deleteInvSlot
Available since version: 0.3.8.0
Deletes a custom inventory slot.
void deleteInvSlot(string name)
Parameters:
stringname:
isSlotFree
Available since version: 0.3.8.0
Checks if the specified slot is free.
bool isSlotFree(string name)
Parameters:
stringname:
Returns bool:
getSlotVob
Available since version: 0.3.8.0
Gets the vob attached to the specified slot.
Vob getSlotVob(string name)
Parameters:
stringname:
Returns Vob:
getSlotItem
Available since version: 0.3.8.0
Gets the item attached to the specified slot.
Item getSlotItem(string name)
Parameters:
stringname:
Returns Item:
getSlotNpc
Available since version: 0.3.8.0
Gets the NPC attached to the specified slot.
Npc getSlotNpc(string name)
Parameters:
stringname:
Returns Npc:
getItem
Available since version: 0.3.8.0
Gets an item from the specified NPC inventory category and slot.
Item getItem(int category, int slot)
Parameters:
intcategory: inventory categoryintslot: inventory slot
Returns Item:
the item, or null if not found
dropAllInHand
Available since version: 0.3.8.0
Drops all items/vobs currently held in both hands.
void dropAllInHand()
setRightHand
Available since version: 0.3.8.0
Sets the vob in the NPC's right hand.
void setRightHand(Vob vob)
Parameters:
Vobvob:
getRightHand
Available since version: 0.3.8.0
Gets the vob in the NPC's right hand.
Vob getRightHand()
Returns Vob:
setLeftHand
Available since version: 0.3.8.0
Sets the vob in the NPC's left hand.
void setLeftHand(Vob vob)
Parameters:
Vobvob:
getLeftHand
Available since version: 0.3.8.0
Gets the vob in the NPC's left hand.
Vob getLeftHand()
Returns Vob:
hasInHand
Available since version: 0.3.8.0
Checks if the NPC has the specified item instance in their hands.
bool hasInHand(int instanceId)
Parameters:
intinstanceId: the item instance id
Returns bool:
hasInHand
Available since version: 0.3.8.0
Checks if the NPC has the specified vob in their hands.
bool hasInHand(Vob vob)
Parameters:
Vobvob: the item vob
Returns bool:
dropVob
Available since version: 0.3.8.0
Drops the specified vob at the given position.
void dropVob(Vob vob, Vec3 pos)
Parameters:
Vobvob:Vec3pos:
createItems
Available since version: 0.3.8.0
Creates items in the NPC inventory.
void createItems(int instance, int amount)
Parameters:
intinstance: item instance idintamount: number of items to create
openScreenStatus
Available since version: 0.3.8.0
Open status screen.
void openScreenStatus()
openScreenLog
Available since version: 0.3.8.0
Open log screen.
void openScreenLog()
openScreenMap
Available since version: 0.3.8.0
Open map screen.
void openScreenMap(int mapInst)
Parameters:
intmapInst:
isAPlayer
Available since version: 0.3.8.0
Checks if the NPC is a player character.
bool isAPlayer()
Returns bool:
isSelfPlayer
Available since version: 0.3.8.0
Checks if this NPC is the local player character.
bool isSelfPlayer()
Returns bool:
setAsPlayer
Available since version: 0.3.8.0
Sets this NPC as the active player character.
void setAsPlayer()
isMonster
Available since version: 0.3.8.0
Checks if the NPC is a monster.
bool isMonster()
Returns bool:
isHuman
Available since version: 0.3.8.0
Checks if the NPC is human.
bool isHuman()
Returns bool:
isGoblin
Available since version: 0.3.8.0
Checks if the NPC is a goblin.
bool isGoblin()
Returns bool:
isOrc
Available since version: 0.3.8.0
Checks if the NPC is an orc.
bool isOrc()
Returns bool:
isSkeleton
Available since version: 0.3.8.0
Checks if the NPC is a skeleton.
bool isSkeleton()
Returns bool:
showDebugInfo
Available since version: 0.3.8.0
Shows debug information of the NPC on the active camera.
void showDebugInfo()
useStandAI
Available since version: 0.3.8.0
Activates the NPC stand AI.
void useStandAI()
burn
Available since version: 0.3.8.0
Sets the NPC on fire with specified damage and duration.
void burn(int damage, float timeMs)
Parameters:
intdamage:floattimeMs: (unused by the game)
stopBurn
Available since version: 0.3.8.0
Stops the NPC from burning.
void stopBurn()
updateNextVoice
Available since version: 0.3.8.0
This function will update the next voice of the NPC.
int updateNextVoice()
Returns int:
Callbacks
No callbacks.