]> git.localhorst.tv Git - l2e.git/blob - original-data/monsters-format.txt
new language, new compiler
[l2e.git] / original-data / monsters-format.txt
1 **********************************************************************\r
2 Monsters\r
3 **********************************************************************\r
4 \r
5 There are 224 enemies in Lufia 2. Most of their properties are stored \r
6 in what I call the "Monster Compendium".\r
7 \r
8 -----------------------------------------------------------------------\r
9 Monster data - the "Monster Compendium"\r
10 -----------------------------------------------------------------------\r
11 \r
12 [$0B07C0 -> $0B097F]:  pointers to data at [$0B0980]\r
13                        (2 bytes, little-endian (i.e. "least significant \r
14                                                       byte first"))\r
15 \r
16                        448 bytes => 224 pointers.\r
17                        Add $0B07C0 to the pointers to find the offsets\r
18                        of the Monster Compendium "entries".\r
19 \r
20                        Example:\r
21                        [$0B07C0 -> $0B07C1]: $C0 01\r
22                        => pointer: $01C0\r
23                        => offset: $01C0 + $0B07C0 = $0B0980\r
24                        => The first Monster Compendium entry starts \r
25                           at offset [$0B0980]\r
26 \r
27 [$0B0980 -> $0B5168]:  "Monster Compendium"\r
28 \r
29                        224 entries:\r
30                        [$0B0980]:  Goblin       \r
31                        [$0B09A5]:  Armor goblin \r
32                        ...\r
33                        [$0B5087]:  Gades        \r
34                        [$0B50F1]:  Master       \r
35 \r
36 - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - \r
37 Format of the Monster Compendium entries:\r
38 - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - \r
39 \r
40    13 "name bytes"\r
41  + 20 "stats bytes"\r
42 [+  3 "gift bytes"]\r
43 [+  3 bytes for the pointer to the attack script]\r
44 [+  3 bytes for the pointer to the defense script]\r
45  +  1 "end byte" ($00)\r
46 [+  a variable number of bytes for the attack script]\r
47 [+  a variable number of bytes for the defense script]\r
48 \r
49 \r
50 ([+ ...] = optional)\r
51 \r
52 \r
53 Start offset of the Monster Compendium entry: \r
54 [+$0000]\r
55 \r
56 - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - \r
57 "Name bytes":\r
58 - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - \r
59 \r
60 [+$0000 -> +$000C] (bytes  0 -> 12):  Name of the monster\r
61 \r
62     13 characters.\r
63 \r
64     Example:\r
65     $ 52   65   64   20   A4   65   6C   6C   79   20   20   20   20\r
66      "R"  "e"  "d"  " "  "J"  "e"  "l"  "l"  "y"  " "  " "  " "  " "\r
67 \r
68 - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - \r
69 "Stats bytes":\r
70 - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - \r
71  \r
72 [+$000D]           (byte 13)       :  Level\r
73 \r
74 [+$000E]           (byte 14)       :  ???\r
75 \r
76     The use of this byte is unkown.\r
77     Encountered values:\r
78 \r
79     $36 for 'Armor goblin' and 'Regal Goblin'\r
80     $32 for all other monsters\r
81 \r
82 [+$000F]           (byte 15)       :  Battle sprite\r
83 \r
84     There are 134 enemy battle sprites ($01 -> $86)\r
85 \r
86 [+$0010]           (byte 16)       :  Palette for battle sprite\r
87     \r
88     Some examples:\r
89 \r
90     Monster:        Battle sprite number:       Palette number:\r
91 \r
92     Torrent         $4D                         $00\r
93     Mad Ent         $4D                         $01\r
94 \r
95     Red Jelly       $6E                         $00\r
96     Blue Jelly      $6E                         $01\r
97     Bili Jelly      $6E                         $02\r
98 \r
99     Tank            $7E                         $00\r
100 \r
101     !!! This doesn't mean that 'Torrent', 'Red Jelly' and 'Tank' \r
102         share the same palette (this is not the case).\r
103 \r
104 [+$0011 -> +$0012] (bytes 17 -> 18):  Max HP\r
105 \r
106     2 bytes, little-endian.\r
107 \r
108 [+$0013 -> +$0014] (bytes 19 -> 20):  Max MP\r
109 \r
110     2 bytes, little-endian.\r
111 \r
112 [+$0015 -> +$0016] (bytes 21 -> 22):  ATP\r
113 \r
114     2 bytes, little-endian.\r
115 \r
116 [+$0017 -> +$0018] (bytes 23 -> 24):  DFP\r
117 \r
118     2 bytes, little-endian.\r
119 \r
120 [+$0019]           (byte 25)       :  AGL / 2\r
121 \r
122 [+$001A]           (byte 26)       :  INT / 2\r
123 \r
124 [+$001B]           (byte 27)       :  GUT / 2\r
125 \r
126 [+$001C]           (byte 28)       :  MGR / 2\r
127 \r
128 [+$001D -> +$001E] (bytes 29 -> 30):  EXP\r
129 \r
130     2 bytes, little-endian.\r
131 \r
132 [+$001F -> +$0020] (bytes 31 -> 32):  GOLD\r
133 \r
134     2 bytes, little-endian.\r
135 \r
136 - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - \r
137 "Gift bytes":\r
138 - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - \r
139 \r
140 If there's a $03 after the EXP and GOLD bytes (=> at offset [+$0021], \r
141 it means that the enemy can drop an item. \r
142 \r
143 Format of the "gift bytes" \r
144 \r
145 $03 XX YY \r
146 (!!! this $03 is not the L2BASM opcode $03) \r
147 \r
148 $XX = the low byte of the item number \r
149 \r
150 $YY = high byte of the item number (always $00 or $01) + p \r
151 \r
152       p is a number related to the probability of getting \r
153       the item, maybe probability * 4. It's always an even number. \r
154 \r
155 Example:\r
156 \r
157 Gift bytes of the Vampire: $03 73 65 \r
158   $65 = $64 + $01 \r
159   => item number: $0173 (Bat rock) \r
160   => p = $64 = 100 = 4 * 25 \r
161      => 25 % (?) chances that a defeated Vampire \r
162         will drop a Bat rock \r