DivisionByZero.620: Water skill level and luck have no effect on this AFAIK.
2 years ago I was working on rebalance mods for MM6 and MM7 (using a utility called MM7View that opens and views contents of the data files).
There are spreadsheets (tables) for enchantments, and enchantments in MM7 are split into 4 grades: A, B, C, and D (A being lowest and D being highest).
If I remember properly, master-level enchant item can only produce level A enchants (the weak crap). Grandmaster level can produce anything up to and including grade C (the tier with the 2nd-level elemental damage enchants such as lightning, flames, frost, and venom). Grade D enchantments can only be found as high-level loot or bought in top-tier stores.
Holy necroposting! But here's a more in-depth explanation of enchanting, at least in MM7.
First, weapons must be mass-production (not unique or artifacts) and must be worth 250 or more. Other wearables (armor, rings, etc) must also be mass-production and worth 450 or more. If it can't be equipped, it can't be enchanted. Note that while you can easily find enchanted junk, the spell is too snooty for that.
Water skill determines chance of failure. Your success rate is 10% * level, and anything 100% or higher means guaranteed success.
Enchantments are divided into two main tiers, which I'll call "basic" and "greater". Basic enchantments improve one skill or stat by some random amount. All basic enchantments may be applied. Greater enchantments are subdivided into grades, as mentioned above. A and B are the only grades available to this spell. I assume that C can be randomly found on stuff in stores, and D is likely for the unique artifacts. Note that in my table the grades are 1 to 4 instead.
When you enchant, weapons will always get a greater enchantment. Wearables have an 80% chance to apply a basic enchantment, and of course a 20% chance of a greater enchantment. The chance of each enchantment is based on item type. There is a weighted probability attached to each enchantment and item type, as seen in the following table:
Basic (note that weapon types are represented but will never be used by the EI spell)
Name Attrib 1H 2H Missile Armor Shield Helm Belt Cloak Gauntlt Boots Ring Amulet
OfMight 74 45 80 14 5 0 10 10 10 10 5 10 10
OfThought 114 45 80 14 5 0 10 10 10 10 5 10 10
OfCharm 160 45 80 14 5 0 10 10 10 10 10 10 10
OfVigor 207 45 80 14 5 0 10 10 10 10 5 10 10
OfPrecision 251 45 80 14 5 0 10 10 10 10 5 10 10
OfSpeed 42 46 80 14 5 0 10 10 10 10 25 10 10
OfLuck 83 46 80 14 5 0 10 10 10 10 10 10 10
OfHealth 122 46 80 14 10 5 5 0 10 5 10 10 10
OfMagic 167 46 80 14 10 5 10 0 10 10 10 10 10
OfDefense 215 46 80 14 20 20 10 0 10 10 5 10 10
OfFireResistan 8 47 80 14 10 10 5 0 10 15 5 10 10
OfAirResistanc 68 47 80 14 10 10 5 0 10 15 5 10 10
OfWaterResista 126 47 80 14 10 10 5 0 10 15 5 10 10
OfEarthResista 193 47 80 14 10 10 5 0 10 15 5 10 10
OfMindResistan 4 48 80 14 10 10 5 0 10 15 5 10 10
OfBodyResistan 69 48 80 14 10 10 5 0 10 15 5 10 10
OfAlchemy 134 48 80 14 0 0 0 5 5 0 5 10 15
OfStealing 185 48 80 14 0 0 0 5 5 20 5 15 5
OfDisarming 238 48 80 14 0 0 0 5 5 20 5 15 5
OfItems 34 49 80 14 0 0 0 5 5 0 5 10 15
OfMonsters 83 49 80 14 0 0 0 5 5 0 5 10 15
OfArms 138 49 80 14 10 10 10 0 0 10 0 0 0
OfDodging 191 49 80 14 0 0 0 15 10 5 10 5 5
OfTheFist 241 49 80 14 0 0 0 5 5 20 10 5 5
Sorry for the bad formatting. I don't see any fancy table markup. Anyway, the chances don't necessarily add up to 100 but that's not the point. The probability numbers are based on the total for that column. The game will ask for a number between 0 and that total, then go down the list subtracting each probability until the number is less than the probability for that enchantment. That is the one it settles on. So you'll also notice that some enchantments cannot be applied to certain item types (probability 0).
Anyway, the table for greater enchantments:
Name Augment 1H 2H Missile Armor Shield Helm Belt Cloak Gauntlt Boots Ring Amulet Value Grade
OfProtection 10ToAllResista 0 0 0 10 10 10 0 10 0 0 10 10 1000 1
OfTheGods 10ToAllSevenSt 5 5 5 10 10 10 10 10 10 10 10 10 3000 3
OfCarnage ExplosiveImpac 0 0 10 0 0 0 0 0 0 0 0 0 5000 3
OfCold Adds34PointsOf 20 20 20 0 0 0 0 0 0 0 0 0 500 0
OfFrost Adds68PointsOf 20 20 20 0 0 0 0 0 0 0 0 0 1000 2
OfIce Adds912PointsO 20 20 20 0 0 0 0 0 0 0 0 0 2000 3
OfSparks Adds25PointsOf 20 20 20 0 0 0 0 0 0 0 0 0 500 0
OfLightning Adds410PointsO 20 20 20 0 0 0 0 0 0 0 0 0 1000 2
OfThunderbolts Adds615PointsO 20 20 20 0 0 0 0 0 0 0 0 0 2000 3
OfFire Adds16PointsOf 20 20 20 0 0 0 0 0 0 0 0 0 500 0
OfFlame Adds212PointsO 20 20 20 0 0 0 0 0 0 0 0 0 1000 2
OfInfernos Adds318PointsO 20 20 20 0 0 0 0 0 0 0 0 0 2000 3
OfPoison Adds5PointsOfB 20 20 20 0 0 0 0 0 0 0 0 0 500 0
OfVenom Adds8PointsOfB 20 20 20 0 0 0 0 0 0 0 0 0 1000 2
OfAcid Adds12PointsOf 20 20 20 0 0 0 0 0 0 0 0 0 2000 3
Vampiric DrainHitPoints 5 5 5 0 0 0 0 0 0 0 0 0 2 3
OfRecovery IncreasesRateO 0 0 0 0 0 0 0 0 0 0 0 0 200 1
OfImmunity WearerResistan 0 0 0 10 10 10 10 10 0 0 10 10 1000 2
OfSanity WearerResistan_0 0 0 0 5 5 5 5 5 0 0 5 5 1000 2
OfFreedom WearerResistan_1 0 0 0 10 10 10 10 10 0 0 10 10 2000 3
OfAntidotes WearerResistan_2 0 0 0 10 10 10 10 10 0 0 10 10 1000 2
OfAlarms WearerResistan_3 0 0 0 10 10 10 10 10 0 0 10 10 500 1
OfTheMedusa WearerResistan_4 0 0 0 5 5 5 5 5 0 0 5 5 2000 3
OfForce IncreasedKnock 0 0 0 0 0 0 0 0 0 0 0 0 500 0
OfPower 5Level 0 0 0 0 0 0 0 0 0 0 0 0 2500 3
OfAirMagic IncreasesEffec 0 0 0 0 0 0 0 0 0 0 10 10 2000 3
OfBodyMagic IncreasesEffec_0 0 0 0 0 0 0 0 0 0 0 10 10 2000 3
OfDarkMagic IncreasesEffec_1 0 0 0 0 0 0 0 0 0 0 10 10 2000 3
OfEarthMagic IncreasesEffec_2 0 0 0 0 0 0 0 0 0 0 10 10 2000 3
OfFireMagic IncreasesEffec_3 0 0 0 0 0 0 0 0 0 0 10 10 2000 3
OfLightMagic IncreasesEffec_4 0 0 0 0 0 0 0 0 0 0 10 10 2000 3
OfMindMagic IncreasesEffec_5 0 0 0 0 0 0 0 0 0 0 10 10 2000 3
OfSpiritMagic IncreasesEffec_6 0 0 0 0 0 0 0 0 0 0 10 10 2000 3
OfWaterMagic IncreasesEffec_7 0 0 0 0 0 0 0 0 0 0 10 10 2000 3
OfThievery IncreasesChanc 0 0 0 0 0 0 0 0 0 0 0 0 2000 1
OfShielding HalfDamageFrom 0 0 0 25 30 0 0 20 0 0 5 5 1000 1
OfRegeneration RegenerateHitP 0 0 0 10 0 0 10 10 0 0 10 10 1000 1
OfMana RegenerateSpel 0 0 0 10 0 10 10 10 10 0 10 10 1000 1
DemonSlaying DoubleDamageVs 20 20 20 0 0 0 0 0 0 0 0 0 2 0
DragonSlaying DoubleDamageVs_0 20 20 20 0 0 0 0 0 0 0 0 0 2 0
OfDarkness DrainHitPoints_0 5 5 5 0 0 0 0 0 0 0 0 0 3 3
OfDoom 1ToSevenStatsH 10 10 10 10 10 10 10 10 10 10 10 10 750 1
OfEarth 10ToEnduranceA 10 10 10 10 10 10 10 10 10 10 10 10 2000 3
OfLife 10HitPointsAnd 0 0 0 10 10 10 10 10 10 10 10 10 2000 3
Rogues 5SpeedAndAccur 10 10 10 5 5 5 10 20 20 20 10 10 500 0
OfTheDragon Adds1020Points 10 10 10 0 0 0 0 0 0 0 0 0 3000 3
OfTheEclipse 10SpellPointsA 0 0 0 0 0 0 10 10 5 10 10 10 2000 3
OfTheGolem 15EnduranceAnd 5 5 5 20 20 10 10 10 10 10 10 10 1500 2
OfTheMoon 10IntellectAnd 5 5 5 10 10 20 10 10 10 10 10 10 1000 2
OfThePhoenix 30FireResistan 0 0 0 20 20 20 0 0 0 0 0 0 3000 3
OfTheSky 10SpellPointsS 5 5 5 10 10 20 10 10 10 10 10 10 2500 3
OfTheStars 10EnduranceAnd 5 5 5 10 10 10 10 20 20 10 10 10 1000 2
OfTheSun 10MightAndPers 5 5 5 10 10 10 10 20 20 10 10 10 1000 2
OfTheTroll 15EnduranceAnd_0 5 5 5 20 20 10 10 10 10 10 10 10 1500 2
OfTheUnicorn 15LuckAndRegen 5 5 5 10 10 20 10 10 10 10 10 10 1500 2
Warriors 5MightAndEndur 5 5 5 10 10 10 10 10 10 10 10 10 500 0
Wizards 5IntellectAndP 5 5 5 5 5 5 10 10 10 10 10 10 500 0
Antique IncreasedValue 10 10 10 10 10 10 0 0 10 0 10 10 10 1
Swift IncreasedWeapo 25 25 25 0 0 0 0 0 0 0 0 0 2 1
Monks 3UnarmedAndDod 0 0 0 0 0 0 10 5 15 10 5 5 1500 2
Thieves 3StealingAndDi 0 0 0 0 0 0 5 5 20 5 15 5 1500 1
OfIdentifying 3IdItemAndIdMo 0 0 0 0 0 0 5 5 0 5 10 15 1500 0
ElfSlaying DoubleDamageVs_1 20 20 20 0 0 0 0 0 0 0 0 0 2 0
UndeadSlaying DoubleDamageVs_2 20 20 20 0 0 0 0 0 0 0 0 0 2 1
OfDavid DoubleDamageVs_3 20 20 20 0 0 0 0 0 0 0 0 0 2 0
OfPlenty RegenerateSpel_0 0 0 0 10 0 5 10 10 5 0 10 10 2500 2
Assassins Adds5PointsOfB_0 20 20 20 0 0 0 0 0 0 0 0 0 1000 1
Barbarians Adds68PointsOf_0 20 20 20 0 0 0 0 0 0 0 0 0 1500 2
OfTheStorm 20AirResistanc 0 0 0 20 20 20 0 0 0 0 0 0 1500 2
OfTheOcean 10WaterResista 0 0 0 20 20 20 0 0 0 0 0 0 1000 1
OfWaterWalking PreventsDamage 0 0 0 5 5 5 5 5 0 15 5 5 1500 2
OfFeatherFalli PreventsDamage_0 0 0 0 5 0 0 5 5 0 5 15 5 1000 1
Note that when value = 2, that means it doubles the existing value rather than adding to it.
And again, sorry about the bad formatting.
Unlike with the basic enchantments, it will first compile a list of enchantments that can be applied to the item, filtering out grades 3 and 4, and probability 0. It then totals the probability count and then gets a random number less than that count and begins subtracting the probabilities until it bottoms out and chooses that one.
So if you ever wondered why you couldn't get a certain enchantment even by save-scumming, or if you ever had the feeling that certain enchantments are more likely for some kind of equipment, now you know for sure.