class Creature

class Creature
ActionAttack(target[, passive])

Add attack action to creature.

Parameters:
  • target (Object) – Target to attack.
  • passive (bool) – If true the attack is in passive mode. Default: false.
ActionCastFakeSpellAtLocation(spell, target[, path_type])
Parameters:
  • spell (int) – SPELL_* constant.
  • target (Object) – Object to cast fake spell at.
  • path_type (int) – PROJECTILE_PATH_TYPE_*. Default: PROJECTILE_PATH_TYPE_DEFAULT
ActionCastFakeSpellAtObject(spell, target[, path_type])
Parameters:
  • spell (int) – SPELL_* constant.
  • target (Location) – Location to cast spell at.
  • path_type (int) – PROJECTILE_PATH_TYPE_*. Default: PROJECTILE_PATH_TYPE_DEFAULT
ActionCastSpellAtLocation(spell, target[, metamagic[, cheat[, path_type[, instant]]]])
Parameters:
  • spell (int) – SPELL_* constant.
  • target (Location) – Location to cast spell at.
  • metamagic (int) – METAMAGIC_*. Default: METAMAGIC_ANY
  • cheat (bool) – If true cast spell even if target does not have the ability. Default: false
  • path_type (int) – PROJECTILE_PATH_TYPE_*. Default: PROJECTILE_PATH_TYPE_DEFAULT
  • instant (bool) – If true spell can instantaneously. Default: false
ActionCastSpellAtObject(spell, target[, metamagic[, cheat[, path_type[, instant]]]])
Parameters:
  • spell (int) – SPELL_* constant.
  • target (Object) – Target
  • metamagic (int) – METAMAGIC_*. Default: METAMAGIC_ANY
  • cheat (bool) – If true cast spell even if target does not have the ability. Default: false
  • path_type (int) – PROJECTILE_PATH_TYPE_*. Default: PROJECTILE_PATH_TYPE_DEFAULT
  • instant (bool) – If true spell can instantaneously. Default: false
ActionCounterSpell(target)

Add counter spell action.

Parameters:
  • target (Creature) – Counter spell target.
ActionDoWhirlwindAttack([feedback[, improved]])

Add whirlwind attack action.

Parameters:
  • feedback (bool) – Send feedback. Default: true
  • improved (bool) – Determines if effect is Improved Whirlwind Attack. Default: false
ActionEquipItem(item, slot)

Add equip item action.

Parameters:
  • item (Item) – Identified item in the creature’s inventory.
  • slot (int) – INVENTORY_SLOT_* constant.
ActionEquipMostDamagingMelee([versus[, offhand]])
Parameters:
  • versus (Object) – Object to test against. Default: OBJECT_INVALID
  • offhand (bool) – If true the item is equipped in the offhand slot. Default: false
ActionEquipMostDamagingRanged([versus])
Parameters:
  • versus (Object) – Object to test against. Default: OBJECT_INVALID
ActionEquipMostEffectiveArmor()

Add action to equip the armor with the highest AC in the creature’s inventory.

ActionExamine(target)
Parameters:
  • target (Object) – Object to examine.
ActionForceFollowObject(target[, distance])

Add action to follow a creature until Object:ClearAllActions() is called.

Parameters:
  • target (Object) – Object to follow.
  • distance (float) – Default: 0.0
ActionForceMoveToLocation(target[, run[, timeout])
Parameters:
  • target (Location) – Location to move to.
  • run (bool) – If true run to location. Default: false
  • timeout (float) – Default: 30
ActionForceMoveToObject(target[, run[, range[, timeout]]])
Parameters:
  • target (Object) – Object to move to.
  • run (bool) – If true run to location. Default: false
  • range (float) – Distance to object in meters. Default: 1.0.
  • timeout (float) – Default: 30
ActionInteractObject(target)
Parameters:
  • target (Placeable) – Placeable to interact with.
ActionJumpToLocation(loc)
Parameters:
  • loc (Location) – Location to jump to.
ActionJumpToObject(obj[, straight_line])
Parameters:
  • obj (Object) – Object to jump to.
  • straight_line (bool) – If true creature walks in straight line to object. Default: true
ActionMoveAwayFromLocation(loc[, run[, range]])
Parameters:
  • loc (Location) – Location to move away from.
  • run (bool) – If true creature will run from location. Default: false
  • range (float) – Distance to move in meters. Default: 40.0
ActionMoveAwayFromObject(obj[, run[, range]])
Parameters:
  • obj (Object) – Object to move away from.
  • run (bool) – If true creature will run from object. Default: false
  • range (float) – Distance to move in meters. Default: 40.0
ActionMoveToLocation(loc[, run])
Parameters:
  • loc (Location) – Location to jump to.
  • run (bool) – If true creature will run to location. Default: false
ActionMoveToObject(obj[, run[, range]])
Parameters:
  • obj (Object) – Object to move to.
  • run (bool) – If true creature will run to location. Default: false
  • range (float) – Distance from object in meters. Default: 1.0
ActionPickUpItem(item)
Parameters:
  • item (Item) – Item to pickup.
ActionPlayAnimation(animation[, speed[, dur]])

Causes creature to play an animation.

Parameters:
  • animation (int) – ANIMATION_* constant.
  • speed (float) – Speed of the animation. Default: 1.0
  • dur (float) – Duration of animation. Not applicable to fire and forget animations. Default: 0.0.
ActionPutDownItem(item)
Parameters:
  • item (Item) – Item to put down.
ActionRandomWalk()

The action subject will generate a random location near its current location and pathfind to it. ActionRandomwalk never ends, which means it is necessary to call ClearAllActions in order to allow a creature to perform any other action once ActionRandomWalk has been called.

ActionRest([check_sight])

The creature will rest if not in combat and no enemies are nearby.

Parameters:
  • check_sight (bool) – If true allow creature to rest if enemies are nearby. Default: false.
ActionSit(chair)
Parameters:
ActionTouchAttackMelee(target[, feedback])

Add melee touch attack action.

Parameters:
  • target – Object to perform attack on.
  • feedback (bool) – If true feedback will be displayed in the combat log. Default: true
Return type:

0 for miss, 1 for hit, 2 for critical hit.

ActionTouchAttackRanged(target[, feedback])

Add melee touch attack action.

Parameters:
  • target – Object to perform attack on.
  • feedback (bool) – If true feedback will be displayed in the combat log. Default: true
Return type:

0 for miss, 1 for hit, 2 for critical hit.

ActionUnequipItem(item)
Parameters:
  • item (Item) – Item to unequip.
ActionUseFeat(feat, target)
Parameters:
  • feat (int) – FEAT_*
  • target – Target
  • targetObject
ActionUseItem(item, target, area, loc, prop)
ActionUseSkill(skill, target, subskill, item)
Parameters:
  • skill (int) – SKILL_* constant.
  • target (Object) – Object to target.
  • subskill (int) – SUBSKILL_* constant.
  • item (Item) – Item used in conjunction with skill.
ActionUseTalentAtLocation(talent, loc)
Parameters:
  • talent (Talent) – Talent to use.
  • loc (Location) – Location to use talent.
ActionUseTalentOnObject(talent, target)
Parameters:
  • talent (Talent) – Talent to use.
  • target (Object) – Target to use talent on.
ActivatePortal(ip, password, waypoint, seemless)

Activates a portal between servers.

Parameters:
  • ip (string) – DNS name or IP address (and optional port) of new server.
  • password (string) – Password for login to the destination server. Default: “”
  • waypoint (string) – If set, arriving PCs will jump to this waypoint after appearing at the start location. Default: “”
  • seemless (bool) – If true, the transition will be made ‘seamless’, and the PC will not get a dialog box on transfer. Default: false
AddHenchman(master)

Adds a henchman NPC to a PC.

Parameters:
  • master (Creature) – NPCs new master.
AddJournalQuestEntry(plot, state, entire_party, all_pc, allow_override)

Add an entry to a player’s Journal. (Create the entry in the Journal Editor first).

Parameters:
  • plot (string) – The tag of the Journal category (case sensitive).
  • state (int) – The ID of the Journal entry.
  • entire_party (bool) – If true, the entry is added to the journal of the entire party. Default: true
  • all_pc (bool) – If true, the entry will show up in the journal of all PCs in the module. Default: false
  • allow_override (bool) – If true, override restriction that nState must be > current Journal Entry. Default: false
AddKnownFeat(feat[, level])

Add known feat to creature

Parameters:
  • feat (int) – FEAT_*
  • level (int) – If level is specified feat will be add at that level. Default: 0
AddKnownSpell(sp_class, sp_id, sp_level)

Add known spell to creature.

Parameters:
  • sp_class (int) – CLASS_TYPE_*.
  • sp_id (int) – SPELL_*
  • sp_level (int) – Spell level.
AddToParty(leader)

Add PC to party

Parameters:
AdjustAlignment(alignment, amount[, entire_party])

Adjust creature’s alignment.

Parameters:
  • alignment (int) – ALIGNMENT_* constant.
  • amount (int) – Amount to adjust
  • entire_party (bool) – If true entire faction’s alignment will be adjusted. Default: false
AdjustReputation(target, amount)

Adjust reputation

Parameters:
  • target – Target
  • amount (int) – Amount to adjust
BlackScreen()

Sets the screen to black.

BootPC()

Abruptly kicks a player off a multi-player server.

ChangeToStandardFaction()

Changes creature to standard faction

Classes()

TODO: What does this return?

ClearPersonalReputation(target)

Clears personal reputation

Parameters:
  • target – Target
DayToNight([transition_time])

Changes the current Day/Night cycle for this player to night

Parameters:
  • transition_time (float) – Time it takes to become night. Default: 0
DecrementRemainingFeatUses(feat)

Decrement remaining feat uses.

Parameters:
  • feat (int) – FEAT_*
DecrementRemainingSpellUses(spell)

Decrements the remaining uses of a spell.

Parameters:
  • spell (int) – SPELL_*
Equips(creature)

Iterator of a creature’s equipped items.

Parameters:
  • creature (bool) – If true include creature items. Default: false
ErrorMessage(message, ...)

Send error message on server channel.

Parameters:
  • message (string) – Format string, see string.format
  • ... – Arguments to format string
ExploreArea(area[, explored])

Reveals the entire map of an area to a player.

Parameters:
  • area (Area) – Area to explorer.
  • explored (bool) – true (explored) or false (hidden). Whether the map should be completely explored or hidden. Default: true
FactionMembers([pc_only])

Faction Member Iterator.

Parameters:
  • pc_only (bool) – If true NPCs will be ignored. Default: true
FadeFromBlack([speed])

Fades screen from black

Parameters:
  • speed (int) – FADE_SPEED_* constant. Default: FADE_SPEED_MEDIUM.
FadeToBlack([speed])

Fades screen to black

Parameters:
  • speed (int) – FADE_SPEED_* constant. Default: FADE_SPEED_MEDIUM.
ForceEquip(equips)

Forces creature to equip items

Parameters:
  • equips (table) – A table with items indexed by INVENTORY_SLOT_* constants.
ForceUnequip(item)

Forces creature to unequip an item

Parameters:
  • item (Item) – The item in question.
GetAbilityIncreaseByLevel(level)

Gets ability score that was raised at a particular level.

Parameters:
  • level (int) – Level in question.
GetAbilityModifier(ability[, base])

Get the ability score of a specific type for a creature.

Parameters:
  • ability (int) – ABILITY_*.
  • base (bool) – If true will return the base ability modifier without bonuses (e.g. ability bonuses granted from equipped items). (Default: false)
Return type:

Returns the ability modifier of type ability for self (otherwise -1).

GetAbilityScore(ability[, base])

Get the ability score of a specific type for a creature.

Parameters:
  • ability (int) – ABILITY_*.
  • base (bool) – If true will return the base ability score without bonuses (e.g. ability bonuses granted from equipped items). (Default: false)
Return type:

Returns the ability score of type ability for self (otherwise -1).

GetDexMod([armor_check])

Gets a creatures dexterity modifier.

Parameters:
  • armor_check (bool) – If true uses armor check penalty. (Default: false)
GetAILevel()

Gets creature’s AI level.

GetActionMode(mode)

Check if a creature is using a given action mode

Parameters:
  • mode (int) – ACTION_MODE_*
GetAge()

Gets creature’s age.

GetAlignmentGoodEvil()

Determines the disposition of a creature.

Return type:ALIGNMENT_* constant.
GetAlignmentLawChaos()

Determines the disposition of a creature.

Return type:ALIGNMENT_* constant.
GetAnimalCompanionName()

Gets a creature’s animal companion name.

Return type:string
GetAnimalCompanionType()

Get a creature’s familiar creature type.

Return type:Animal companion constant.
GetAppearanceType()

Gets creature’s appearance type

GetArcaneSpellFailure()

Get creature’s arcane spell failure.

GetAssociate(assoc_type[, nth])

Returns an object’s associate.

Parameters:
  • assoc_type (int) – solstice.associate type constant.
  • nth (int) – Which associate to return. Default: 1
GetAssociateType()

Returns the associate type of the specified creature

Return type:associate type constant.
GetAttackTarget()

Get creature’s attack target

GetAttemptedAttackTarget()

Get creature’s attempted attack target

GetAttemptedSpellTarget()

Get creature’s attempted spell target

GetBICFileName()
GetBodyPart(part)

Gets creature’s body part

Parameters:
  • part (int) –
GetBonusSpellSlots(sp_class, sp_level)

Get bonus spell slots.

Parameters:
  • sp_class (int) – CLASS_TYPE_*.
  • sp_level (int) – Spell level.
GetChallengeRating()

Get creature’s challenge rating

GetClassByLevel(level)

Determines class that was chosen at a particular level.

Parameters:
  • level (int) – Level to get class at.
Return type:

CLASS_TYPE_* constant or CLASS_TYPE_INVALID on error.

GetClassByPosition(position)

Get class type by position

Parameters:
  • position (int) – Valid values: 0, 1, or 2
Return type:

CLASS_TYPE_* or CLASS_TYPE_INVALID.

GetClericDomain(domain)

Determines a cleric’s domain.

Parameters:
  • domain (int) – Cleric’s first or second domain.
GetCombatMode()

Gets creature’s active combat mode.

Return type:COMBAT_MODE_* constant.
GetConversation()

Gets creature’s conversation resref

GetCutsceneCameraMoveRate()

Get cutscene camera movement rate.

GetCutsceneMode()

Get a creature’s cutscene mode

GetDamageFlags()

Get creature’s damage flags.

GetDeity()

Gets creature’s deity.

GetDetectMode()
GetFactionEqual(target)

Get if factions are equal.

Parameters:
  • target – Target
GetFamiliarName()

Gets the creature’s familiar creature name.

GetFamiliarType()

Gets the creature’s familiar creature type.

Return type:FAMILIAR_*
GetFavoredEnemenyMask()

Determine Creatures Favored Enemey Bit Mask.

GetGender()

Gets creature’s gender.

GetGoingToBeAttackedBy()

Get creatures attacker.

GetGoodEvilValue()

Determines a creature’s good/evil rating.

GetHasFeat(feat, has_uses, check_successors)

Determine if creature has a feat

Parameters:
  • feat (int) – FEAT_*
  • has_uses (bool) – Check the feat is usable. Default: false
  • check_successors (bool) – Check feat successors. Default: false
GetHasFeatEffect(feat)

Determines if creature has a feat effect.

Parameters:
  • feat (int) – FEAT_*
GetHasSkill(skill)

Determines if a creature has a skill

Parameters:
  • skill (int) – SKILL_*.
GetHasSpell(spell)

Determines whether a creature has a spell available.

Parameters:
  • spell (int) – SPELL_*
GetHasTalent(talent)

Determines whether a creature has a specific talent.

Parameters:
  • talent – The talent which will be checked for on the given creature.
GetHasTrainingVs(vs)

Determine if creature training vs.

Parameters:
GetHenchman(nth)

Gets the nth henchman of a PC.

Parameters:
  • nth (int) – Henchman index.
GetHighestFeat(feat)

Determines the highest known feat. This function checks all feat successors.

Parameters:
  • feat (int) – FEAT_*
Return type:

bool indicating whether creature has feat and the highest feat.

GetHighestFeatInRange(low_feat, high_feat)

Returns the highest feat in a range of feats.

Parameters:
  • low_feat (int) – FEAT_*
  • high_feat (int) – FEAT_*
Return type:

FEAT_* or -1 on error.

GetHighestLevelClass()

Determines creatures highest class level

Return type:CLASS_TYPE_*, level
GetHitDice(use_neg_levels)

Calculate a creature’s hit dice.

Parameters:
  • use_neg_levels (bool) – If true negative levels factored in to total hit dice. Default: false
GetInventorySlotFromItem(item)

Determine inventory slot from item

Parameters:
  • item (Item) – Item
Return type:

INVENTORY_SLOT_* or -1

GetIsAI()

Determine if creature is an AI.

GetIsBlind()

Determines if a creature is blind.

GetIsBoss()

Determine boss creature. TODO: This should be removed.

GetIsDM()

Determines if Creature is a DM

GetIsDMPossessed()

Gets if creature is possessed by DM.

GetIsEncounterCreature()

Get if creature was spawned by encounter.

GetIsEnemy(target)

Determine if target is an enemy

Parameters:
  • target – Target
GetIsFavoredEnemy(vs)

Determine if creature is favored enemy.

GetIsFlanked(vs)

Determines if a creature is flanked.

Parameters:
GetIsFlatfooted()

Determines if a creature is flatfooted.

GetIsFriend(target)

Determine if target is a friend

Parameters:
  • target – Target
GetIsHeard(target)

Determines if an object can hear another object.

Parameters:
  • target – The object that may be heard.
GetIsImmune(immunity, versus)

Get if creature has immunity.

Parameters:
  • immunity (int) – IMMUNITY_TYPE_*
  • versus (Object) – Versus object.
Return type:

bool

GetIsInCombat()

Determines if creature is in combat.

GetIsInConversation()

Determines whether an object is in conversation.

GetIsInvisible(vs)

Determines if target is invisible.

Parameters:
  • vs (Object) – Creature to test again.
GetIsNeutral(target)

Determine if target is a neutral

Parameters:
  • target – Target
GetIsPC()

Determine if creature is a PC.

GetIsPCDying()

TODO: ???

GetIsPolymorphed()

Get if creature is polymorphed

GetIsPossessedFamiliar()

Retrieves the controller status of a familiar.

GetIsReactionTypeFriendly(target)

Determine reaction type if friendly

Parameters:
GetIsReactionTypeHostile(target)

Determine reaction type if hostile

Parameters:
GetIsReactionTypeNeutral(target)

Determine reaction type if neutral.

Parameters:
GetIsResting()

Check whether a creature is resting.

GetIsSeen(target)

Determines whether an object sees another object.

Parameters:
  • target (Object) – Object to determine if it is seen.
GetIsSkillSuccessful(skill, dc, vs, feedback, auto, delay, take, bonus)

Determines if skill check is successful

Parameters:
  • skill (int) – SKILL_*
  • dc – Difficulty Class
  • vs – Versus a target
  • feedback – If true sends feedback to participants.
  • auto – If true a roll of 20 is automatic success, 1 an automatic failure
  • delay – Delay in seconds.
  • take – Replaces dice roll.
  • bonus – And bonus.
GetIsWeaponEffective(vs, is_offhand)

Determines if weapon is effect versus a target.

Parameters:
  • vs – Attack target.
  • is_offhand – true if the attack is an offhand attack.
GetItemInSlot(slot)

Gets an equipped item in creature’s inventory.

Parameters:
  • slot – INVENTORY_SLOT_*
GetKnownFeat(index)

Gets known feat at index

Parameters:
  • index (int) – Index of feat
GetKnownFeatByLevel(level, idx)

Gets known feat by level at index

Parameters:
  • level – Level in question.
  • idx – Index of feat.
GetKnownSpell(sp_class, sp_level, sp_idx)

Gets known spell.

Parameters:
  • sp_class (int) – CLASS_TYPE_*.
  • sp_level (int) – Spell level.
  • sp_idx – Index of the spell.
Return type:

SPELL_* or -1 on error.

GetKnowsFeat(feat)

Determines if a creature knows a feat. Feats acquired from gear/effects do not count.

Parameters:
  • feat (int) – FEAT_*
GetKnowsSpell(sp_class, sp_id)

Determines if creature knows a spell.

Parameters:
  • sp_class (int) – CLASS_TYPE_*.
  • sp_id – SPELL_*
GetLastAssociateCommand()

Get the last command issued to a given associate.

Return type:COMMAND_*
GetLastAttackMode()

Get’s last attack mode used by creature.

GetLastAttackType()

Get’s last attack type used by creature.

GetLastPerceived()

Determines the last perceived creature in an OnPerception event.

GetLastPerceptionHeard()

Determines if the last perceived object was heard.

GetLastPerceptionInaudible()

Determines whether the last perceived object is no longer heard.

GetLastPerceptionSeen()

Determines if the last perceived object was seen.

GetLastPerceptionVanished()

Determines the last perceived creature has vanished.

GetLastTrapDetected()

Gets last trap detected by creature.

GetLastWeaponUsed()

Gets last weapon used by creature.

GetLawChaosValue()

Determines a creature’s law/chaos value.

GetLevelByClass(class)

Get number of levels a creature by class

Parameters:
  • class (int) – CLASS_TYPE_* type constant.
GetLevelByPosition(position)

Get number of levels a creature by position

Parameters:
  • position (int) – Valid values: 0, 1, or 2
GetLevelStats(level)
GetMaster()

Determines who controls a creature.

GetMaxAttackRange(target)

Determines creatures maximum attack range.

Parameters:
  • target (Object) – Target to attack
GetMaxHitPoints()

Get creature’s maximum hit points. See rules.GetMaxHitPoints()

GetMaxHitPointsByLevel(level)

Get max hit points by level

Parameters:
  • level (int) – The level in question.
GetMaxSpellSlots(sp_class, sp_level)

Gets max spell slots.

Parameters:
  • sp_class (int) – CLASS_TYPE_*.
  • sp_level (int) – Spell level.
GetMemorizedSpell(sp_class, sp_level, sp_idx)

Determines if a spell is memorized

Parameters:
  • sp_class (int) – CLASS_TYPE_*.
  • sp_level (int) – Spell level.
  • sp_idx (int) – Index of the spell.
GetPCBodyBag()

TODO: Expose this??

GetPCBodyBagID()

TODO: Expose this??

GetPCFileName()

Gets PC characters bic file.

GetPCIPAddress()

Retrieves the IP address of a PC.

GetPCPlayerName()

Retrieves the login name of the player of a PC.

GetPCPublicCDKey(single_player)

Retrieves the public version of the PC’s CD key.

Parameters:
  • single_player (bool) – If set to true, the player’s public CD key will be returned when the player is playing in single player mode. Otherwise returns an empty string in single player mode. Default: false
GetPhenoType()

Get creature’s phenotype

GetPositionByClass(class)

Determines class position by class type.

Parameters:
  • class (int) – CLASS_TYPE_*
Return type:

0, 1, 2, or -1 on error.

GetRacialType()

Gets creature’s race.

GetReflexAdjustedDamage(damage, dc, savetype, versus)

Determines reflex saved damage adjustment.

Parameters:
  • damage (int) – Total damage.
  • dc (int) – Difficulty class
  • savetype (int) – Saving throw type constant.
  • versus (Creature) – Creature to roll against.
GetRelativeWeaponSize(weap)

Determines a weapons weapon size relative to a creature.

Parameters:
  • weap (Item) – The weapon in question.
GetRemainingFeatUses(feat, has)

Get remaining feat uses

Parameters:
  • feat (int) – FEAT_*
  • has (bool) – If true function assumes that creature has the feat in question. Default: false.
GetRemainingSpellSlots(sp_class, sp_level)

Determines remaining spell slots at level.

Parameters:
  • sp_class (int) – CLASS_TYPE_*.
  • sp_level (int) – Spell level.
GetReputation(target)

Gets reputation of creature.

Parameters:
  • target – Target
GetSavingThrowBonus(save)

Gets creatures saving throw bonus

Parameters:
  • save – SAVING_THROW_*
GetSize()

Gets creature’s size

GetSkillCheckResult(skill, dc, vs, feedback, auto, delay, take, bonus)

Determines a skill check.

Parameters:
  • int skill (int) – SKILL_*
  • dc (int) – Difficulty Class
  • vs – Versus a target
  • feedback (bool) – If true sends feedback to participants.
  • auto (bool) – If true a roll of 20 is automatic success, 1 an automatic failure
  • delay (float) – Delay in seconds.
  • take (int) – Replaces dice roll.
  • bonus (int) – And bonus.
GetSkillIncreaseByLevel(level, skill)

Gets the amount a skill was increased at a level.

Parameters:
  • level (int) – Level to check
  • skill (int) – SKILL_*
Return type:

-1 on error.

GetSkillPoints()

Returns a creatures unused skillpoints.

GetSkillRank(skill[, vs[, base]])

Gets creature’s skill rank.

Parameters:
  • skill (int) – SKILL_*
  • vs – Versus. Default: OBJECT_INVALID
  • base (bool) – If true returns base skill rank. Default: false
GetStandardFactionReputation(faction)

Get standard faction reputation

Parameters:
  • faction (int) – STANDARD_FACTION_* constant.
GetStartingPackage()

Gets creature’s starting package.

GetSubrace()

Gets creature’s subrace

GetTail()

Gets creature’s tail.

GetTalentBest(category, cr_max)

Determines the best talent of a creature from a group of talents.

Parameters:
  • category (int) – TALENT_CATEGORY_*
  • cr_max (int) – The maximum Challenge Rating of the talent.
GetTalentRandom(category)

Retrieves a random talent from a group of talents that a creature possesses.

Parameters:
  • category (int) – TALENT_CATEGORY_*
GetTargetState(target)

Get target state bit mask.

Parameters:
  • target (Creature) – Creature target.
GetTotalFeatUses(feat)

Get total feat uses.

Parameters:
  • feat (int) – FEAT_*
GetTotalKnownFeats()

Get total known feats.

GetTotalKnownFeatsByLevel(level)

Get total known feats by level.

Parameters:
  • level (int) – The level to check.
Return type:

-1 on error.

GetTotalKnownSpells(sp_class, sp_level)

Determines total known spells at level.

Parameters:
  • sp_class (int) – CLASS_TYPE_*.
  • sp_level (int) – Spell level.
GetTotalNegativeLevels()

Gets total negative levels

GetTrainingVsMask()
GetTurnResistanceHD()

Determines turn resistance hit dice.

GetWeaponFromAttackType(atype)
Parameters:
  • atype (int) – ATTACK_TYPE_*
Return type:

An item or OBJECT_INVALID

GetWings()

Gets creature’s wings

GetWizardSpecialization()

Gets a creature’s wizard specialization.

GetXP()

Gets a creatures XP.

GiveGold(amount, feedback, source)

Gives gold to creature

Parameters:
  • amount (int) – Amount of gold to give.
  • feedback (bool) – Sends feedback to creature. Default: true
  • source (Object) – Source object. Default: OBJECT_INVALID
IncrementRemainingFeatUses(feat)

Increment remaining feat uses.

Parameters:
  • feat (int) – FEAT_*
JumpSafeToLocation(loc)
Parameters:
  • loc (Location) – Location to jump to.
JumpSafeToObject(obj)
Parameters:
  • obj (Object) – Object to jump to.
JumpSafeToWaypoint(way)
Parameters:
  • way (Waypoint) – Waypoint to jump to.
LevelUpHenchman([class[, ready_spells[, package]]])

Levels up a creature using the default settings.

Parameters:
  • class (int) – CLASS_TYPE_* Default: CLASS_TYPE_INVALID
  • ready_spells (bool) – Determines if all memorizable spell slots will be filled without requiring rest. Default: false
  • package (int) – PACKAGE_* Default: PACKAGE_INVALID
LockCameraDirection([locked])

Locks a creatures camera direction.

Parameters:
  • locked (bool) – (Default: false)
LockCameraDistance([locked])

Locks a creatures camera distance.

Parameters:
  • locked (bool) – (Default: false)
LockCameraPitch([locked])

Locks a creatures camera pitch.

Parameters:
  • locked (bool) – (Default: false)
ModifyAbilityScore(ability, value)

Modifies the ability score of a specific type for a creature.

Parameters:
  • ability (int) – ABILITY_*.
  • value (int) – Amount to modify ability score
ModifySkillRank(skill, amount, level)

Modifies skill rank.

Parameters:
  • skill (int) – SKILL_*
  • amount (int) – Amount to modify skill rank.
  • level (int) – If a level is specified the modification will occur at that level.
ModifyXP(amount, direct)

Modifies a creatures XP.

Parameters:
  • amount (int) – Amount of XP to give or take.
  • direct (bool) – If true the xp amount is set directly with no feedback to player. Default: false
NightToDay([transition_time])

Changes the current Day/Night cycle for this player to daylight

Parameters:
  • transition_time (float) – Time it takes for the daylight to fade in Default: 0
NotifyAssociateActionToggle(mode)

Notifies creature’s associates of combat mode change

Parameters:
  • mode (int) – COMBAT_MODE_* constant.
PlayVoiceChat(id)
Parameters:
  • id (int) – VOICE_CHAT_* constant.
PopUpDeathGUIPanel(respawn_enabled, wait_enabled, help_strref, help_str)

Displays a customizable death panel.

Parameters:
  • respawn_enabled (bool) – If true, the “Respawn” button will be enabled. Default: true
  • wait_enabled (bool) – If true, the “Wait For Help” button will be enabled. Default: true
  • help_strref (int) – String reference to display for help. Default: 0
  • help_str (string) – String to display for help which appears in the top of the panel. Default: “”
PopUpGUIPanel(gui_panel)

Displays a GUI panel to a player.

Parameters:
  • gui_panel (int) – GUI_PANEL_* constant.
RecalculateDexModifier()

Recalculates a creatures dexterity modifier.

ReequipItemInSlot(slot)

Forces the item in an inventory slot to be reequiped.

Parameters:
  • slot (int) – INVENTORY_SLOT_*
RemoveFromParty()

Remove PC from party.

RemoveHenchman(master)

Removes the henchmen from the employ of a PC.

Parameters:
  • master (Creature) – Henchman’s master
RemoveJournalQuestEntry(plot, entire_party, all_pc)

Removes a journal quest entry from a PCs journal.

Parameters:
  • plot (string) – The tag for the quest as used in the toolset’s Journal Editor.
  • entire_party (bool) – If this is true, the entry will be removed from the journal of everyone in the party. Default: true
  • all_pc (bool) – If this is true, the entry will be removed from the journal of everyone in the world. Default: false
RemoveKnownFeat(feat)

Remove feat from creature.

Parameters:
  • feat (int) – FEAT_*
RemoveKnownSpell(sp_class, sp_level, sp_id)

Remove known spell from creature

Parameters:
  • sp_class (int) – CLASS_TYPE_*.
  • sp_level (int) – Spell level.
  • sp_id (int) – SPELL_*
RemoveSummonedAssociate(master)

Removes an associate NPC from the service of a PC.

Parameters:
  • master (Creature) – Creature’s master.
ReplaceKnownSpell(sp_class, sp_id, sp_new)

Remove known spell from creature

Parameters:
  • sp_class (int) – CLASS_TYPE_*.
  • sp_id (int) – SPELL_*
  • sp_new (int) – SPELL_*
RestoreBaseAttackBonus()

Restores a creature’s base number of attacks.

RestoreCameraFacing()

Restore creatures camera orientation.

SendChatMessage(channel, from, message)

Sends a chat message

Parameters:
  • channel (int) – Channel the message to send message on.
  • from (Object) – Sender.
  • message (string) – Text to send.
SendMessage(message, ...)

Sends a message to the PC.

Parameters:
  • message (string) – Format string, see string.format
  • ... – Arguments to format string
SendMessageByStrRef(strref)

Sends a message to the PC by StrRef.

Parameters:
  • strref (int) – StrRef of the message to send
SendServerMessage(message, ...)

Simple wrapper around SendChatMessage() that sends a server message to a player.

Parameters:
  • message (string) – Format string, see string.format
  • ... – Arguments to format string
SetAILevel(ai_level)

Sets creature’s AI level.

Parameters:
  • ai_level (int) – AI_LEVEL_* constant.
SetActionMode(mode, status)

Sets the status of an action mode on a creature

Parameters:
  • mode (int) – ACTION_MODE_*
  • status (int) – New value.
SetAge(age)

Set creature’s age.

Parameters:
  • age (int) – New age.
SetAppearanceType(type)

Sets creature’s appearance type

Parameters:
  • type (int) – Appearance type.
SetAssociateListenPatterns()

Prepares an associate (henchman, summoned, familiar) to be commanded.

SetBaseAttackBonus(amount)

Sets a creature’s base number of attacks.

Parameters:
  • amount (int) – Amount of attacks.
SetBodyPart(part, model_number)

Sets creature’s body part

Parameters:
  • part – CREATURE_PART_* constant.
  • model_number – CREATURE_MODEL_TYPE_* constant.
SetCameraFacing(direction[, distance[, pitch[, transition_type]]])

Set creatures camera orientation.

Parameters:
  • direction (float) – direction to face.
  • distance (float) – Camera distance. Default: -1.0
  • pitch (float) – Camera pitch. Default: -1.0
  • transition_type (int) – CAMERA_TRANSITION_TYPE_* constant. Default: CAMERA_TRANSITION_TYPE_SNAP
SetCameraHeight(height)

Set camera height

Parameters:
  • height (int) – New height.
SetCameraMode(mode)

Set Camera mode

Parameters:
  • mode (int) – New mode
SetClericDomain(domain, newdomain)

Sets a cleric’s domain.

Parameters:
  • domain (int) – Cleric’s first or second domain
  • newdomain (int) – See domains.2da
SetCombatMode(mode, change)

Sets creature’s combat mode

Parameters:
  • mode (int) – COMBAT_MODE_* constant.
  • change (bool) – If false the combat mode is already active.
SetCutsceneCameraMoveRate(rate)

Sets camera movement rate.

Parameters:
  • rate (float) – New movement rate
SetCutsceneMode(in_cutscene, leftclick_enabled)

Sets cutscene move

Parameters:
  • in_cutscene (bool) – Default: false
  • leftclick_enabled (bool) – Default: false
SetDeity(deity)

Sets creature’s deity

Parameters:
  • deity (string) – New deity
SetGender(gender)

Sets creature’s gender

Parameters:
  • gender (int) – New gender
SetIsTemporaryEnemy(target, decays, duration)

Set creature as a temporary enemy

Parameters:
  • target (Object) – Target
  • decays (bool) – If true reactions will return after duration. Default: false
  • duration (float) – Time in seconds. Default: 180.0
SetIsTemporaryFriend(target, decays, duration)

Set creature as a temporary friend

Parameters:
  • target (Object) – Target
  • decays (bool) – If true reactions will return after duration. Default: false
  • duration (float) – Time in seconds. Default: 180.0
SetIsTemporaryNeutral(target, decays, duration)

Set creature as a temporary neutral

Parameters:
  • target (Object) – Target
  • decays (bool) – If true reactions will return after duration. Default: false
  • duration (float) – Time in seconds. Default: 180.0
SetKnownFeat(index, feat)

Set known feat on creature

Parameters:
  • index (int) – Feat index to set
  • feat (int) – FEAT_*
SetKnownFeatByLevel(level, index, feat)

Set known feat by level

Parameters:
  • level (int) – Level to set the feat on.
  • index (int) – Feat index
  • feat (int) – FEAT_*
SetKnownSpell(sp_class, sp_level, sp_idx, sp_id)

Sets a known spell on creature

Parameters:
  • sp_class (int) – CLASS_TYPE_*.
  • sp_level (int) – Spell level.
  • sp_idx (int) – Index of the spell to change.
  • sp_id (int) – SPELL_*
SetLootable(lootable)

Sets creature lootable

Parameters:
  • lootable (int) – New lootable value
SetMaxHitPointsByLevel(level, hp)

Set max hitpoints by level.

Parameters:
  • level (int) – The level in question.
  • hp (int) – Amount of hitpoints.
SetMemorizedSpell(sp_class, sp_level, sp_idx, sp_spell, sp_meta, sp_flags)

Sets a memorized spell on creature

Parameters:
  • sp_class (int) – CLASS_TYPE_*.
  • sp_level (int) – Spell level.
  • sp_idx (int) – Index of the spell to change.
  • sp_spell (int) – SPELL_*
  • sp_meta (int) – METAMAGIC_*
  • sp_flags (int) – Spell flags.
SetMovementRate(rate)

Set creatures movement rate.

Parameters:
  • rate (int) – MOVE_RATE_*
SetPCBodyBag(bodybag)

TODO: Expose???

SetPCBodyBagID(bodybagid)

TODO: Expose???

SetPCDislike(target)

Sets that a player dislikes a creature (or object).

Parameters:
  • target (Creature) – The creature that dislikes the PC (and the PC dislike it).
SetPCLike(target)

Causes a creature to like a PC.

Parameters:
  • target (Creature) – Target to alter the feelings of.
SetPCLootable(lootable)

TODO: Expose???

SetPanelButtonFlash(button, enable_flash)

Make a panel button in the player’s client start or stop flashing.

Parameters:
  • button (int) – PANEL_BUTTON_* constant.
  • enable_flash (bool) – true to flash, false to stop flashing
SetPhenoType(phenotype)

Set creature’s phenotype

Parameters:
  • phenotype (int) – Phenotype constant.
SetRemainingSpellSlots(sp_class, sp_level, sp_slots)

Sets a remaining spell slots on creature.

Parameters:
  • sp_class (int) – CLASS_TYPE_*.
  • sp_level (int) – Spell level.
  • sp_slots (int) – Number of slots.
SetSavingThrowBonus(save, bonus)

Sets creatures saving throw bonus

Parameters:
  • save (int) – SAVING_THROW_* constant.
  • bonus (int) – New saving throw bonus
SetSkillPoints(amount)

Sets a creatures skillpoints available.

Parameters:
  • amount (int) – New amount
SetSkillRank(skill, amount)

Sets a creatures skill rank

Parameters:
  • skill (int) – SKILL_*
  • amount (int) – New skill rank
SetStandardFactionReputation(faction, rep)

Set standard faction reputation

Parameters:
  • faction (int) – STANDARD_FACTION_* constant.
  • rep (int) – Reputation. 0-100 inclusive.
SetSubrace(subrace)

Set creature’s subrace

Parameters:
  • subrace (string) – New subrace
SetTail(tail)

Sets creature’s tail

Parameters:
  • tail (int) – Tail type constant.
SetWings(wings)

Sets creature’s wings

Parameters:
  • wings (int) – Wing type constant.
SetWizardSpecialization(specialization)

Set a wizard’s specialization.

Parameters:
  • specialization (int) – see schools.2da
SetXP(amount, direct)

Sets a creatures XP

Parameters:
  • amount (int) – Amount to set XP to.
  • direct (bool) – If true the xp amount is set directly with no feedback to player. Default: false.
SpeakOneLinerConversation(resref[, target])
Parameters:
  • resref (string) – Dialog resref.
  • target (int) – Must be specified if there are creature specific tokens in the string. Default: OBJECT_TYPE_INVALID
StopFade()

Stops a screen fade

StoreCameraFacing()

Stores camera orientation.

SuccessMessage(message, ...)

Send success message on server channel.

Parameters:
  • message (string) – Format string, see string.format
  • ... – Arguments to format string
SummonAnimalCompanion()

Summons creature’s animal companion

SummonFamiliar()

Summons creature’s familiar

SurrenderToEnemies()

Causes all creatures in a 10 meter (1 tile) radius to stop actions. Improves the creature’s reputation with nearby enemies for 3 minutes. Only works for NPCs.

TakeGold(amount, feedback, source)

Takes gold to creature

Parameters:
  • amount (int) – Amount of gold to take.
  • feedback (bool) – Sends feedback to creature. Default: true
  • source (Object) – Source object. Default: OBJECT_INVALID
UnpossessFamiliar()

Unpossesses a familiar from its controller.