STL 4.00 ; Definitions for Infinity Engine data structures. ; (C) 1998-2000 Dmitry Jemerov (yole@spb.cityline.ru) ; Based on information from the Baldur's Gate File Format Hacking Project /BIFF header ;

BIFF V1

c 8 Signature ; 'BIFF V1' i32 1 Element count i32 1 Map count j32 BIFFentry=@ Element offset /BIFFentry i16 1 Element index i16 1 BIFF index d 1 Start ; Absolute file offset to start of this resource i32 1 Size ; The size in bytes of the resource i32 1 Type /BIFF map entry i16 1 Map index i16 1 BIFF index d 1 ResPtr i32 1 BlockCount i32 1 BlockSize i32 1 Type /ARE header ;

AREA V1.0

; An important resource. Defines the contents of an area: the location of ; exits (doors), signs, triggers, and other things that interact with your ; character in one way or another.

c 8 Signature ; 'AREAV1.0' c 8 Id d 1 last saved d 1 unknown c 8 exit N d 1 unknown c 8 exit W d 1 unknown c 8 exit S d 1 unknown c 8 exit E d 1 unknown t16 0 flags i16 1 rain probability i16 1 snow probability i16 1 fog probability i16 1 lightning probability i16 1 unknown j32 ARENPC=@ NPC i16 1 NPC count i16 1 info count j32 AREInfo=@ info d 1 unknown offset i32 1 unknown count j32 AREExit=@ entrances i32 1 entrance count j32 ARECntr=@ containers i16 1 container count i16 1 item count j32 AREItem=@ items j32 ARECoord=@ point offset i16 1 point count i16 1 sound count j32 ARESound=@ sounds j32 AREVar=@ var offset i32 1 var count d 1 unknown c 8 AI script d 1 explored mask size d 1 explored mask offset i32 1 door count j32 AREDoor=@ door ptr i32 1 anim count j32 AREAnim=@ anim ptr i32 1 tiled object count d 1 tiled object offset j32 ARESmth=@ smth offset d 2 unknown j32 ARENote=@ automap note i32 1 automap note count d 19 unknown /ARENPC an0: c 32 Name i16 1 current X i16 1 current Y i16 1 dest X i16 1 dest Y d 8 unknown c 8 dialog c 8 script_override c 8 script_class c 8 script_race c 8 script_general c 8 script_default c 8 script_specifics c 8 CRE file j32 CRE12=@ CRE offset d 33 unknown /AREInfo sc 32 Id i16 1 Type i16 1 X1 coord i16 1 Y1 coord i16 1 X2 coord i16 1 Y2 coord w 1 point count d 1 first point w 4 unknown c 8 dest area sc 32 dest entrance d 1 flags i32 1 TLK index w 1 trap detection difficulty w 1 trap removal difficulty w 1 trapped w 1 trap detected i16 1 trap launch X i16 1 trap launch Y c 8 key type c 8 script w 28 unknown c 8 dialog /AREExit c 32 Id i16 1 X i16 1 Y i16 1 Z w 2 unknown d 15 unknown w 1 unknown /ARECntr c 32 id w 2 unknown w 1 type w 1 lock difficulty w 1 locked w 1 unknown w 1 trap detection difficulty w 1 trap removal difficulty w 1 trapped w 1 trap detected w 1 trap launch X w 1 trap launch Y w 1 X1 w 1 Y1 w 1 X2 w 1 Y2 i32 1 start item i32 1 item count c 8 trap script d 1 first point d 1 point count sc 32 unknown c 8 key type d 1 unknown d 15 unknown /AREItem c 8 id i16 1 unknown i16 1 count i32 1 unknown i16 1 identified i16 1 unknown /_ARESoundVariant c 8 sound /ARESound c 32 Id i16 1 X i16 1 Y i16 1 Z w 5 unknown * 10 _ARESoundVariant i32 1 sound count d 20 unknown /ARECoord i16 1 X i16 1 Y /AREVar c 32 name d 2 unknown d 1 value d 10 unknown /AREDoor sc 32 name c 8 id d 1 flags d 1 open first point w 1 open point count w 1 closed point count d 1 closed first point i16 1 X i16 1 Y i16 1 X i16 1 Y i16 1 X i16 1 Y i16 1 X i16 1 Y d 1 some first point 1 w 1 some point count 1 w 1 some point count 2 d 1 some first point 2 w 2 unknown c 8 unknown c 8 unknown d 1 unknown w 1 trap detection difficulty w 1 trap removal difficulty w 1 trapped w 1 trap detected i16 1 trap launch X i16 1 trap launch Y c 8 key type c 8 trap script d 1 unknown d 1 lock difficulty i16 1 X1 i16 1 Y1 i16 1 X2 i16 1 Y2 d 2 unknown b 40 unknown /AREAnim c 8 id b 32 unknown c 8 id 2 b 28 unknown /ARENote i32 1 X i32 1 Y c 524 Text /ARESmth d 36 unknown /MOS header c 8 Signature i16 1 Width i16 1 Height i16 1 Columns i16 1 Rows i32 1 BlkSize i32 1 BlkBPP /TLK header c 8 Signature w 1 Unknown i32 1 Entries d 1 BaseOffset /TLKEntry w 1 Type c 8 Sound d 2 Unknown d 1 Offset i32 1 Size /eff w 'eff effect type b 1 target type b 1 unknown i32 1 param i32 1 param2 t16 0 flags i32 1 time i16 1 probability sc 8 ResRef i32 1 damage dice count i32 1 damage dice sides i32 1 save type i32 1 save bonus i32 1 unknown /ITM10Header c 8 Signature i32 1 TLK Unidentified i32 1 TLK Identified sc 8 Destroyed t32 0 ItemAttributes i16 1 ItemType t32 0 ItemUsability c 2 WeaponID i16 1 MinLevel i16 1 MinStr i16 1 MinStrBonus i16 1 MinInt i16 1 MinDex i16 1 MinWis i16 1 MinCon i16 1 MinCha i32 1 Price i16 1 MaxInStack c 8 BAMIDInv i16 1 LoreToIdentify c 8 BAMIDGround i32 1 Weight i32 1 TLK Unident Description i32 1 TLK Ident Description sc 8 BAMIDCarried i32 1 Enchanted j32 ITM11Weapon=@ WeaponEntryPtr i16 1 WeaponEntryCount j32 eff=@ EffectTablePtr i16 1 FirstGlobalEffect i16 1 GlobalEffectCount /ITM11Header * 1 ITM10Header c 8 Dialog i32 1 unknown TLK i16 14 unknown /ITM11Weapon i8 1 AbilityType i8 1 UseOnlyIdentified i16 1 unknown c 8 IWeaponID i16 1 target type i16 1 range i16 1 launcher type i16 1 speed factor i16 1 bonus i16 1 dice value i16 1 dice count i16 1 enchanted i16 1 damage type i16 1 effect count i16 1 first effect i16 1 charge count i16 1 unknown i32 1 unknown i16 4 unknown i16 1 is arrow i16 1 is bolt i16 1 is missile /BAMHeader c 8 Signature i16 1 FrameCnt u8 1 AnimCnt b 1 TransparentColor j32 BAMFrameHdr=@ FrameHeaderPtr d 1 PalettePtr d 1 AnimArrayPtr /BAMFrameHdr i16 1 Width i16 1 Height i16 1 Xpos i16 1 Ypos d 1 GraphicsPtr ; bit 31: if set, frame ; is not compressed, ; else frame is RLE compressed /BAMAnimHdr i16 1 Frames i16 1 Start /GAM c 8 Signature i32 1 game time i32 3 unknown i32 1 gold i32 1 unknown j32 GAMChar=@ party ptr i32 1 party count d 2 unknown j32 GAMChar=@ NPC ptr i32 1 NPC count j32 GAMVar=@ var ptr i32 1 var count /GAMChar i16 1 unknown i16 1 position j32 CRE12=@ CRE file d 1 data length d 3 unknown c 8 current area i16 1 X coord i16 1 Y coord i16 1 view rectangle X i16 1 view rectangle Y d 38 unknown c 21 name b 139 unknown b 8 unknown /GAMVar c 40 name b 44 value /CREcommon1 c 8 Signature i32 1 Name TLK index i32 1 TLK index i32 1 unknown i32 1 kill experience i32 1 Experience i32 2 unknown i16 1 max HP i16 1 current HP t32 4444 DollGfx i8 1 unknown i8 1 color minor i8 1 color major i8 1 color skin w 1 unknown i8 1 color hair i8 1 unknown c 8 image S c 8 image L i16 2 unknown i16 1 AC i16 1 AC crushing i16 1 AC missile i16 1 AC piercing i16 1 AC slashing i8 1 THAC0 i8 1 # attacks i8 1 ST PPDM i8 1 ST RSW i8 1 ST PP i8 1 ST BW i8 1 ST spells i8 1 resist fire i8 1 resist cold i8 1 resist electricity i8 1 resist acid i8 1 resist magic i8 1 resist magical fire i8 1 resist magical cold i8 1 resist slashing i8 1 resist piercing i8 1 resist crushing i8 1 resist missile i8 3 unknown i8 1 open locks i8 1 stealth i8 1 detect traps i8 1 pick pockets i8 3 unknown i8 1 prof fist i8 1 prof edged i8 1 prof hammer i8 1 prof axe i8 1 prof club i8 1 prof bow i16 24 unknown i32 100 TLK indexes i8 1 class 1 level i8 1 class 2 level i8 1 class 3 level i8 1 unknown i8 1 Str i8 1 Str % i8 1 Int i8 1 Wis i8 1 Dex i8 1 Con i8 1 Cha i8 7 unknown w 1 specialist mage c 8 script_override c 8 script_class c 8 script_race c 8 script_general c 8 script_default /CREcommon2 i8 1 enemy-ally i8 1 general i8 1 race i8 1 class i8 1 specific i8 1 sex i8 5 unknown t8 44 alignment i8 4 unknown sc 32 name /CRE10 c0: * 1 CREcommon1 * 1 CREcommon2 j32 CRESpell=^c0+@ known spells offset i32 1 known spells count j32 CREMInfo=^c0+@ memorized offset i32 1 memorized count j32 CREMSpell=^c0+@ set to memorize offset i32 1 set to memorize count d 1 item slot offset j32 CREItem=^c0+@ item offset i32 1 item count d 1 effect offset i32 1 effect count c 8 dialog /CRE12 c0: * 1 CREcommon1 i8 76 unknown sc 32 race_name i8 10 unknown i8 10 unknown i8 10 unknown i8 10 unknown i8 10 unknown i8 4 unknown i8 1 team i8 1 faction * 1 CREcommon2 j32 CRESpell=^c0+@ known spells offset i32 1 known spells count j32 CREMInfo=^c0+@ memorized offset i32 1 memorized count j32 CREMSpell=^c0+@ set to memorize offset i32 1 set to memorize count d 1 item slot offset j32 CREItem=^c0+@ item offset i32 1 item count d 1 effect offset i32 1 effect count c 8 dialog /CRE90 c0: * 1 CREcommon1 i8 14 unknown sc 32 var1 sc 32 var2 i8 26 unknown * 1 CREcommon2 j32 CRESpell=^c0+@ known spells offset i32 1 known spells count j32 CREMInfo=^c0+@ memorized offset i32 1 memorized count j32 CREMSpell=^c0+@ set to memorize offset i32 1 set to memorize count d 1 item slot offset j32 CREItem=^c0+@ item offset i32 1 item count d 1 effect offset i32 1 effect count c 8 dialog /CREItem c 8 item ID i16 1 unknown i16 1 count i32 1 unknown i16 1 identified i16 1 unknown /CRESpell c 8 spell ID i16 1 level i16 1 type /CREMInfo i16 1 spell level i16 1 can memorize 1 i16 1 can memorize 2 i16 1 spell type i16 2 unknown i16 1 num memorized i16 1 unknown /CREMSpell c 8 spell ID i16 1 not used i16 1 unknown /SPL10 c 8 signature i32 1 TLK name d 1 unknown sc 8 sound ID d 1 unknown w 1 unknown d 1 unknown w 1 unknown t16 0 school i16 1 min Str i16 1 min Str bonus i16 1 min Int i16 1 min Dex i16 1 min Wis i16 1 min Con i16 1 min Cha i32 1 level w 1 unknown sc 8 BAM ID d 1 unknown w 3 unknown d 1 unknown i32 1 TLK desc d 1 unknown sc 8 sound ID 2 d 1 unknown j32 SPL10var=@ variant offset w 1 variant count j32 eff=@ effect offset d 1 unknown /SPL10var w 2 unknown sc 8 unknown w 2 unknown i16 1 min level w 6 unknown w 1 effect count w 1 first effect w 3 unknown /'eff 0 AC 1 ATTACKNO 2 AWAKEN 3 BERSERK 4 CALM 5 CHARM 6 CHR 7 COLORCHANGE 8 COLORGLOW_SOLID 9 COLORGLOW_PULSE 10 CON 11 CUREPOISON 12 DAMAGE 13 DEATH 14 DEFROST 15 DEX 16 HASTE 17 HEAL 18 HITPOINTS 19 INT 20 INVISIBLE 21 LORE 22 LUCK 23 MORALE 24 PANIC 25 POISON 26 REMOVECURSE 27 RESISTACID 28 RESISTCOLD 29 RESISTELECTRICITY 30 RESISTFIRE 31 RESISTMAGIC 32 RESURRECT 33 SAVEVSDEATH 34 SAVEVSWANDS 35 SAVEVSPOLY 36 SAVEVSBREATH 37 SAVEVSSPELL 38 SILENCE 39 SLEEP 40 SLOW 41 SPARKLE 0x2A SPELLMEMORIZATIONMAGE 0x2B STONETOFLESH 0x2C STR 0x2D STUN 0x2E UNSTUN 0x2F VISIBLE 0x30 VOCALIZE 0x31 WIS 0x32 SINGLECOLORPULSEALL 0x33 COLORTINT_SOLID 0x34 COLORLIGHT_SOLID 0x35 ANIMATION_CHANGE 0x36 THAC0 0x37 SLAY 0x38 ALIGNMENTREVERSAL 0x39 ALIGNMENTCHANGE 0x3A DISPELEFFECTS 0x3B SKILLSTEALTH 0x3C CASTINGFAILURE 0x3D Efect: 0x3D 0x3E SPELLMEMORIZETIONCLERIC 0x3F INFRAVISION 0x40 INFRAVISIONOFF 0x41 BLUR 0x42 TRANSCULENT 0x43 SUMMON 0x44 UNSUMMON 0x45 NONDETECTION 0x46 ENDNONDETECTION 0x47 SEXCHANGE 0x48 AICHANGE 0x49 DAMAGEMOD 0x4A BLINDNESS 0x4B CUREBLINDESS 0x4C FEEBLEMINDEDNESS 0x4D CUREFEEBLMINDEDNESS 0x4E DISEASE 0x4F CUREDISEASE 0x50 DEAFNESS 0x51 CUREDEAFNESS 0x52 SETAISCRIPT 0x53 IMMUNITYTOPROJECTILE 0x54 RESISTMAGICFIRE 0x55 RESISTMAGICCOLD 0x56 RESISTSLASHING 0x57 RESISTCRUSHING 0x58 RESISTPIERCING 0x59 RESISTMISSILE 0x5A SKILLLOCKPICKING 0x5B SKILLTRAPS 0x5C SKILLPICKPOCKET 0x5D FATIGUE 0x5E INTOXICATION 0x5F SKILLTRACKING 0x60 LEVEL 0x61 STREXTRA 0x62 REGENERATION 0x63 DURATIONMOD 0x64 PROTECTIONFROMCREATURE 0x65 IMMUNITYTOEFFECT 0x66 IMMUNITYTOSPELLLEVEL 0x67 NAME 0x68 XP 0x69 GOLD 0x6A MORALEBREAK 0x6B PORTRAIT 0x6C REPUTATION 0x6D HOLD_CREATURE 0x6E RETREAT_FROM 0x6F CREATE_WEAPON 0x70 DESTROY_WEAPON 0x71 EQUIP_WEAPON 0x72 DITHER 0x73 DETECT_ALIGNMENT 0x74 DISPEL_INVISIBLE 0x75 SHOW_AREA 0x76 SHOW_CREATURES 0x77 MIRROR_IMAGE 0x78 IMUNITY_TO_WEAPON 0x79 VISUAL_ANIMATION_EFFECT 0x7A CREATE_ITEM 0x7B DESTROY_ITEM 0x7C TELEPORT 0x7D KNOCK 0x7E MOVEMENT_RATE 0x7F RANDOM_SUMMON 0x80 CONFUSION 0x81 NON_CUMULATIVE_AID 0x82 NON_CUMULATIVE_BLESS 0x83 NON_CUMULATIVE_CHANT 0x84 NON_CUMULATIVE_DRAW_UPON_HOLY_MIGHT 0x85 NON_CUMULATIVE_LUCK 0x86 PETRIFICATION 0x87 POLYMORPH 0x88 FORCE_VISIBLE 0x89 NON_CUMULATIVE_CHANTBAD 0x8A SETSEQUENCE 0x8B DISPLAYSTRING 0x8C CASTINGGLOW 0x8D VISUALSPELLHIT 0x8E PORTRAITICON 0x8F REPLACE_ITEM 0x90 DISABLE_BUTTON 0x91 DISABLE_SPELLTYPE 0x92 CAST_SPELL 0x93 LEARN_SPELL 0x94 CAST_SPELL_POINT 0x95 IDENTIFY 0x96 DETECTTRAPS 0x97 REPLACESELF 0x98 PLAYMOVIE 0x99 SANCTUARY 0xAE Make Sound /DLG10 c 8 Signature i32 1 PhraseCount j32 DLGPhrase=@ PhraseOffset i32 1 ResponseCount j32 DLGResponse=@ ResponseOffset j32 DLGStrings=@ CondOffset i32 1 CondCount j32 DLGStrings=@ RespCondOffset i32 1 RespCondCount j32 DLGStrings=@ ActionOffset i32 1 ActionCount /DLGPhrase i32 1 TLKIndex i32 1 FirstResponse i32 1 ResponseCount i32 1 Cond /DLGResponse t32 0 Flags i32 1 TLKIndex i32 1 JournalIndex i32 1 Cond i32 1 Action sc 8 Dlg i32 1 DlgPhrase /DLGStrings d 1 offset i32 1 length /WAVC10 c 8 signature d 1 ResDataOrigSize d 1 ResDataCmprSize d 1 ResDataOffset w 2 Unknown d 1 Unknown /WED13 c 8 signature i32 1 overlay count i32 1 door count j32 WEDOverlay=@ overlay offset j32 WEDOffsets=@ offsets offset j32 WEDDoor=@ door offset d 1 door tile cell indexes offset /WEDOverlay i16 1 width in blocks i16 1 height in blocks c 8 resource ID d 1 unknown j32 WEDTileMap=@ tile map offset d 1 tile index lookup offset /WEDTileMap w 1 default tile start index w 1 default tile count w 1 alternate tile index t8 11111111 overlay mask b 3 unknown /WEDOffsets i32 1 wall poly count j32 WEDPoly=@ wall poly offset d 1 point offset d 1 wall group offset d 1 polygon index lookup table offset /WEDDoor c 8 id w 1 unknown w 1 first door tile cell w 1 door tile cell count w 1 open poly count w 1 closed poly count j32 WEDPoly=@ open poly offset j32 WEDPoly=@ closed poly offset /WEDPoly d 1 first point i32 1 point count b 1 passable b 1 unknown i16 1 X min i16 1 X max i16 1 Y min i16 1 Y max /WMP c 8 signature i32 1 world map count j32 WorldMap=@ world maps /WorldMap c 8 MapResName i32 1 X size i32 1 Y size i32 1 zero i32 1 unknown i32 2 zero i32 1 world map entry count j32 WMEntry=@ world map entries d 1 world map exit entries i32 1 world map exit entry count c 8 map icon res name i32 1 zero d 1 unknown d 30 unknown /WMEntry c 8 area id 1 c 8 area id 2 c 32 unknown d 1 status i32 1 BAM frame i32 1 X i32 1 Y i32 1 location name TLK index i32 1 TLK index? d 4 unknown d 4 unknown d 4 unknown d 30 unknown /CHUIV1 ;

CHUI V1

; CHUI files describe the user interface of Infinity Engine games. ; Each of these files holds definitions for several screens. ; A screen consists of a background picture (stored in MOS format) ; and several controls (buttons, scrollbars, edit boxes etc.) The ; control graphics are stored in BAM format.

c 8 Signature ; CHUIV1 d 1 screen count j32 CHUIcindex=@ control index offset j32 CHUIscreen=@ screen offset /CHUIscreen w 1 window ID w 1 unknown i16 1 X i16 1 Y i16 1 width i16 1 height i16 1 has background? i16 1 control count c 8 background MOS name i32 1 first control /CHUIcindex j32 CHUIcontrol=@ control offset d 1 size /CHUIcontrol w 1 control ID w 1 text buffer length i16 1 X i16 1 Y i16 1 width i16 1 height ctype: i8 1 control type i8 1 unknown #IF ctype==0 ; button/toggle button/pixmap c 8 BAM name w 1 BAM cycle w 1 up frame w 1 down frame w 1 selected frame w 1 disabled frame #ELSEIF ctype==2 ; slider c 8 MOS background c 8 BAM slider knob w 1 BAM cycle w 1 slider ungrabbed frame w 1 slider grabbed frame w 8 unknown #ELSEIF ctype==3 ; text edit c 8 MOS 1 c 8 MOS 2 c 8 MOS 3 c 8 BAM cursor name w 6 unknown c 8 BAM font name 2 w 20 unknown #ELSEIF ctype==5 ; text area c 8 BAM font name c 8 BAM font name 2 b 4 color 1 b 4 color 2 b 4 color 3 w 1 ID of attached scrollbar w 1 unknown #ELSEIF ctype==6 ; edit/static text d 1 initial value strref c 8 font BAM name b 4 color 1 b 4 color 2 w 1 unknown #ELSEIF ctype==7 ; scrollbar c 8 BAM name w 1 BAM cycle w 1 up arrow unpressed frame w 1 up button pressed frame w 1 down button unpressed frame w 1 down button pressed frame w 1 background frame w 1 thumb frame w 1 ID of attached text field w 1 unknown #FI #FI #FI #FI #FI #FI /'CHUIControlType 0 button 1 screen 6 edit 7 scrollbar /KEYHdr c 8 signature i32 1 BIFF count i32 1 file count j32 KEYBIFF=@ BIFF offset j32 KEYFile=@ file offset /KEYBIFF i32 1 BIFF length i32 1 name offset i16 1 name length t16 0 CD mask /KEYFile c 8 name i16 1 file type i16 1 index i16 1 BIFF