I decided to get rid of the old "base trade priority" formula of "Spell number within realm (1-40) + 5*Modifier (integer)" and instead define a specific base priority for each spell directly so we can control it more precisely.
I'm planning to have these trade values assigned for each spell :
That means, if there are no additional modifiers (diplomacy, spells already available for research etc) then the player can trade any spell on the list for any other spell that's equal or lower priority, so basically anything that appears before it. For example you can trade Crusade (45) away to get High Prayer (43) but not Great Wyrm (48).
If you feel I misjudged the play value of any spell (especially from the AI's perspective - remember they cannot use certain spells effectively), let me know.
I'm planning to have these trade values assigned for each spell :
Code:
0 "Earth Lore 0A"
0 "None"
0 "Magic Spirit C9"
1 "Warp Wood 51"
1 "Disrupt 52"
1 "Skeletons A1"
2 "Warp Creature 59"
2 "Guardian Spirit 81"
2 "Weakness A2"
2 "Hell Hounds 54"
2 "Cloak of Fear A4"
3 "Earth to Mud 1"
3 "Holy Weapon 7C"
3 "Fire Elemental 5A"
3 "Phantom Warriors 2D"
4 "AEther Sparks 2A"
4 "Resist Elements 2"
4 "War Bears 6"
5 "Fairy Dust 7"
5 "Nature's Cures 13"
5 "Psionic Blast 32"
5 "Star Fires 7A"
5 "Summon Zombies A3"
6 "Floating Island 2B"
6 "Guardian Wind 2C"
6 "Corruption 55"
6 "Flame Blade 56"
6 "Shatter 58"
6 "Bless 79"
6 "Life Drain A7"
7 "Nature's Eye 3"
8 "Holy Armor 7E"
9 "Summoning Circle CB"
9 "True Sight 83"
10 "Call Centaurs 4"
10 "Water Walking 8"
10 "Sprites 9"
10 "Resist Magic 29"
10 "Nagas 31"
10 "Fire Bolt 53"
10 "Immolation 63"
11 "Darkness A9"
11 "Exorcise 86"
11 "Blood Lust B3"
11 "Detect Magic CE"
11 "Enchant Item CF"
12 "Focus Magic 2F"
12 "Chaos Channels 5D"
12 "Endurance 7B"
12 "Planar Travel 8A"
12 "Ghouls A6"
12 "Dispel Magic CA"
13 "Spell Lock 36"
13 "Fireball 60"
14 "Wall of Fire 57"
14 "Resurrection 85"
15 "Change Terrain 0F"
15 "Land Link 10"
15 "Confusion 2E"
15 "Vertigo 35"
15 "Healing 7D"
15 "Heroism 82"
15 "Black Sleep A5"
15 "Wraith Form B5 ->A8"
15 "Heroic Shout CD"
16 "Move Fortress 1C ->D1"
16 "Fire Giant 5C"
16 "Divine Order 87"
16 "Wall of Darkness B2"
17 "Drain Power AB"
18 "Ice Bolt 0D"
18 "Cockatrices 11"
18 "Flight 38"
18 "Mystic Surge 5E"
18 "Gargoyles 5F"
18 "Just Cause 7F"
18 "Unicorns 88"
18 "Lycanthropy AD"
19 "Blur 30"
19 "Water Elemental 37"
19 "Heavenly Light 8B - >80"
19 "Night Stalker B0"
19 "Disenchant Area CC"
20 "Web 5"
20 "Construct Catapult 0C"
20 "Giant Spiders 0E"
20 "Aura of Majesty 3B"
20 "Raise Volcano 62"
20 "Astral Gate 8B"
20 "Mana Leak AA"
20 "New : Syphon Life AF"
20 "Reaper Slash B1"
21 "Phantom Beast 3C"
21 "Chaos Spawn 67"
21 "Raise Dead 89"
21 "Exaltation 84 -> 94"
22 "Fire Storm 6B->61"
22 "Mass Healing 95"
24 "Summon Hero D0"
24 "Great Lizard 14"
24 "Iron Skin 18"
24 "Blizzard 19"
24 "Stasis 44"
24 "Lightning Bolt 5B"
24 "Prosperity 91"
25 "Cracks Call 0B"
25 "Elemental Armor 15"
25 "Counter Magic 33"
25 "Banish 40"
25 "Chimeras 64"
25 "Evil Presence B7"
26 "Invisiblity 3E"
26 "Magic Vortex 69"
26 "Possession AC"
26 "Cloud of Shadow B9"
26 "Create Artifact D3"
26 "Transmute 12"
27 "Petrify 16"
27 "Wind Walking 3F"
27 "Blazing March 66"
27 "Holy Word 96"
27 "Shadow Demons B4"
27 "Wrack B6"
28 "Earthquake 1A"
28 "Creature Binding 49"
28 "Chaos Rift 6E"
28 "Altar of Battle 92"
28 "Terror A8 -> B5"
28 "Warp Node BA"
28 "Disjunction D2"
29 "Flying Fortress 4D ->46"
29 "Angel 93"
29 "Famine BD"
29 "Dark Rituals A3 -> BE"
30 "Stone Giant 17"
30 "Regeneration 1F"
30 "Uranus Blessing 3D"
30 "Efreet 6A"
30 "Lionheart 8D"
30 "Consecration 9B"
30 "Wraiths B8"
30 "Summon Champion D4"
31 "Dispelling Wave 34"
31 "Gaia's Blessing 1D"
31 "Warp Lightning 65"
31 "Stream of Life 94 -> 84"
31 "Invulnerability 8F"
31 "Inspirations 98 -> 90"
32 "Storm Giant 41"
32 "Aether Binding 39"
32 "Doom Mastery 75 ->6C"
32 "Black Prayer AE"
33 "Summon Demon BF"
33 "Earth Elemental 1E"
33 "Earth Gate 25"
33 "Air Elemental 42"
33 "Mind Storm 43"
33 "Doom Bolt 68"
33 "Doom Bat 61 ->6B"
33 "Prayer 8C"
34 "Gorgons 1B"
34 "Spell Blast 3A"
34 "Hydra 6F"
34 "Zombie Mastery BC"
35 "Behemoth 20"
35 "Haste 46 ->4D"
35 "Incarnation 8E"
35 "Wave of Despair BB"
36 "Survival Instinct 1C"
36 "Herb Mastery 26"
36 "Great Unsummoning 4B"
36 "Chaos Surge 74"
36 "Call to Arms 99"
36 "Animate Dead C3"
36 "Holy Arms 9A"
36 "Eternal Night C5"
37 "Magic Immunity 45"
37 "Flame Strike 6D"
38 "Warp Reality 6C -> 75"
38 "Enlightenment 9D"
39 "Pestilence C4"
39 "Djinn 47"
40 "Seismic Mastery 22"
40 "Spell Ward 48"
40 "Life Force 9C"
40 "Annihilate C0"
41 "Disintegrate 70"
42 "Call Lightning 23"
42 "Mass Invisibility 4A"
42 “Supreme Light 98"
43 "Suppress Magic 4F"
43 "High Prayer 97"
43 "Final Wave C7"
44 "Great Drake 76"
44 "Death Knights C1"
45 "Entangle 21"
45 "Sky Drake 4E"
45 "Crusade 9E"
45 "Massacre C2"
48 "Great Wyrm 27"
48 "Evil Omens C6"
50 "Colossus 24"
50 "Fairy Ring 28"
50 "Meteor Storm 71"
50 "Doomsday 72"
50 "Apocalypse 73"
50 "Arch Angel 9F"
50 "Demon Lord C8"
52 "Charm of Life A0"
54 "Spell Binding 4C"
54 "Call the Void 77"
54 "Armageddon 78"
55 "Time Stop 50"
That means, if there are no additional modifiers (diplomacy, spells already available for research etc) then the player can trade any spell on the list for any other spell that's equal or lower priority, so basically anything that appears before it. For example you can trade Crusade (45) away to get High Prayer (43) but not Great Wyrm (48).
If you feel I misjudged the play value of any spell (especially from the AI's perspective - remember they cannot use certain spells effectively), let me know.