Morrowind Mod:Mod File Format/NPC

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search

NPC_ records contain information on NPCs.

C Field Type/Size Info
+ NAME zstring ID string
- MODL zstring NIF model
- FNAM zstring Name
+ RNAM zstring Race name
+ CNAM zstring Class name
- ANAM zstring Faction name
+ BNAM zstring Head model
- KNAM zstring Hair model
- SCRI zstring Script name
+ NPDT struct
(12 or 52 bytes)
NPC data

12-byte version (autocalc flag set)

uint16 - Level
uint8 - Disposition
uint8 - Reputation
uint8 - Rank
uint8[3] - alignment padding (junk)
uint32 - Gold

52-byte version (autocalc flag clear)

uint16 - Level
uint8[8] - Attributes (in order of Attribute ID, as found on Morrowind:Attributes)
uint8[27] - Skills (in order of Skill ID, as found on Morrowind:Skills)
uint8 - alignment padding (junk)
uint16 - Health
uint16 - Spell points
uint16 - Fatigue
uint8 - Disposition
uint8 - Reputation
uint8 - Rank
uint8 - alignment padding (junk)
uint32 - Gold
+ FLAG uint32 NPC flags
0x0001 = Female
0x0002 = Essential
0x0004 = Respawn
0x0008 = Unknown (always set)
0x0010 = Autocalc
0x0400 = Blood Texture: Skeleton
0x0800 = Blood Texture: Metal Sparks
* NPCO struct
(36 bytes)
Carried object
int32 - Object count (negative counts are restocking)
char[32] - Object name
* NPCS char[32] Spells
- AIDT struct
(12 bytes)
AI data
uint8 Hello
uint8 Unknown1
uint8 Fight
uint8 Flee
uint8 Alarm
[3]uint8 alignment padding (junk)
uint32 Flags
0x00001 = Weapon
0x00002 = Armor
0x00004 = Clothing
0x00008 = Books
0x00010 = Ingredients
0x00020 = Picks
0x00040 = Probes
0x00080 = Lights
0x00100 = Apparatus
0x00200 = Repair Items
0x00400 = Misc
0x00800 = Spells
0x01000 = Magic Items
0x02000 = Potions
0x04000 = Training
0x08000 = Spellmaking
0x10000 = Enchanting
0x20000 = Repair
Remaining bits appear to be filled with junk data
* DODT struct
(24 bytes)
Cell Travel Destination
float32 - Position X
float32 - Position Y
float32 - Position Z
float32 - Rotation X
float32 - Rotation Y
float32 - Rotation Z
DNAM
zstring Cell name for previous DODT, if interior
AI Packages - the following fields can appear in any order, one per AI package, with the order defining the package priority.

Note: duration parameters in all packages are in hours. Any value greater than 24 should be divided by 100, and set to 24 if still greater than 24. The unknown value for each package seems to be an end-of-data marker; it is always a byte value set to 1 with any remaining data in the structure undefined and ignored.

* AI_A struct
(33 bytes)
Activate package:
char[32] - Name
uint8 - Unknown (always 1)
AI_E struct
(48 bytes)
Escort package:
float32 - X
float32 - Y
float32 - Z
uint16 - Duration
char[32] - ID
uint8 - Unknown (always 1)
uint8 - Unused
CNDT
zstring Cell escort string (optional)
AI_F struct
(48 bytes)
Follow package:
float32 - X
float32 - Y
float32 - Z
uint16 - Duration
char[32] - ID
uint8 - Unknown (always 1)
uint8 - Unused
CNDT
zstring Cell follow to string (optional)
AI_T struct
(16 bytes)
Travel package:
float32 - X
float32 - Y
float32 - Z
uint8 - Unknown (always 1)
uint8[3] - Unused
AI_W struct
(14 bytes)
Wander package:
uint16 - Distance
uint16 - Duration
uint8 - Time of Day
uint8[8] - Idles
uint8 - Unknown (always 1)