It’s recommended that you take a glance at the corresponding FE7 documentation so you get a general idea of how the AI functions.
It is assumed you have read that.
AI1: Primary AI Byte
AI1 0x00 through 0x06 are all identical to the FE7 entries.
0x00 = Action 100% 0x01 = Action 80%, end turn without moving/acting 20% 0x02 = Action 50%, end turn without moving/acting 50% 0x03 = Action without moving 100% 0x04 = Action without moving 80%, end turn without moving/acting 20% 0x05 = Action without moving 50%, end turn without moving/acting 50% 0x06 = Do Nothing 0x07 = Do not attack character 0xD (Natasha, character at 5A8A00) 0x08 = Do not attack character 0xFC (character at 5A8B3C) 0x09 = Do not attack character 0x0 (character at 5A817C) 0x0A = Only attack character ??? if deployed. (currently 00 01, set it at 5A8BA4) 0x0B = Same as 0x0 0x0C = Attack if within Mov/2+Range(?) 0x0D = CHAI [0x0, 0x0] if the unit's leader has foe in range.(?) 0x0E = Heal allies under 50% HP(?) 0x0F = Alternate between 0xE and 0x3 0x10 = Pick Locks/Steal, then CHAI [0x6, 0xC] (Escape)(?) 0x11 = Pick Locks/Steal 0x12 = Do not attack character ??? (points to 00 01 00 01) 0x13 = Do not attack character ??? (points to 00 01 00 00) 0x14 = Try to use Nightmare (but not on turn one), then try to Summon Units, then act like 0x0 (AttackInRange)
AI2: Secondary AI Byte
0x04 = Loot villages/chests then change AI1 to 0x00 and AI2 to 0x00 (brigand AI)(???) 0x0A = Move to character 0x1 Eirika; once in range, alternate between pursuing enemies and pursuing character 0x01. Used by Ross in chapter 2.
AI3: Recovery and Targeting
FE8’s TP mod table is identical to the table in FE6 and FE7. Like FE7, there are no classes defined to get TP bonuses.
FE8 TP mod table: 080D8178
Pointers to class sets (all point to 00): 085A8150
The units the demon king summons are at 88D1F54, just as event assembler units.
807B2BC - number of units in that array