First column is the priority. Lowest avalable is chosen for research first. Additional conditions listed where applicable, except those that delay spells if the AI knows a spell of the same AI category (for example they will research Djinn later if they already have Hydra) making it redundant to research. Ignore the hex numbers and zeroes, they're obsolete but I'm not wasting my time on removing them.
Code:
0 "None" 0 0
0 "Magic Spirit C9" 20 0
0 "Spell of Return D6" 20 0
10 "Giant Spiders 0E" 420 0
20 "Lycanthropy AD" 420 0
22 "Gargoyles 5F" 420 0
25 "Sprites 9" 320 0
27 "Skeletons A1" 160 0
30 "Heavenly Light 8B - >80" 440 0
31 "War Bears 6" 320 0
32 "Ghouls A6" 380 0
33 "Nagas 31" 320 0
34 "Hell Hounds 54" 160 0
35 "Fire Bolt 53" 320 0
36 "Fire Elemental 5A" 200 0
37 "Black Sleep A5" 320 0
38 "Nature's Eye 3" 200 0
39 "Darkness A9" 320 0
40 "Confusion 2E" 320 0
45 "Wild Boars 4" 320 0
50 "Healing 7D" 320 0
60 "Web 5" 480 0
65 "Aura of Majesty 3B" 420 0
70 "Shatter 58" 440 0
80 "Wraith Form B5 ->A8" 440 0
85 "Fairy Dust 7" 320 0
90 "Heroism 82" 320 0
92 "Holy Armor 7E" 320 0
93 "Resist Magic 29" 320 0
94 "Bless 79" 320 0
95 "Just Cause 7F" 480 0
96 "Guardian Wind 2C" 200 0
97 "Blur 30" 480 0
98 "Holy Weapon 7C" 260 0
100 "Life Drain A7" 320 0
105 "AEther Sparks 2A" 260 0
107 "Earth to Mud 1" 380 0
110 Discipline 380 0
115 "Summoning Circle CB" 160 0
118 Tree of Knowledge 0 698 if Halfling or Barbarian
120 "Focus Magic 2F" 440 0
122 "Altar of Peace 8B" 1280 0
126 "Stream of Life 84" 1280 0
135 "Warp Wood 51" 320 0
140 "Land Link 10" 640 0
150 "Wall of Fire 57" 320 0
160 "Raise Volcano 62" 1280 0
170 "Corruption 55" 320 0
180 "Chaos Channels 5D" 640 0
182 "Fireball 60" 960 0
185 "Flame Blade 56" 480 0
210 "Cloak of Fear A4" 260 0
215 "Disrupt 52" 260 0
220 Mislead 480 0
230 "Phantom Warriors 2D" 320 0
240 "Summon Zombies A3" 320 0
250 "Psionic Blast 32" 380 0
260 "Star Fires 7A" 160 0
270 "Warp Creature 59" 380 0
290 "Resist Elements 2" 440 0
310 "Weakness A2" 200 67 if human plays Death
320 "Guardian Spirit 81" 200 0
470 "Floating Island 2B" 160 0
480 "Water Walking 8" 260 0
490 "Dispel Magic CA" 640 0
495 "Heroic Heart CC" 1920 0
500 "Lightning Bolt 5B" 1600 0
505 "Possession AC" 1280 0
510 "Reaper Slash B1" 1280 0
515 "New : Syphon Life AF" 1280 0
520 "Ice Bolt 0D" 1280 0
540 "Prayer 8C" 2140 0
555 "Transmute 12" 1920 0
560 "Black Prayer AE" 1600 0
565 "Water Elemental 37" 1280 0
570 "Night Stalker B0" 1920 0
580 "Fire Giant 5C" 1280 0
590 "Shadow Demons B4" 2140 121 if human plays Death
592 "Chimeras 64" 1920 0
595 "Unicorns 88" 1280 0
597 "Endurance 7B" 1280 0
600 "Cockatrices 11" 1280 145 if Focus Magic, 121 if human plays Death
602 "Summon Hero D0" 1280 0
605 "Great Lizard 14" 2140 0
610 "Aether Binding 39" 960 492 if Narcissist, 75 if human plays Life
611 Sky Fires 1920 0
612 "Mystic Surge 5E" 1280 0
615 "Cracks Call 0B" 1280 121 if human plays Life
616 "Change Terrain 0F" 960 0
617 "Construct Catapult 0C" 1600 0
618 "Flight 38" 1280 0
620 "Blood Lust B3" 960 21 if Werewolves, 75 if human plays Life
621 "Mana Leak AA" 1280 0
623 "True Sight 83" 420 0
624 "Enchant Item CF" 320 0
625 "Sanctify 8A" 960 0
626 "Vertigo 35" 640 0
628 "Immolation 63" 1280 0
629 Philosopher's Stone 1280 493 if Narcissist, 550 if Barbarian
640 "Dispelling Wave 34" 1920 121 if human plays Life
650 "Wall of Darkness B2" 1280 0
660 "Phantom Beast 3C" 1600 0
680 "Counter Magic 33" 1280 0
685 "Fire Storm 6B->61" 2800 0
690 "Raise Dead 89" 1280 0
700 "Spell Lock 36" 1280 0
721 "Evil Presence B7" 2800 0
725 "Elemental Armor 15" 3200 0
740 "Resurrection 85" 1600 0
980 "Earth Lore 0A" 160 0
1000 "Enlightenment 9D" 8000 0
1005 "Pestilence C4" 8000 0
1008 "Drought BD" 3200 0
1010 "Flame Strike 6D" 5600 0
1020 "Wave of Despair BB" 5200 0
1030 "Doom Mastery 75 ->6C" 4400 0
1040 "Incarnation 8E" 5200 0
1050 "Wraiths B8" 4800 0
1060 "Doom Bat 61 ->6B" 4000 0
1070 "Storm Giant 41" 4000 0
1080 "Efreet 6A" 5200 0
1090 "Gorgons 1B" 4800 0
1100 "Stone Giant 17" 4000 0
1110 "Angel 93" 4000 0
1115 Vampire 4400 0
1120 "Chaos Spawn 67" 3000 0
1121 "Disenchant Area CD" 320 0
1122 "Divine Order 87" 3600 1980 if Chaos or Death books
1123 "Flying Fortress 4D ->46" 2400 0
1124 "Armageddon 78" 24000 0
1125 "Survival Instinct 1C" 5200 0
1127 "Invisiblity 3E" 3600 0
1129 "Summon Champion D4" 4000 0
1130 "Cloud of Shadow B9" 3600 0
1134 "Warp Node BA" 4000 0
1135 "Dark Rituals A3 -> BE" 4000 0
1137 "Banish 40" 4000 0
1140 "Uranus Blessing 3D" 3200 630 if Narcissist
1145 "Petrify 16" 4400 562 if human plays Death
1147 "Mind Storm 43" 4800 0
1152 "Chaos Rift 6E" 2400 1035 if Maniacal
1155 "Gaia's Blessing 1D" 2400 0
1160 Abundance 3600 0
1165 "Exorcise 86" 640 121 if human plays Death
1170 "Inspirations 98 -> 90" 4800 0
1180 "Altar of Battle 92" 4400 0
1185 "Lionheart 8D" 4000 0
1187 "Spell Blast 3A" 5600 0
1188 "Detect Magic CE" 320 0
1190 "Prosperity 91" 2400 0
1195 Reinforce Magic 4000 0
1198 "Drain Power AB" 2400 0
1200 "Zombie Mastery BC" 5600 0
1210 "Wind Walking 3F" 5200 0
1215 "Air Elemental 42" 4400 0
1220 "Invulnerability 8F" 4000 0
1240 "Doom Bolt 68" 4800 0
1245 Gate of Hades 4000 562 if human plays Death
1246 "Spell Ward 48" 8000 0
1250 "Warp Lightning 65" 4000 0
1255 "Holy Arms 9A" 5600 0
1257 "Call the Void 77" 18000 0
1260 "Iron Skin 18" 4000 0
1270 "Earth Elemental 1E" 5600 0
1272 "Earth Gate 25" 10000 0
1275 Call the Wild 4000 0
1280 "Earthquake 1A" 2500 1035 if Maniacal
1285 "Terror A8 -> B5" 4000 0
1287 "Holy Word 96" 4000 562 if human plays Death
1320 "Blazing March 66" 4000 0
1330 "Magic Vortex 69" 4000 0
1340 "Exaltation 84 -> 94" 2800 0
1345 Disillusionise 4000 0
1350 "Stasis 44" 2800 0
1360 "Blizzard 19" 4000 0
1370 "Mass Healing 95" 3200 0
1380 "Disjunction D2" 6000 0
1390 "Create Artifact D3" 4000 970 if Artificer
1399 "Nature's Cures 13" 1280 0
1400 "Consecration 9B" 6000 0
1410 Inner Power 3600 684 If at least 18 units buffed
1480 "Demon Lord C8" 24000 0
1514 "Sky Drake 4E" 15000 0
1515 "Djinn 47" 15000 0
1520 "Great Drake 76" 15000 0
1530 "Colossus 24" 20000 0
1540 "Great Wyrm 27" 15000 0
1550 "Death Knights C1" 12000 0
1560 "Arch Angel 9F" 22000 0
1570 "Behemoth 20" 15000 0
1575 Phoenix 12000 0
1580 "Hydra 6F" 10000 0
1595 "Magic Immunity 45" 15000 1645 if not at war with human. 1335 if Divine Order in play or Vortex known
1600 "Spell Binding 4C" 22000 0
1603 "Planetary Mastery 22" 8000 0
1605 "Fairy Ring 28" 18000 0
1608 "Plane Shift D1" 1280 611 if RaceTo, 1118 if human has Plane shift
1610 "Power Link 4F" 18000 0
1620 "Doomsday 72" 15000 0
1635 Darkest Hour 15000 1835 if at war with human, or human is much ahead in research
1640 "Life Force 9C" 15000 0
1650 “Supreme Light 98" 18000 0
1660 "Charm of Life A0" 24000 0
1670 "Crusade 9E" 20000 0
1680 "Eternal Night C5" 18000 0
1690 "Final Wave C7" 20000 0
1705 "Apocalypse 73" 15000 0
1710 "Massacre C2" 15000 0
1711 "High Prayer 97" 15000 0
1712 "Evil Omens C6" 22000 0
1713 "Animate Dead C3" 15000 0
1715 "Call Lightning 23" 15000 0
1716 "Entangle 21" 22000 0
1718 Roots of Genesis 24000 1162 if anyone knows Armageddon
1720 "Annihilate C0" 15000 1603 if Mind Storm
1740 "Mass Invisibility 4A" 20000 0
1745 Ruler of Heaven 10000 1136 if Dark Ritual
1770 "Disintegrate 70" 12000 1602 if Mind Storm
1775 ChainLightning 20000 0
1780 Wind Mastery 15000 0
1796 "Time Stop 50" 24000 0
1797 Ruler of Underworld 10000 1695 if at war with human
1798 "Herb Mastery 26" 15000 0
1800 "Call to Arms 99" 15000 0
1810 "Chaos Surge 74" 6000 1322 if at least 200 more own chaos unit
1815 "Haste 46 ->4D" 12000 0
1820 Blazing Eyes 8000 1324 if at least 200 more own Chaos units
1825 "Warp Reality 6C -> 75" 15000 1323 if at least 200 more own chaos units and peaceful or lawful
1828 Destiny 15000 0
1830 "Meteor Storm 71" 22000 0
1850 "Regeneration 1F" 12000 0
1870 "Great Unsummoning 4B" 10000 1590 if anyone has Doom Mastery in play
1890 "Summon Demon BF" 6000 0
1900 "Creature Binding 49" 6000 0
1950 Clairvoyance 6000 If Maniacal then 1355
5000 "Spell of Mastery D5" Misc 0