Creature

class pynwn.Creature(resource, instance=False)

The Creature class abstracts over UTCs only. It doesn’t handle all the additional fields one finds in BICs, see pynwn.PlayerCharacter for that.

Parameters:
  • resource (str, (pynwn.ContentObject, pynwn.Container), or pynwn.GffInstance) – Filename or content object.
  • instance – Deterimines if the current creature is an instanced object or not.
appearance

Appearance ID.

bodybag

Body bag.

charisma

Creature’s charisma.

classes

Creature’s classes.

Returns:List of tuples containing class ID and level.
comment

Comment.

constitution

Creature’s constitution.

conversation

Dialog resref.

corpse_decay

Corpse decay time.

cr

Challenge Rating

dexterity

Creature’s dexterity.

diety

Deity

disarmable

Disarmable flag.

equips

Creature’s equipment list.

Returns:List of tuples containing equipment ID and resref.
faction

Faction ID.

feats

Creature’s feats.

Returns:List of feat IDs.
gender

Gender.

get_description(lang=None)

Localized description

get_name_first(lang=None)

Localized first name

get_name_last(lang=None)

Localized last name

get_skill(skill)
goodevil

Good - Evil

hp

HP.

hp_current

Current hitpoints.

hp_max

Maximum hitpoints.

intelligence

Creature’s intelligence.

interruptable

Conversation interruptable flag.

is_immortal

Immortal flag.

is_pc

Player character flag.

items

Creature’s inventory items.

Returns:List of RepositoryItems.
lawchaos

Lawful - Chaotic

lootable

Lootable.

natural_ac

Natural AC.

no_perm_death

No permenant death flag.

palette_id

Palette ID.

perception_range

Perception Range.

phenotype

Phenotype ID.

portrait_id

Portrait ID.

race

Racial Type

resref

Resref.

save_fortitude

Fortitude saving throw.

save_reflex

Reflex saving throw.

save_will

Will saving throw.

scripts

Creature’s scripts. Responds to script events:

  • Event.HEARTBEAT
  • Event.PERCEPTION
  • Event.SPELL_CAST_AT
  • Event.ATTACKED
  • Event.DAMAGED
  • Event.DISTURBED
  • Event.END_COMBAT_ROUND
  • Event.CONVERSATION
  • Event.SPAWN
  • Event.REST
  • Event.DEATH
  • Event.USER_DEFINED
  • Event.BLOCKED
set_description(lang=None, string=None)

Localized description

set_name_first(lang=None, string=None)

Localized first name

set_name_last(lang=None, string=None)

Localized last name

set_skill(skill, value)
skills

Creature’s skills

Returns:List of skill ranks in order of skill ID.
special_abilities
stage()

Stages changes creature’s GFF structure.

starting_package

Starting package ID.

strength

Creature’s strength.

subrace

Subrace.

tag

Tag

tail

Tail ID.

vars

Variable table

walkrate

Walkrate.

wings

Wings ID.

wisdom

Creature’s wisdom.


class pynwn.CreatureInstance(gff, parent_obj)

A creature instance is one placed in an area in the toolset. As such it’s values are derived from its parent GFF structure.

equips

Creature’s equipment list.

Returns:List of tuples containing equipment ID and pynwn.ItemInstance.
items

Creature’s inventory items.

Returns:List of tuples contiain repository position and the pynwn.ItemInstance.
stage()

Stages changes to the creature instances parent object.