%MagicItemNames = {   101 => "Fire Sword",
                      102 => "Ice Sword",
                      103 => "Stinger",
                      104 => "Sword of Sharpness",
                      105 => "Sword of Sharpness",
                      106 => "Axe of Sharpness",
                      107 => "Enchanted Sword",
                      108 => "Enchanted Spear",
                      109 => "Enchanted Pike",
                      110 => "Hunter's Knife",
                      111 => "Thorn Spear",
                      112 => "Thorn Staff",
                      113 => "Black Steel Tower Shield",
                      114 => "Black Steel Kite Shield",
                      115 => "Enchanted Shield",
                      116 => "Raw Hide Shield",
                      117 => "Black Steel Helmet",
                      118 => "Black Steel Plate",
                      119 => "Black Steel Full Plate",
                      120 => "Berserker Pelt",
                      121 => "Boots of Long Strides",
                      122 => "Ring of Fire",
                      123 => "Ring of Tamed Lightning",
                      124 => "Ring of Frost",
                      125 => "Bear Claw Talisman",
                      126 => "Skull Talisman",
                      127 => "Snake Ring",
                      128 => "Slave Collar",
                      201 => "Sceptre of Authority",
                      202 => "Just Man's Cross",
                      203 => "Thunder Whip",
                      204 => "Longbow of Accuracy",
                      205 => "Lightning Rod",
                      206 => "Ice Pebble Staff",
                      207 => "Smasher",
                      208 => "Main Gauche of Parrying",
                      209 => "Halberd of Might",
                      210 => "Hammer of the Mountains",
                      211 => "Star of Heroes",
                      212 => "Faithful",
                      213 => "Piercer",
                      214 => "Dwarven Hammer",
                      215 => "Bane Blade",
                      216 => "Bane Blade",
                      217 => "Rod of the Leper King",
                      218 => "Duskdagger",
                      219 => "Black Bow of Botulf",
                      220 => "Gloves of the Gladiator",
                      221 => "Serpent Kryss",
                      222 => "Knife of the Damned",
                      223 => "Jade Knife",
                      224 => "Vision's Foe",
                      225 => "Weightless Tower Shield",
                      226 => "Weightless Kite Shield",
                      227 => "Lead Shield",
                      228 => "Shield of Valor",
                      229 => "Crystal Shield",
                      230 => "Eye Shield",
                      231 => "Totem Shield",
                      232 => "Dragon Helmet",
                      233 => "Horror Helmet",
                      234 => "Black Laurel",
                      235 => "Ivy Crown",
                      236 => "Horned Helmet",
                      237 => "Fire Plate",
                      238 => "Robe of Missile Protection",
                      239 => "Light Weight Scale Mail",
                      240 => "Weightless Scale Mail",
                      241 => "Copper Plate",
                      242 => "Shambler Skin Armor",
                      243 => "Armor of Souls",
                      244 => "Boots of the Behemoth",
                      245 => "Boots of Giant Strength",
                      246 => "Burning Pearl",
                      247 => "Fever Fetish",
                      248 => "Ring of Warning",
                      249 => "Owl Quill",
                      250 => "Eye of Aiming",
                      251 => "Amulet of Missile Protection",
                      252 => "Amulet of Breathing",
                      253 => "Clam of Pearls",
                      254 => "Ring of Water Breathing",
                      255 => "Bracers of Protection",
                      256 => "Pendant of Luck",
                      257 => "Barkskin Amulet",
                      258 => "Cat Charm",
                      259 => "Enormous Cauldron of Broth",
                      260 => "Ring of the Warrior",
                      261 => "Soul Contract",
                      301 => "Vine Bow",
                      302 => "Fire Bole",
                      303 => "Wand of Wild Fire",
                      304 => "Flambeau",
                      305 => "Fire Brand",
                      306 => "Lightning Spear",
                      307 => "Thunder Bow",
                      308 => "Staff of Storms",
                      309 => "Wave Breaker",
                      310 => "Staff of Corrosion",
                      311 => "Frost Brand",
                      312 => "Rune Smasher",
                      313 => "Sword of Swiftness",
                      314 => "Midget Masher",
                      315 => "Elf Bane",
                      316 => "Implementor Axe",
                      317 => "Flesh Eater",
                      318 => "Herald Lance",
                      319 => "Skull Staff",
                      320 => "Wraith Sword",
                      321 => "Snake Bladder Stick",
                      322 => "Thistle Mace",
                      323 => "Whip of Command",
                      324 => "Vine Whip",
                      325 => "Rat Tail",
                      326 => "Skull Standard",
                      327 => "Summer Sword",
                      328 => "Heart Finder Sword",
                      329 => "Charcoal Shield",
                      330 => "Lucky Coin",
                      331 => "Shield of the Accursed",
                      332 => "Vine Shield",
                      333 => "Flame Helmet",
                      334 => "Winged Helmet",
                      335 => "Crown of Command",
                      336 => "Chain Mail of Displacement",
                      337 => "Silver Hauberk",
                      338 => "Rainbow Armor",
                      339 => "Elemental Armor",
                      340 => "Robe of the Sea",
                      341 => "Shroud of the Battle Saint",
                      342 => "Robe of Shadows",
                      343 => "Armor of Twisting Thorns",
                      344 => "Chi Shoes",
                      345 => "Earth Boots",
                      346 => "Winged Shoes",
                      347 => "Boots of the Messenger",
                      348 => "Medallion of Vengeance",
                      349 => "Pills of Water Breathing",
                      350 => "Dancing Trident",
                      351 => "Wall Shaker",
                      352 => "Bag of Winds",
                      353 => "Flying Carpet",
                      354 => "Amulet of the Fish",
                      355 => "Manual of Water Breathing",
                      356 => "Girdle of Might",
                      357 => "Crystal Matrix",
                      358 => "Slave Matrix",
                      359 => "Amulet of Antimagic",
                      360 => "Stone Sphere",
                      361 => "Crystal Coin",
                      362 => "Champion's Skull",
                      363 => "Bane Venom Charm",
                      364 => "Horn of Valor",
                      365 => "Endless Bag of Wine",
                      366 => "Lychantropos' Amulet",
                      367 => "Ring of Regeneration",
                      368 => "Amulet of Resilience",
                      369 => "Astral Serpent",
                      370 => "Sanguine Dousing Rod",
                      371 => "Brazen Vessel",
                      372 => "The Heart of Life",
                      373 => "Lifelong Protection",
                      374 => "Blood Stone",
                      375 => "Skull Mentor",
                      401 => "Moon Blade",
                      402 => "Rod of the Phoenix",
                      403 => "Staff of Elemental Mastery",
                      404 => "Evening Star",
                      405 => "Bow of War",
                      406 => "Star of Thraldom",
                      407 => "Staff of Elemental Mastery",
                      408 => "Gate Cleaver",
                      409 => "Ethereal Crossbow",
                      410 => "Standard of the Damned",
                      411 => "Treelord's Staff",
                      412 => "Banner of the Northern Star",
                      413 => "Blood Thorn",
                      414 => "Hell Sword",
                      415 => "Demon Whip",
                      416 => "Shield of Gleaming Gold",
                      417 => "Scutata Volturnus",
                      418 => "Lantern Shield",
                      419 => "Spirit Helmet",
                      420 => "Starshine Skullcap",
                      421 => "Skullface",
                      422 => "Wraith Crown",
                      423 => "Marble Armor",
                      424 => "Stymphalian Wings",
                      425 => "Robe of the Magi",
                      426 => "Robe of Invulnerability",
                      427 => "Rime Hauberk",
                      428 => "Jade Armor",
                      429 => "Bone Armor",
                      430 => "Flesh Ward",
                      431 => "Hydra Skin Armor",
                      432 => "Red Dragon Scale Mail",
                      433 => "Blue Dragon Scale Mail",
                      434 => "Green Dragon Scale Mail",
                      435 => "Boots of Quickness",
                      436 => "Boots of Stone",
                      437 => "Lightless Lanter",
                      438 => "Skull of Fire",
                      439 => "Barrel of Air",
                      440 => "Water Bracelet",
                      441 => "Bottle of Living Water",
                      442 => "Sea King's Goblet",
                      443 => "Stone Bird",
                      444 => "Crystal Heart",
                      445 => "Stone Idol",
                      446 => "Ring of Wizardry",
                      447 => "Ring of Sorcery",
                      448 => "Elixir of Life",
                      449 => "Pocket Ship",
                      450 => "Moonvine Bracelet",
                      451 => "The Black Heart",
                      452 => "Spell Focus",
                      501 => "O'al Kan's Sceptre",
                      502 => "Unquenched Sword",
                      503 => "Ember",
                      504 => "Sword of Justice",
                      505 => "Tempest",
                      506 => "Winter Bringer",
                      507 => "Trident from Beyond",
                      508 => "The Summit",
                      509 => "The Stone Sword",
                      510 => "Mage Bane",
                      511 => "Hammer of the Forge Lord",
                      512 => "The Tartarian Chains",
                      513 => "The Sword of many Colors",
                      514 => "Twin Spear",
                      515 => "Twin Spear",
                      516 => "The Oath Rod of Kurgi",
                      517 => "The Sword of Aurgelmer",
                      518 => "Rod of Death",
                      519 => "The Flailing Hands",
                      520 => "The Sickle whose Crop is Pain",
                      521 => "Sceptre of Dark Regency",
                      522 => "Sword of Injustice",
                      523 => "Woundflame",
                      524 => "Sun Slayer",
                      525 => "Picus's Axe of Rulership",
                      526 => "The Sharpest Tooth",
                      527 => "Sceptre of Corruption",
                      528 => "Procas's Axe of Rulership",
                      529 => "Harvest Blade",
                      530 => "Barrier",
                      531 => "The Aegis",
                      532 => "Crown of Overmight",
                      533 => "Amon Hotep",
                      534 => "The Jade Mask",
                      535 => "Crown of the Ivy King",
                      536 => "Aseftik's Armor",
                      537 => "Monolith Armor",
                      538 => "Robe of Calius the Druid",
                      539 => "Fenris' Pelt",
                      540 => "Armor of Virtue",
                      541 => "Boots of Antaeus",
                      542 => "Sandals of the Crane",
                      543 => "Boots of the Planes",
                      544 => "The Boots of Calius the Druid",
                      545 => "The Ruby Eye",
                      546 => "The Ark",
                      547 => "The Flying Ship",
                      548 => "Tome of High Power",
                      549 => "The Magic Lamp",
                      550 => "Krupp's Bracers",
                      551 => "Percival the Pocket Knight",
                      552 => "Gate Stone",
                      553 => "Alchemist's Stone",
                      554 => "Orb of Atlantis",
                      555 => "The Forbidden Light",
                      556 => "Nethgul",
                      557 => "The Horror Harmonica",
                      558 => "Carcator the Pocket Lich",
                      559 => "The Ankh",
                      560 => "The Black Book of Secrets",
                      561 => "The Green Eye",
                      562 => "Soulstone of the Wolves",
                      563 => "The Chalice",
                      564 => "The Tome of Gaia",
                      565 => "The Gift of Kurgi" }


-------------------------------------------
-- Various pre-made sets of magic items. --
-------------------------------------------

-- All the magic trinkets
#MiTrinkets = {101-128}

-- All the lesser magic items
#MiLesser = {201-261}

-- All the greater magic items
#MiGreater = {301-375}

-- All the very powerful magic items
#MiPowerful = {401-452}

-- All the unique magic artifacts
#MiUnique = {501-565}

-----------------------------
-- Magic items by category --
-----------------------------

-- Since you will mostly only want the non-unique items to be assigned
-- randomly, all sets defined here have one "complete" version, with
-- names that starts with "Mia" (Magic Items All) wich includes the 
-- unique items for the category, and one version, whose names starts
-- with "Mi" (Magic Items) which doesn't include the unique items.


-- All weapons
#MiaWeapons = {101-112,201-224,301-328,401-415,501-529}
-- All shields
#MiaShields = {113-116,225-231,329-332,416-418,530-531}
-- All helmets and crowns
#MiaHelmets = {117,232-236,333-335,419-422,532-535}
-- All body armor
#MiaArmor = {119-120,237-243,336-343,423-434,536-540}
-- All boots
#MiaBoots = {121,244-246,344-347,435-436,541-544}
-- All pendants and charms and other miscellaneous items
#MiaMisc = {122-128,246-261,348-375,437-452,545-565}

-- Same sets as above, but without the unique items
#MiWeapons = MiaWeapons \ MiUnique
#MiShields = MiaShields \ MiUnique
#MiHelmets = MiaHelmets \ MiUnique
#MiArmor = MiaArmor \ MiUnique
#MiBoots = MiaBoots \ MiUnique
#MiMisc = MiaMisc \ MiUnique



-----------------------------------------------------------
-- Detailed Weapon lists, including the unique artifacts --
-----------------------------------------------------------

-- All two-handed weapons
#MiaWeaponsTwoHands = {105,109,112,202,204,205,206,209,210,213,216,218,219,220,224,301,304,307,308,309,310,314,316,319,320,326,401,403,405,407,408,409,410,411,412,414,504,505,507,509,511,513,516,519,524,529}
-- All one-handed weapons
#MiaWeaponsOneHand = MiaWeapons \ MiaWeaponsTwoHands
-- All bows and fire-arms
#MiaWeaponsBows = {202,204,213,219,224,301,302,307,405,409}
-- All melee weapons
#MiaWeaponsMelee = MiaWeapons \ MiaWeaponsBows
-- All two-handed melee weapons
#MiaWeaponsMeleeTwoHand = MiaWeaponsTwoHand \ MiaWeaponsBows
-- All swords
#MiaWeaponsSwords = {101,102,104,105,107,212,215,216,304,305,311,313,320,327,328,401,502,503,504,505,509,510,513,517,522,523,524}
-- All knives and daggers
#MiaWeaponsKnives = {110,208,218,221,222,223,413}
-- All flails
#MiaWeaponsFlails = {211,404,406,512,519}
-- Axes, scythes and sickles
#MiaWeaponsAxes = {106,207,209,315,316,317,408,508,520,525,428,529
-- Hammers, maces and sceptres
#MiaWeaponsHammers = {201,210,214,217,312,314,322,402,501,506,511,518,521,527{
-- Spears, pikes, lances and tridents
#MiaWeaponsSpears = {103,108,109,11,306,209,318,507,514,515}
-- Staffs, banners and standards
#MiaWeaponsStaffs = {112,205,206,208,310,319,326,403,407,410,411,412,516}
-- Whips
#MiaWeaponsWhips = {203,323,324,324,415}


-----------------------------------------------------------
-- Detailed Weapon lists, excluding the unique artifacts --
-----------------------------------------------------------
#MiWeaponsTwoHands = MiaWeaponsTwoHands \ MiUnique
#MiWeaponsOneHand = MiaWeaponsOneHand \ MiUnique
#MiWeaponsBows = MiaWeaponsBows \ MiUnique
#MiWeaponsMelee = MiaWeaponsMelee \ MiUnique
#MiWeaponsMeleeTwoHand = MiaWeaponsMeleeTwoHands \ MiUnique
#MiWeaponsSwords = MiaWeaponsSwords \ MiUnique
#MiWeaponsKnives = MiaWeaponsKnives \ MiUnique
#MiWeaponsFlails = MiaWeaponsFlails \ MiUnique
#MiWeaponsAxes = MiaWeaponsAxes \ MiUnique
#MiWeaponsHammers = MiaWeaponsHammers \ MiUnique
#MiWeaponsSpears = MiaWeaponsSpears \ MiUnique
#MiWeaponsStaffs = MiaWeaponsStaffs \ MiUnique
#MiWeaponsWhips = MiaWeaponsWhips \ MiUnique

------------------------------------------------------
-- Magic Items by the magics necessary to make them --
------------------------------------------------------
#MiaAir = {123,203,204,213,224,225,226,228,239,240,241,248,249,250,251,306,307,308,334,336,337,338,344,346,349,350-354,405-407,417,419,425,439,443,449,505,547,548,549}
#MiaAstral = {107-109,115,212,222,229,231,256,315,318,330,331,335,341,342,357-361,369,401,409,412,420,446,447,450,452,504,507,513-517,526,533,540,542,543,546,548,552,555-557,563}
#MiaBlood = {128,243,260,261,317,328,343,370-374,413-415,425,430,451,514,516,527-529,560,565}
#MiaDeath = {126,215-219,224,233,234,316,319,320,326,362,363,404,410,418,421,422,429,438,515,518-525,534,557-560}
#MiaEarth = {103-106,113-114,117,118,119,125,205,207-214,227-229,244,245,255,305,314-316,327,329,337,339,345,356-358,360,361,374,407,408,416,417,423,424,426,428,436,443-445,508-513,525,528,530-532,536,537,541,550,551-554,562,564}
#MiaFire = {101,122,201,202,232,237,246,247,302-305,310,312,329,333,339,348,402-404,415,416,418,432,437,438,501-504,511,512,532,533,545,546,549,553,555}
#MiaNature = {110-112,116,120,121,125,127,220-223,230,231,235,236,257-259,301,321-327,332,338,343,347,355,364-369,411,431,434,448-450,526,529,534,535,538,539,541,544,551,561-564}
#MiaWater = {102,124,206,242,253,254,309-313,340,354,355,403,427,428,433,435,440-442,503,506,507,554,556}

#MiAir = MiaAir \ MiUnique
#MiAstral = MiaAstral \ MiUnique
#MiBlood = MiaBlood \ MiUnique
#MiDeath = MiaDeath \ MiUnique
#MiEarth = MiaEarth \ MiUnique
#MiFire = MiaFire \ MiUnique
#MiNature = MiaNature \ MiUnique
#MiWater = MiaWater \ MiUnique