Darklands enemy definitions
Files with this format: "darkland.enm
".
Contains definitions for all enemies (people and creatures).
Table of Contents
Offsets
Structures
Offsets
-
0x00
: enemy_types: array[ 71 ] of struct enemy_type (each size 0xcc)
- Definitions of the types of enemies.
- TODO: Is this 71 (and the following 82) stored anywhere?
-
0x3894
: enemies: array[ 82 ] of struct enemy (each size 0x18)
- Definitions of the enemies.
Structures
Size 0xcc.
Definition of a type of enemy.
-
0x00
: enemy_image: string(4) (enum nullimage_group) (null-delimited)
-
Three characters followed by a null; 'E??' for humans, 'M??' for monsters.
-
0x04
: type_name: string(10)
- Internal name.
- TODO: verify this is completely internal and not referred to elsewhere?
- Variants are labelled "Sergeant1", "Sergeant2", etc. These numbers are the reverse of the cluebook's "type" designations; ie, "Sergeant1" is type "E" (weakest), "Sergeant5" is type "A" (strongest).
-
0x0e
: num_variants: byte
- For the first instance of a type (say, 'Sergeant1'), this contains the number of variants.
- Variants after the first contain the value 0xff.
-
0x0f
: palette_count: byte
- Number of usable palettes in enemypal.dat.
-
0x10
: unknown byte
- Ranges from 1-3; 1 is the most common value.
-
0x11
: palette_start: byte
- Starting palette index in enemypal.dat.
-
0x12
: unknown word
-
0x14
: attrs: struct attribute_set (size )
- Attributes (both current and maximum).
-
0x1a
: skills: struct skill_set (size )
- Skills.
- For a given enemy, all melee weapon skills are equal, and all missile weapon skills are equal.
- All non-weapon skills are 0x14 (20).
-
0x2e
: unknown byte
- Ranges from 0x08-0x14.
- Since the range is a tolerable attribute/skill value, maybe this is related?
-
0x2f
: byte [constant: 0x00]
-
0x30
: unknown byte
- Most are 0, except: skeletons/gnome/giant gnome (0x2b), vulcan (0x40), hellhound (0x01), both dragons (0x20).
- Underground related?
-
0x31
: unknown byte
- Ranges from 0-2, most are 0. Gargoyle is the only 2.
-
0x32
: unknown (0x42 bytes)
-
This looks like the probabilities of the enemy carrying each of the types of potions.
The size of the structure equals the number of potions (times three), and the values are only non-zero for evil alchemists, monks, and one variety of dwarves.
-
They appear in triplets (0x0a,0xf8,0x19 for evil alchemist) with the first number around 10, the second around 250, and the third around 25.
-
If the first byte is zero, the second is usually positive; if not, it's negative.
-
The third number in the triplets is 0x19 (25), 0x23 (35), or 0x2d (45). Must be the quality.
-
0x74
: unknown (0x1e bytes)
-
Maybe the odds of carrying components?
Non-zero for evil alchemists, monks, and one variant of dwarves, but also for witches, templars, demon princes, a dragon, and Baphomet.
-
If combined with the preceding unknown triplets, it makes 32 triplets in all.
-
0x92
: unknown (0x2 bytes)
- Generally increasing, getting up to 0x5b for Baphomet.
-
0x94
: vital_type: byte
- Item type of the vital armor worn.
- 0xff if no armor is worn (ditto for future 'type' values).
-
0x95
: limb_type: byte
- Item type of the limb armor worn.
-
0x96
: armor_q: byte
- Quality of the armor worn.
- Both vital and leg armor have the same quality.
- If no armor is worn, this is the 'effective' armor class of the creature.
-
0x97
: unknown byte
- 0x5f, 0x60, 0x61, or 0xff.
-
0x98
: shield_type: byte
- Item type of the shield worn.
-
0x99
: shield_q: byte
- Quality of the shield worn.
- This is 0x19 even if it is a creature that carries no shield.
-
0x9a
: unknown (6 bytes)
-
0xa0
: unknown (6 bytes)
- This really looks a lot like the next block... almost.
-
0xa6
: weapon_types: array[ 6 ] of byte
- Possible types of weapons that might be carried.
- This doesn't *quite* correlate with the hint book, but comes so close that it's probably what it is.
-
0xac
: weapon_q: byte
- Quality of the weapon wielded.
- If the creature doesn't use a weapon, this is the 'effective' weapon quality.
- Not sure where other weapon factors (penetration, damage) are.
-
0xad
: unknown (0x0b bytes)
-
0xb9
: unknown (0x13 bytes)
- Looks like a byte followed by a bunch of word values
- Mostly zero or low values, with occasional 0xffff (-1) values.
Size 0x18.
Definition of an enemy.
-
0x00
: enemy_type: word
- The type of enemy.
-
0x02
: name: string(12)
- Name.
-
0x0e
: unknown (8 bytes) [constant: all 0x00]
-
0x16
: unknown word
- There are only a few distinct values: 0, 1, 3, 7, 0x3f, 0x4f, and 0x81. Bitmask?
- For a given enemy type, this value is always the same.