Format of monsters (as stored on disk) ====================================== This is the monster format as stored on disk. Format in memory during an encounter is a modified form, using the on-disk format as a template. Monsters have a fixed size 66 byte header, covering offsets 0x0 - 0x41. Following this is various strings such as death message and monster name. After that comes any weapons the monster has. Then finally is the monster-specific code (actual 6502 code). All pointers assume that monster code is loaded at 0xaa00 (this is not true for monsters in memory during an encounter). All pointers are little endian unless otherwise specified. Byte 0: Max number of monsters that may appear Bytes 1-2: pointer (points to monster name) Bytes 3-4: pointer ?? Bytes 5-6: pointer ?? Bytes 7-8: pointer ?? Bytes 9-a: pointer ?? Byte b: Unknown (May be treasure type bitset?) Byte c: Base alignment (may be modified by onload code) Byte d: Unknown (low integer for most monsters, except FBI agent and Great Wyrm) Byte e: Monster level (??) Byte f: Unknown (Integer, typically 20, 30, 40. Has value 255 for some special monsters) Byte 10: Unknown (Integer, typically 20, 30, 40. Has value 200 for devourer and assassin. May be surprise ability) Bytes 11-12: "On load" code. Either pointer to code to execute before processing monster, or an integer specifying preset code. Bytes 13-14: Unknown code pointer. Devourer, thief, assassin and champion are the only ones with this. Bytes 15-16: "Pre-fight" code pointer. Executed before battle begins. Such as pauper's message, and the knight's "Yield the passage" request. Bytes 17-18: Unknown code pointer. May be related to behaviour on hail/offer Bytes 19-1a: Unknown code pointer. May be related to behaviour on hail/offer Bytes 1b-1c: "On death" code pointer. Any special action/message when monster dies. All monsters have a death message, but some (like sage, pauper, healer) also take an action on death. Byte 1d: ID for picture to use (low integer) Byte 1e: Unknown (Another monster level? Mostly 1-4 for most monsters. 7 for basilisk, 8 for great wyrm) Byte 1f: Unknown (Integer, typically 0, 30, 40. 0 for FBI agent, 255 for great wyrm, 99 for basilisk) Byte 20: Unknown (Looks like flags. Value 0 for many monsters) Byte 21: Unknown (More flags. 128+32 set for most monsters) Bytes 22-23: Base hit points. Actual hit points may be up to twice this (I think) Bytes 24-2a: Monster stats in order: Stamina, Charisma, Strength, Intelligence, Wisdom, Skill, Speed. Bytes 2b-36: Maximum treasure drops in order: Food, Water, Torch, Timepiece, Compass, Key, Crystal, Gem, Jewel, Gold, Silver, Copper. Bytes 37-41: Armor ratings in order: Blunt, Sharp, Earth, Air, Fire, Water, Power, Magic, Good, Evil, Cold 0xff = invulnerable. 0xf0 = absorbs power from this damage type. 0x0f = takes double damage from this damage type. Following this is the monster data.