*******************************************************Master_of_Magic_Editor by Nirran***************************************************************

place MasterOfMagicEditor.exe in current MoM folder

*******************************************************************************Text File Format*****************************************************************************

-------------------------------------------------------------------------------[ITEM POWERS]--------------------------------------------------------------------------------
" +1 Attack"          ,                  01111111,                  00000000,                  50,          0,                   1,  00000000,  00000000, 00000000,   00000000;
 name                 ,Enchantable on - Table one,Enchantable on - Table two,Mana cost to enchant,Table Three,Required Spell Books,Table four,Table five,table six,Table seven:
                                                                                                              if a Stat special, 
                                                                                                              it's the Stat bonus
Tables 1 2 4 5 6 and 7 are binary flag bits,they are set as follows :
This is the order of the flags:

	        00110100
	        |      |
	  flag #8       flag #1

If a flag is set (1) it is true.

If a flag is not set (0) it is false.

Table one :
(1) -> Can be enchanted on a shield
(2) -> Can be enchanted on Misc items
(3) -> Can be enchanted on a Wand
(4) -> Can be enchanted on a Staff
(5) -> Can be enchanted on a Bow
(6) -> Can be enchanted on a Axe
(7) -> Can be enchanted on a Mace
(8) -> Can be enchanted on a Sword

Table two :
(1) - (6) - > Unused
(7) -> Can be enchanted on Plate armor
(8) -> Can be enchanted on Chain armor

Table Three :
Value	Description
0	+ to Attack Stat Bonus
1	+ to Hit Stat Bonus
2	+ to Defend Stat Bonus
3	+ to Spell Skill Stat Bonus
4	- to Spell Save Stat Bonus
5	+ to Movement Stat Bonus
6	+ to Resistance Stat Bonus
7	Nature Specials
9	Nature Specials
264	Sorcery Specials
265	Sorcery Specials
521	Chaos Specials
777	Life Specials
1033	Death Specials

Table four :
(1) -> Path Finding
(2) -> Regeneration
(3) -> Wraithform
(4) -> Destruction
(5) -> Cloak_of_Fear
(6) -> Lightning
(7) -> Guardian_Wind
(8) -> Vampiric

Table Five :
(1) -> Invisibility
(2) -> Haste
(3) -> Edurance_1
(4) -> Stoning
(5) -> Chaos
(6) -> Elemental_Armor
(7) -> Resist_Elements
(8) -> Water_Walking

Table six :
(1) -> Phantasmal
(2) -> True_Sight
(3) -> Holy_Avenger
(4) -> Flaming
(5) -> Magic_Immunity
(6) -> Resist_Magic
(7) -> Flight
(8) -> Death

Table seven :
(1) -> Invulnerability
(2) -> Righteousness
(3) -> Merging
(4) -> Planar_Travel
(5) -> Giant_Strength
(6) -> Lion_Heart
(7) -> Bless
(8) -> Power_Drain
[END]

-------------------------------------------------------------------------------[BUILDINGS]-------------------------------------------------------------------------------
"City Walls"          ,                 32,               0,                    -1,            0,            0,               0,            -2,             0,      0,      0,        0,      0,       150,      0,     -1,      4;
 name                 ,Building Req One   ,Building Req Two,building this replaces,Units Start  ,Units Start  ,    Units Start ,Upkeep cost   ,food/pop bonus,Unknown,Unknown,Mana/Turn,Unknown,Build Cost,Unknown,Unknown,Unknown: 
                       for this to be built                                        W/ Regular XP,W/ Veteran XP,w/ magic weapons,Negative Value,
                      See Building Table                                            1 for true   ,1 for true   ,1 for true      ,
                      
[END]

-------------------------------------------------------------------------------[SPELLS]-------------------------------------------------------------------------------
"Spell of Return"     ,      0,      0,      5,      0,      5,      5,      0,        1000,           20,          10,      0,      0,      0,      0,      0;
 name                 ,Unknown,Unknown,Unknown,Table 1,Table 2,Table 3,Unknown,Casting Cost,Research Cost,Sound Effect,Unknown,Table 4,Unknown,Unknown,Unknown;


Table 1: Section in spell book

00	Special Spells		
01	Summoning			
02	Enchantment		
03	City Spells
04      Unit Spells
05	Combat Spells

Table 2: Magic realm

00	Nature			
01	Sorcery			
02	Chaos			
03	Life
04	Death
05	Arcane

Table 3: Casting eligibility

254	Combat only
255	Combat only
 00	Combat or overland, overland cost 5x combat cost
 01	Overland only
 02	Combat or overland, overland cost 5x combat cost
 03	Combat or overland, overland cost 5x combat cost, friendly city only
 04	Combat or overland, overland cost same as combat cost
 05	Overland only, only while banished

Table 4: Summon Unit Code

<TODO>

[END]

-------------------------------------------------------------------------------[UNITS]-------------------------------------------------------------------------------

[HER0 UNITS]     
[GENERIC UNITS]
[BARBARIAN UNITS]
[BEASTMEN UNITS]
[DARK ELF UNITS]
[DRACONIAN UNITS]
[DWARVEN UNITS]
[GNOLL UNITS]
[HALFLING UNITS]
[HIGH ELF UNITS]
[HIGH MEN UNITS]
[KLACKON UNITS]
[LIZARDMEN UNITS]
[NOMAD UNITS]
[ORC UNITS]
[TROLL UNITS]
[SUMMONED UNITS]
"Magic Spirit"        ,             5,              0,     -1,          0,           0,      4,         8,                     2,     30,      1,     15,     6,     0,      0,      0,        10,          1,                0,                 1,                0,                               0, 00000000,       0, 00000000, 00000000, 00000000,      0, 00000001, 00001100, 00000000, 00000000,      0;
Name                  ,Melee Strength,Ranged Strength,Table 1,Ranged Ammo,To Hit Bonus,Defense,Resistance,Movement(in 1/2 units),Table 2,Table 3,Table 4,Note 1,Note 2,Unknown,Unknown,Hit Points,Scout Range,# units can carry,# figures unit has,constuction speed,Special attack or bonus strength,Table 5  ,Unknown,Table 6   ,Table 7  ,Table 8  ,Unknown,Table 9  ,Table 10 ,Table 11 ,Table 12 ,Unknown;

Tables 5 6 7 8 9 10 11 and 12 are binary flag bits,they are set as follows :
This is the order of the flags:

	        00110100
	        |      |
	  flag #8       flag #1

If a flag is set (1) it is true.

If a flag is not set (0) it is false.

Table 1:  Ranged attack types

 -1	None
 10	Rock
 20	Arrow
 21	Bullet		  Slingers
 30	Chaos Magic	  Warlock, Chaos Warrior, Storm Giant
 31	Chaos Magic	  Warrior Mage, Magician, Witch, Golden One,Unknown, Magicians, Warlocks
 32	Sorcery Magic	  Sage, Illusionist
 33	Chaos Magic	  Necromancer, Shadow Demons, Demon Lord
 34	Nature Magic	  Wind Mage
 35	Nature Magic	  Healer, Priestess, Shamans, Priests
 36	Chaos Magic	  Dark Elves (Spearmen, Swordsmen, Halberdiers,Cavalry, Nightmares)
 37	Nature Magic	  Sprites
 38	Nature Magic	  Druid
100	Thrown Weapons
101	Fire Breath
102	Lightning Breath  Sky Drake
103	Stoning Gaze	  Basilisk, Gorgons
104	Multiple Gaze	  Chaos Spawn
105	Death Gaze	  Night Stalker

Table 2:
Heroes: cost to hire ---- The cost to hire a hero also determines the fame needed.  The fame level is (hire_cost - 100.) / 10. rounded down.  
Normal units: cost to build  
Summoned units: cost to place in lair, node or rampaging force ---- The cost in the unit table is not used for units summoned by a wizard. Editing the costs in the unit tables should change the average number of creatures in lairs.

Table 3:
Summoned units: upkeep cost  
Others: not used ---- The upkeep cost for heroes is ceil(hire_cost / 50.) unless the hero has the Noble attribute.  The upkeep cost for normal units is ceil(build_cost / 50.), except that the first type for each race has zero cost.

Table 4:  Race codes 

00  Barbarian				
01  Beastmen				
02  Dark Elf				
03  Draconian				
04  Dwarven				
05  Gnoll					
06  Halfling				
07  High Elf
08  High Men
09  Klackon
10  Lizardman
11  Nomad
12  Orc
13  Troll
14  Generic (ship or catapult)
15  Arcane (magic spirit)
16  Nature
17  Sorcery
18  Chaos
19  Life
20  Death

Table 5:  Movement flags 
8  Merging		
7  Mountaineer		
6  Forester		
5  Teleporting		
4  Flying
3  Swimming
2  Sailing
1  Cavalry (note 3)

Table 6:  Immunity flags 
8  Poison		
7  Death		
6  Magic		
5  Cold		
4  Illusions
3  Missiles
2  Stoning
1  Fire

Table 7:  Attribute flags 
8  Standard (note 4)	
7  Caster 40 MP	
6  Caster 20 MP	
5  Summon Demons 2	
4  Summon Demons 1
3  Lucky
2  No effect (note 5)
1  Weapon Immunity

Table 8:  Attribute flags 
8  Holy Bonus		
7  Resistance to All	
6  Cause Fear Spell	
5  Web Spell		
4  Immolation
3  Doombolt Spell
2  Fire Ball Spell
1  Healing Spell

Table 9:  Attribute flags 
8  Create Undead	
7  Invisibility	
6  Create Outpost	
5  Healer		
4  Wall Crusher
3  Plane Shift
2  Large Shield
1  Summoned unit (note 6)

Table 10:  Attribute flags 
8  Negate First Strike	
7  Purify		
6  Regeneration	
5  Wind Walking	
4  Non Corporeal
3  Meld With Node
2  Land Corruption (note 7)
1  Long Range

Table 11:  Special attack flags 
8  Stoning Touch	
7  Illusionary attack	
6  Destruction		
5  Automatic Damage	
4  Life Stealing
3  Poison attack
2  First Strike
1  Armor Piercing

Table 12:  Special attack flags 
8  No effect		
7  No effect		
6  No effect		
5  No effect		
4  Dispel Evil
3  Power Drain
2  Death Touch
1  No effect

Note 1:
Normal units: 1st building requiered ---- Building Table
Summoned Units: always 6 
Hero Units: unique to each hero.

Note 2:
Normal units: 2nd building requiered ---- Building Table
Hero units: artifact slot type  ---- 00 sword/shield/ring, 01 bow/shield/ring, 02 mixed/shield/ring,	03 wand/ring/ring.

Note 3: This bit is set for all cavalry type units.  Its effect is unknown.

Note 4: This bit causes the race name to be listed before the unit name on the unit display window.  It has no effect on heroes.

Note 5: This bit is set for all flying units, but clearing it has no apparent effect on the unit.

Note 6:This bit is set for all summoned units. It controls  
a) whether upkeep is in mana or gold+food.
b) whether certain spells can be cast on the unit (clearing this bit for a summoned unit allows you to cast Heroism, Holy Weapon etc. on the unit).
c) whether the unit can gain experience.  

Note 7:Setting this bit puts "Land Corruption" on the unit's display.  
There is a help window for land corruption, but the ability does not work
as stated in the window.  Probably the program code for the land corruption ability has been removed.

[END]

-------------------------------------------------------------------------------[RACE DATA]-------------------------------------------------------------------------------
"Barbarian"           ,                 3,               20,               10,               25,                0,                0,                0,                0,                     15,                   2,                                                            0;
Race Name             ,Banned Buildings #,Banned Building 1,Banned Building 2,Banned Building 3,Banned Building 4,Banned Building 5,Banned Building 6,Banned Building 7,Outpost Growth % Chance,City Growth Modifier,Housing picture (0 wood frame house, 1 tree house, 2 mud hut);
                       See Building Table 

[END]

-------------------------------------------------------------------------------[ENCHANTMENT UPKEEP COSTS]-------------------------------------------------------------------------------
"Immolation"          ,                 2;
Spell Name            ,Mana Cost per Turn;

[END]

Building Table

-1	None
0	None
3	Barracks
4	Armory
5	Fighters Guild
6	Armorers Guild
7	War College
8	Smithy
9	Stables
10	Animists Guild
11	Fantastic Stable
12	Shipwrights Guild
13	Ship Yard
14	Maritime Guild
15	Sawmill
16	Library
17	Sages Guild
18	Oracle
19	Alchemists Guild
20	University
21	Wizards Guild
22	Shrine
23	Temple
24	Parthenon
25	Cathedral
26	Marketplace
27	Bank
28	Merchants Guild
29	Granary
30	Farmers Market
31	Foresters Guild
32	Builders Hall
33	Mechanicians Guild
34	Miners Guild
35	City Walls
101	Forest Terrain
110	Water Terrain
200	Mineral Terrain Specials

