Author: Brian Herlihy (http://www.dynamicdiscord.com/ar) Last update: Jan 31 2008 Items have a fixed 6 byte header. For examples, we will use the following items (among others): Strength spell: 81 44 00 00 00 0f (Header) 53 74 72 65 6e 67 74 68 00 (Name) 84 ff 84 01 68 01 0d f0 00 91 5b 00 01 00 19 00 (Effect) 84 00 04 01 01 00 0d f0 00 81 5b 00 01 00 19 00 (Effect) ec 00 04 53 74 72 65 6e 67 74 68 00 35 30 26 32 (Effect) 00 04 00 01 10 (Attributes) Razor Ice: 03 24 00 00 07 10 (Header) 52 61 7a 6f 72 20 49 63 65 00 (Name) 00 ff 00 00 27 00 00 00 00 00 00 00 00 18 00 00 20 20 90 50 (Attributes) OBJECT TYPE AND FLAGS ===================== The Strength spell is object type 1, and the Razor Ice is object type 3. Items in the user's inventory have the 0x80 flag set in the object type byte (?? true or not ??). Other flags exist too. The known object types are: 0x0 - Cards, Scrolls, Wands, other charged magic items 0x1 - Spell 0x2 - Ammo 0x3 - Weapon 0x4 - Armor 0x5 - Apparel 0x6 - Potions 0x7 - Special items (Golden Apple, Amethyst Rod, Loadstone, PAC Card, Staff piece, Silver Key, ... ) The following item type bytes have been observed, and are probably the result of flags: 8 - Wand 14 - Potion of Cleansing (special effect 0x81) 16 - Card, scroll, six pack, Saurian brandy, Holy hand grenade, Horns, Tomes, Eyes 22 - Potion with custom effects 24 - Scroll with special effect (Renewal, Whetstone, Remove curse) OTHER HEADER BYTES ================== Byte 2 of the header is the full object length, including the 6 byte header. Byte 3 of the header is unknown Byte 4 of the header is alignment requirement. Evil weapons have 0x7f or below, Good weapons have 0x80 or greater. Neutral weapons typically have 0x00 here. Byte 5 of the header is weight. Byte 6 of the header is an offset from the start of the object to the start of the effects/attributes region. OBJECT NAME =========== The object name begins immediately following the header, and is null terminated. The name length can also be derived from byte 6 of the header. EFFECTS AND ATTRIBUTES ====================== A starting byte of 0x00 indicates attributes, which are always last. Any other starting byte indicates an effect of some type. All effects are 16 bytes long, allowing them to be easily skipped to reach the attributes. Strength spell: 84 ff 84 01 68 01 0d f0 00 91 5b 00 01 00 19 00 This sets a timer for 0x68 to substract 0x19 from stat at 0x5b (strength) 84 00 04 01 01 00 0d f0 00 81 5b 00 01 00 19 00 This immediately increases strength by 0x19 (stat at 0x5b) ec 00 04 53 74 72 65 6e 67 74 68 00 35 30 26 32 This creates a tag "Strength" to appear in effects. Garbage follows the null terminator. 00 04 00 01 10 Spell attributes. Effects will be discussed in detail below. First we look at attributes, which vary in length for each object type. SPELL ATTRIBUTES ================ Temporal Fugue: 00 0a 2b 04 ff (10 to cast, 4 backfire, skill 43%) Healing: 00 0a 4e 05 17 (10 to cast, 5 backfire, skill 79%) Slay Evil: 00 05 32 05 1a (5 to cast, 5 backfire, skill 50%) 2nd byte of spell attributes is casting cast 3rd byte of spell attributes is the player's skill in that spell. 4th byte is backfire penalty 5th byte is some kind of spell identifier. It's different for every spell. WEAPON ATTRIBUTES ================= Crossbow [03]: 00 03 03 00 2a 00 00 00 00 00 00 00 00 00 10 10 40 40 1f 00 Razor Ice: 00 ff 00 00 27 00 00 00 00 00 00 00 00 18 00 00 20 20 90 50 2nd byte is ammo type for ranged weapon, or 0xff for melee weapons/shields. 3rd byte is remaining ammo (also reflected in item name). 0x00 for melee weapons/shields. Following 11 bytes are damage types, represented as dice. Eg, 0x2a = 2d10, 0x53 = 5d3 Blunt Sharp (2d10 for crossbow using normal quarrels, 2d7 for razor ice) Earth Air Fire Water Power Magic Good Evil Cold (1d8 for razor ice) 15th byte is minimum strength (?) 16th byte is minimum dexterity (aka skill) (?) 17th byte is current hit points of weapon (durability remaining before breakage) 18th byte is maximum hit points of weapon (durability) 19th byte contains many bits, some known some unknown. Low 3 bits define the message used when hitting with this weapon (mask 0x7) Next 2 bits define bonus to hit (mask 0x18) Remaining 3 bits are unknown (bits 0x20, 0x40, 0x80), but one may be 2-handed. 20th byte is parry value (0x50 for razor ice, 0x00 for crossbow) 19th byte Weapon attack messages table (these differ for monsters): 0x00 - hack/slash 0x01 - poke/stab 0x02 - bash/wallop 0x03 - spear/impale 0x04 - whip/lash 0x05 - blast 0x06 - punch/whomp 0x07 - hit Monster attack messages (codes unknown as of now): claws kicks bites tears chokes lashes burns stings rips stomps gnaws rends asphyxiates wallops fries stings Ammo type table: 0x1 - Guild ring 0x2 - Unknown ?? 0x3 - Quarrels (for crossbow) 0x4 - Pulse rifle 0x5 - Beam weapon 0x6 - Gauss rifle AMMO ==== Ammo has all the damage attributes of weapons as well as ammo type and quantity, but no more. Examples: Flame Quarrels [10] 00 03 0a 00 2a 00 00 24 00 00 00 00 00 00 sharp: 2d10 fire: 2d4 Total Damage: 4-28 Thunder Quarrels [10] 00 03 0a 00 2a 00 00 00 00 18 00 00 00 00 sharp: 2d10 power: 1d8 Total Damage: 3-28 ARMOR ===== Armor has damage attributes as well as hit points, and armor location (head, body, arm, legs). Examples: Crystal Breastplate 00 01 34 34 12 12 12 12 11 12 12 12 34 ff ff Leather Leggings 00 03 23 22 00 00 11 00 00 00 00 00 00 23 28 0x0 - Helmet 0x1 - Body armor (crystal breastplate) 0x2 - Arm 0x3 - Leg (leather leggings) Followed by blunt, sharp, etc etc same as weapons. The format of protection values is not fully understood. Leather gives only blunt, sharp and fire damage. Crystal and truesilver protect against all attack types to varying degrees. APPAREL ======= White Cotton Robe 00 01 02 White Cotton Tunic 00 02 02 Brown Cotton Breeches 00 02 03 Green Cotton Skirt 00 02 03 Flowing Purple Cape 00 0a 03 Blue Woolen Sweater 00 05 0f Heavy Leather Jacket 00 0f 0f Some of the D&P merchandise. Apparently the 2nd byte is dapper value, and 3rd byte is warmth value. No body location is stored in these, so you can wear whatever you want, wherever you want :) Many apparel items have special effects, such as Morgana's Tiara and the Snowshoes. POTIONS ======= FIXME: Nothing here yet MISCELLANEOUS ITEMS =================== PAC card 88 ff 04 01 01 00 00 00 00 e1 88 00 01 00 01 00 - 00 02 01 Reforged Ring 88 ff 01 00 ee 02 ee 02 00 03 99 00 01 00 ff 00 - 88 00 01 00 d0 02 dc 05 00 91 85 00 01 00 01 00 - 88 ff 01 00 ee 02 ee 02 00 03 4d 00 07 08 00 00 - 00 02 02 Goblin Ring Half 00 02 03 Troll Ring Half 00 02 04 Staff Piece 00 02 06 Silver Key 00 02 07 Bloodstone 88 ff 01 00 dc 05 dc 05 00 02 45 00 01 00 ff 00 - 00 02 08 Amethyst Rod 88 ff 44 01 04 00 dd fa 00 d1 88 00 01 00 fd 00 - 88 00 04 01 01 00 00 00 00 e1 88 00 01 00 02 00 - 00 02 ff Nothing much to see here.. some of these items have effects. The special ones appear to have an identifier, which is presumably read by the corresponding code to identify that item. All staff pieces appear to have the same attributes. Not sure what items 00 and 05 may be. EFFECTS ======= The most complex part of objects. Byte 1 marks an effect as an effect, rather than an attribute. If byte 1 matches 0xe0 or 0f0 (eg 0xeb, 0xec) then it's a text description. The low bits say where to put the description. Byte 3 is trigger, as with other effects Description locations: 0x1 = Diseases 0xb = Curses 0xc = Active Magic The remainder of the effect is a null-terminated string of up to 13 bytes length. If string is 13 bytes it won't be null terminated (?? verify this) Effect triggers (byte 3): 0x1 = pickup 0x2 = drop 0x4 = use 0x8 = unuse 0x10 = ??? 0x20 = alignment check 0x40 = drain charge 0x80 = set timer Byte 4 is repetitions. 0x00 means "forever". Most effects repeat once only. Bytes 5-6 and 7-8 are little endian timers. 5-6 are "time until effect takes place" 7-8 are "time between each repetition of effect" If the effect does not repeat (byte 4 = 0x01) then 7-8 often have silly values such as 0xf00d, 0xfeed, 0xdead, 0xdeaf. Byte 9 is unknown. Byte 10 is the "action", and byte 10 is the argument. Action 0x81 is "increase" and action 0x91 is "decrease. For these actions, byte 11 is a memory location (relative to something?). Byte 12 is unknown. Byte 13 is "number of steps", usually 1. This allows effects to modify multiple memory locations. Byte 14 is "step size". Example follows below. Byte 15 is the value to increase/decrese/set by/to. Byte 16 is unknown. Protection spell: 84 00 04 01 01 00 0d f0 00 81 a6 00 0b 01 04 00 This says to start at 0xa6, and increment 0xb locations, stepping by 1 byte each time. The value to increment by is 4. So the protection spell increases all 11 defence values by 4 points. For comparison, the High Priestess card does the same but by 6 points. High Priestess card: 88 00 44 01 01 00 00 00 00 81 a6 00 0b 01 06 00 The shield spell protects against blunt and sharp only, and only 3 points. Shield spell: 84 00 04 01 01 00 0d f0 00 81 a6 00 02 01 03 00 Many effects use a step size of 0x8 or 0x10 to modify stats such as strength, wisdom etc. Table of memory locations for 0x81 and 0x91 0x00 => 'bare hand damage', 0x45 => 'hit points', 0x4a => 'stamina (saurian brandy)', 0x4b => 'stamina', 0x52 => 'charisma (tome of leadership)', 0x53 => 'charisma (spell/potion)', 0x5a => 'strength (trump card)', 0x5b => 'strength (spell/potion)', 0x62 => 'intelligence (tome of knowledge)', 0x63 => 'intelligence (potion)', 0x6a => 'wisdom (tome of understanding)', 0x72 => 'skill (trump card)', 0x73 => 'skill aka dexterity (spell/potion)', 0x7b => 'speed', 0x81 => '?? (stealth suit)', 0x82 => '?? (elven cloak)', 0x84 => 'luck', 0x8b => 'see secret doors', 0x8d => 'difficult to hit (shadowmeld/elven cloak)', 0x90 => 'light', 0x96 => 'drunkenness', 0x99 => '?? (potion of fruit juice)', 0x9b => 'un-tiredness', 0xa6 => 'blunt protection', 0xa7 => 'sharp protection', 0xa8 => 'earth protection', 0xa9 => 'air protection', 0xaa => 'fire protection', 0xab => 'water protection', 0xac => 'power protection', 0xad => 'mental protection', 0xae => 'good protection', 0xaf => 'evil protection', 0xb0 => 'cold protection', 0xbb => 'food packets', 0xbc => 'water flasks', 0xbe => 'crystals', 0xbf => 'keys', Example Timers: 01 b9 00 19 11 - 3 hours (185 minutes) 01 f5 00 99 64 - 4 hours (245 minutes) 01 d2 02 ad de - 12 hours (722 minutes) 01 3d 00 00 00 - 1 hour (61 minutes) 01 3e 00 00 00 - 1 hour (62 minutes) 01 e0 01 ed fe - 8 hours (480 minutes) 00 01 00 14 00 - every 20 minutes 01 3d 00 0d f0 - 1 hour (61 minutes) 01 68 01 0d f0 - 6 hours (260 minutes) Example: Reforged Ring 88 ff 01 00 ee 02 ee 02 00 03 99 00 01 00 ff 00 88 00 01 00 d0 02 dc 05 00 91 85 00 01 00 01 00 88 ff 01 00 ee 02 ee 02 00 03 4d 00 07 08 00 00 00 02 02 The reforged ring has 3 effects, all activating on pickup (3rd byte has bit 0x1 set). These effects occur "forever", indicated by 4th byte 0x00 (this is "how many times" byte). Each effect takes place around half a day after pickup (0x2ee, 0x2d0, 0x2ee minutes respectively). Two effects repeat each half day (0x2ee minutes), but the second effect repeats daily (0x5dc minutes) Byte 10 (and maybe 11 too) are the memory location to modify. The ring makes you evil, makes you more noticeable to monsters, and also erases hunger and thirst. I suspect that effect 1 is noticeability, effect 2 is evil, effect 3 is "erase bad conditions". Byte 15 is the value by which to modify. So effect 1 sets noticeability to max, effect 2 makes you more evil by 1 point, effect 3 sets hunger/thirst to 0. Note the 07 08 in effect 3. This means "start at 0x4d, and take 7 steps of distance 8". In total, 7 memory locations are modified by this.