Module:Sandbox/Aurelain/ArtifactsOverview
From Heroes of Might and Magic: Olden Era Official Wiki
This module renders a giant table with all artifacts. Scroll artifacts are consolidated into 3 generic scroll artifacts (normal, enchanted and mythic). Campaign artifacts are excluded.
A hyper parameter is supported. For more information, see Module:UtilHyper/doc.
Usage
Input: {{#invoke:Sandbox/Aurelain/ArtifactsOverview|display | lang=en | hyper=Attack=Hero_Basics#Attributes}}
Output:
| Artifact | Description | Upgrade | Upgrade cost | Slot | Rarity | Set | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Fish-to-the-Face | +1 Attack | +1 more Attack | 25 | ICommon | paupers_glory_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Rapier | Friendly creatures deal +10% Melee Damage | +5% more Melee Damage | 50 | IIRare | duelists_pride_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Lance | +3 Attack | +2 more Attack | 50 | IIRare | knights_honor_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Ogre's Club of Havoc | +4 Attack | +2 more Attack. Can be upgraded an unlimited number of times. | ∞ (+60)Total cost to reach level:🗯️ 2 🡢 120 3 🡢 360 4 🡢 720 5 🡢 1200 6 🡢 1800 7 🡢 2520 8 🡢 3360 9 🡢 4320 10 🡢 5400 | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Red Dragon Flame Tongue | +2 Attack and Defense | +1 to both attributes | 50 | IIRare | power_of_the_dragon_father_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Garotte | –1 Speed to all enemies | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Shroomwood Bow | Eliminates Ranged Damage penalty for friendly creatures | Friendly creatures deal +5% Ranged Damage | 75 | IIIEpic | living_arrows_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Truthmaker | –10% Attack to enemy creatures | –5% more Attack | 75 | IIIEpic | rule_of_shadow_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Dark Hatchet | +4 Attack, then +15% total Attack | +2 Attack | 75 | IIIEpic | shadow_of_death_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Shaman Staff | +6 Spell Power | +3 more Spell Power | 75 | IIIEpic | shamaniac_soul_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sword of Judgement | +2 Attack, Defense, Spell Power, and Knowledge | +1 more to every attribute | 100 | IVLegendary | angelic_alliance_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Demon Claw | +12 Attack, but –4 Defense | +4 more Attack | 100 | IVLegendary | beelzebubs_blessing_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Excalibur | Heroic Strike kills +1 unit(s). Works on creatures up to tier 7 | +1 more unit(s) | 100 | IVLegendary | legendary_hero_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| right_hand | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Buckler | Friendly creatures can counterattack even if the attacking enemy has “Swift Strike.” | Friendly creatures deal +5% Melee Damage | 25 | ICommon | duelists_pride_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Singing Pan-Pipe | All effects applied by friendly creatures last +1 round(s) | +1 more round(s) | 25 | ICommon | inner_song_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Misericorde | +2 Attack | +1 more Attack | 25 | ICommon | knights_honor_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Shoddy Shield | +2 Defense | ICommon | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Caduceus | Heroic Strike restores 4 mana | +4 more mana | 50 | IIRare | legendary_hero_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Crescent Dagger | Spells and creature abilities ignore 40% of enemy magic resistance | Ignore +20% more magic resistance | 50 | IIRare | ethereal_knowledge_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Fine Wand | +1 level to all spells | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pelagic Hourglass | The cooldowns of all spells are reduced by 1 round(s) | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Shield of the Rampaging Ogre | +4 Defense | +2 more Defense. Can be upgraded an unlimited number of times. | ∞ (+60)Total cost to reach level:🗯️ 2 🡢 120 3 🡢 360 4 🡢 720 5 🡢 1200 6 🡢 1800 7 🡢 2520 8 🡢 3360 9 🡢 4320 10 🡢 5400 | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Dragon Scale Shield | +3 Attack and Defense | +1 to both attributes | 75 | IIIEpic | power_of_the_dragon_father_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Truthseeker | –10% Defense to enemy creatures | –5% more Defense | 75 | IIIEpic | rule_of_shadow_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Lion's Shield of Courage | +2 Attack, Defense, Spell Power, and Knowledge | +1 more to every attribute | 100 | IVLegendary | angelic_alliance_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Chitinous Shield | +12 Defense, but –4 Attack | +4 more Defense | 100 | IVLegendary | beelzebubs_blessing_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| armor | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Chain Mail | +3 Defense | ICommon | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Rags | +1 Spell Power | +1 more Spell Power | 25 | ICommon | paupers_glory_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Eagle Armor | +2 Morale and Luck | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Vortex Robe | Whenever the opponent casts a spell, restores 40% of its cost as mana to the wearer | Restores 60% of the spell’s cost | 50 | IIRare | ethereal_knowledge_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Plate Armor | +3 Defense | +2 more Defense | 50 | IIRare | knights_honor_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Tunic of the Cyclops King | +4 Spell Power | +2 more Spell Power. Can be upgraded an unlimited number of times. | ∞ (+60)Total cost to reach level:🗯️ 2 🡢 120 3 🡢 360 4 🡢 720 5 🡢 1200 6 🡢 1800 7 🡢 2520 8 🡢 3360 9 🡢 4320 10 🡢 5400 | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Robe of Enlightenment | Makes all tier-3 spells available to the hero | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Ribcage Armor | +4 Defense, then +15% total Defense | +2 more Defense | 75 | IIIEpic | shadow_of_death_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Iridescent Cloak | +6 Knowledge | +3 more Knowledge | 75 | IIIEpic | shamaniac_soul_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Armor of Wonder | +2 Attack, Defense, Spell Power, and Knowledge | +1 more to every attribute | 100 | IVLegendary | angelic_alliance_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Heartbeat | +12 Spell Power, but –4 Knowledge | +4 more Spell Power | 100 | IVLegendary | beelzebubs_blessing_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Dragon Scale Armor | +4 Attack and Defense | +1 to both attributes | 100 | IVLegendary | power_of_the_dragon_father_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| head | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Head Torch | +1 sight radius | ICommon | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Fancy Mask | Generates 2 Focus Point(s) at the start of the battle | +2 more Focus Point(s) | 25 | ICommon | inner_song_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Armet | +2 Defense | +1 more Defense | 25 | ICommon | knights_honor_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Straw Hat | +1 Knowledge | +1 more Knowledge | 25 | ICommon | paupers_glory_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Crown of the Supreme Magi | +4 Knowledge | +2 more Knowledge. Can be upgraded an unlimited number of times. | ∞ (+60)Total cost to reach level:🗯️ 2 🡢 120 3 🡢 360 4 🡢 720 5 🡢 1200 6 🡢 1800 7 🡢 2520 8 🡢 3360 9 🡢 4320 10 🡢 5400 | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Scholar's Tiara | +2 Knowledge | +1 more Knowledge | 50 | IIRare | scholars_wisdom_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mirror Tiara | Restores 8 mana to the hero each morning | +8 more mana | 75 | IIIEpic | tranquility_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Helm of Heavenly Enlightenment | +2 Attack, Defense, Spell Power, and Knowledge | +1 more to every attribute | 100 | IVLegendary | angelic_alliance_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Beelzebub's Boon | +12 Knowledge, but –4 Spell Power | +4 more Knowledge | 100 | IVLegendary | beelzebubs_blessing_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Seven Eyes | +1 level(s) to all spells while worn | +1 more spell level(s) | 100 | IVLegendary | ethereal_knowledge_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Crown of Dragontooth | +4 Spell Power and Knowledge | +1 to both attributes | 100 | IVLegendary | power_of_the_dragon_father_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Amelchia's Law | –1 Initiative to enemy creatures | –1 more Initiative | 100 | IVLegendary | rule_of_shadow_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sirin Mask | The cooldowns of all spells are reduced by 1 round(s) | –1 fewer round(s) | 100 | IVLegendary | shamaniac_soul_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Spellbinder's Hat | Makes all tier-5 spells available to the hero | IVLegendary | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Two-faced Mask | The hero can use the Spellbook 1 additional time(s) per battle round | IVLegendary | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| boots | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Magic Slippers | Spells cost 2 less mana | 1 less mana | 25 | ICommon | ethereal_knowledge_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Dragonbone Greaves | +1 Spell Power and Knowledge | +1 to both attributes | 25 | ICommon | power_of_the_dragon_father_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Boots of Travel | +10 Movement points | +5 more Movement points | 50 | IIRare | wanderers_way_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Legion's Leg | +50% to all creature growth in all your cities | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bone Boots | +4 Spell Power, then +15% total Spell Power | +2 more Spell Power | 75 | IIIEpic | shadow_of_death_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Swamp Boots | Eliminates all terrain penalties | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sandals of the Saint | +2 Attack, Defense, Spell Power, and Knowledge | +1 more to every attribute | 100 | IVLegendary | angelic_alliance_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Seven-League Boots | +30 Movement points | IVLegendary | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Warlord Boots | +2 Initiative to friendly creatures | IVLegendary | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| belt | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Rope Belt | +1 Defense | +1 more Defense | 25 | ICommon | paupers_glory_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Soulless Sash | –1 Morale to enemy creatures | ICommon | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Flask of Oblivion | All negative effects on friendly creatures last for –1 round(s) | –1 fewer round(s) | 50 | IIRare | elixir_of_life_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Endless Bag | Produces +1 Gem, Crystal, or Mercury daily. (The resource depends on the bearer’s faction.) | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Warrior's Belt | +2 Attack | +1 more Attack | 50 | IIRare | warriors_strength_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Protective Belt | –10% Magic Damage taken. Friendly creatures are immune to the effects of “Sleep.” | –5% less Magic Damage taken | 75 | IIIEpic | gifts_of_dwarven_lords_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Skull of Milos | +1000 Gold daily | +1000 more Gold | 75 | IIIEpic | milos_curse_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Slithering Sash | +3 Spell Power and Knowledge | +1 to both attributes | 75 | IIIEpic | power_of_the_dragon_father_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Celestial Sash of Bliss | +2 Attack, Defense, Spell Power, and Knowledge | +1 more to every attribute | 100 | IVLegendary | angelic_alliance_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Magic Key Ring | Negates all effects that restrict creature rearrangement, surrendering, fleeing, and using the Spellbook and hero abilities in battle | IVLegendary | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Spells in Bottles | Makes all tier-4 spells available to the hero | IVLegendary | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| back | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Omencaller | –1 to enemy Luck | ICommon | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Automated Antimagic Shield | –10% Magic Damage taken. Friendly creatures are immune to the effects of “Berserk.” | –5% less Magic Damage taken | 50 | IIRare | gifts_of_dwarven_lords_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Monster Head | All creatures always have neutral Morale in battle | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Dragon Wing Tabard | +2 Spell Power and Knowledge | +1 to both attributes | 50 | IIRare | power_of_the_dragon_father_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Backpack | The hero has +10 Movement points | +5 more Movement points | 50 | IIRare | wanderers_way_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Wizard's Cloak | +2 Spell Power | +1 more Spell Power | 50 | IIRare | wizards_might_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Banner of Six Winds | +1 Speed to friendly creatures | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Light-and-Shade Cloak | Friendly creatures can still use Ranged attacks while adjacent to enemy creatures | Friendly creatures deal +5% Ranged Damage | 75 | IIIEpic | living_arrows_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Second Shade | +4 Knowledge, then +15% total Knowledge | +2 more Knowledge | 75 | IIIEpic | shadow_of_death_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Ambassador's Sash | +10% to Persuasion Power in Diplomacy | +5% more Persuasion Power in Diplomacy | 100 | IVLegendary | ambassadors_word_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Fallen Angel Wings | Grants constant flight | IVLegendary | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ring | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Wooden Ring | +1 Morale | +1 more Morale | 25 | ICommon | paupers_glory_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Quiet Eye of a Dragon | +1 Attack and Defense | +1 to both attributes | 25 | ICommon | power_of_the_dragon_father_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Clenching Ring | All effects applied by the hero last +1 round(s) | +1 more round(s) | 25 | ICommon | shamaniac_soul_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Chain Link | Forbids the wearer and the enemy hero to cast tier-1 and 2 spells in combat | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Ring of Life | All positive effects on friendly creatures last for +1 round(s) | +1 more round(s) | 50 | IIRare | elixir_of_life_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Emerald Resonance Controller | –10% to enemy hero Spell Power. Friendly creatures are immune to the effects that kill additional units | –5% more | 50 | IIRare | gifts_of_dwarven_lords_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Keeper's Ring | +2 Defense | +1 more Defense | 50 | IIRare | keepers_fortitude_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Ring of Neutrality | All creatures always have neutral Luck in battle | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sixth Finger | –1 to enemy Morale and Luck | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Shard of Serenity | Restores 6 mana to the hero each morning | +6 more mana | 50 | IIRare | tranquility_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Tabar Signet-Ring | +1 Luck | +1 more Luck | 50 | IIRare | ukhtabar_seal_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Brass Knuckles | Friendly creatures take –30% counterattack Damage | –15% less counterattack Damage | 75 | IIIEpic | duelists_pride_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Crimson Resonance Controller | –20% to enemy hero Spell Power. Friendly creatures are immune to effects that prevent them from attacking | –10% more to enemy Spell Power | 75 | IIIEpic | gifts_of_dwarven_lords_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Lord's Ring | Friendly creatures have +1 Initiative | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Seal of Silence | +1 round(s) to the cooldown of all enemy spells | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Soulcaller Ring | The enemy loses 1 levels on all Magic School spells | IVLegendary | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| item_slot | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Boreoloth's Tail | +1 Defense | +1 more Defense. Can be upgraded an unlimited number of times. | ∞ (+15)Total cost to reach level:🗯️ 2 🡢 30 3 🡢 90 4 🡢 180 5 🡢 300 6 🡢 450 7 🡢 630 8 🡢 840 9 🡢 1080 10 🡢 1350 | ICommon | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Boreoloth's Hand | +1 Attack | +1 more Attack. Can be upgraded an unlimited number of times. | ∞ (+15)Total cost to reach level:🗯️ 2 🡢 30 3 🡢 90 4 🡢 180 5 🡢 300 6 🡢 450 7 🡢 630 8 🡢 840 9 🡢 1080 10 🡢 1350 | ICommon | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Boreoloth's Head | +1 Knowledge | +1 more Knowledge. Can be upgraded an unlimited number of times. | ∞ (+15)Total cost to reach level:🗯️ 2 🡢 30 3 🡢 90 4 🡢 180 5 🡢 300 6 🡢 450 7 🡢 630 8 🡢 840 9 🡢 1080 10 🡢 1350 | ICommon | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Boreoloth's Heart | +1 Spell Power | +1 more Spell Power. Can be upgraded an unlimited number of times. | ∞ (+15)Total cost to reach level:🗯️ 2 🡢 30 3 🡢 90 4 🡢 180 5 🡢 300 6 🡢 450 7 🡢 630 8 🡢 840 9 🡢 1080 10 🡢 1350 | ICommon | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Music Sheet | Friendly creatures’ abilities deal +40% Damage | +20% more Damage | 25 | ICommon | inner_song_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Magic Scroll | Adds the “Impending Fate” spell to the hero’s Spellbook | ICommon | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Golden Moth | +250 Gold daily | +250 more Gold | 25 | ICommon | milos_curse_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Last Coin | +1 Luck | +1 more Luck | 25 | ICommon | paupers_glory_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Liquid Silence | +1 round(s) to the cooldown of all enemy creature abilities | +1 more round(s) | 25 | ICommon | rule_of_shadow_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Magic Mirror | Restores 4 mana to the hero each morning | +4 more mana | 25 | ICommon | tranquility_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Ancient Idol | The hero ignores the restriction on using the same Magic School twice | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Deck of Spells | Makes all tier-1 spells available to the hero | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Enchanted Magic Scroll | Adds the max. level “Impending Fate” spell to the hero’s Spellbook | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Keeper's Amulet | +2 Defense | +1 more Defense | 50 | IIRare | keepers_fortitude_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Quivering Quiver | Friendly creatures deal +10% Ranged Damage | +5% more Ranged Damage | 50 | IIRare | living_arrows_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Golden Pig | +500 Gold daily | +500 more Gold | 50 | IIRare | milos_curse_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Orb of Destruction | Heroic Strike deals +10 base Damage | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Scholar's Amulet | +2 Knowledge | +1 more Knowledge | 50 | IIRare | scholars_wisdom_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Spyglass | +2 sight radius | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Ukh Signet | +1 Morale | +1 more Morale | 50 | IIRare | ukhtabar_seal_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Voodoo Doll | When the wearer is defeated, they can still be hired back in the Tavern | IIRare | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Warrior's Amulet | +2 Attack | +1 more Attack | 50 | IIRare | warriors_strength_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Wizard's Amulet | +2 Spell Power | +1 more Spell Power | 50 | IIRare | wizards_might_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Flag of Truce | The wearer keeps their army whenever they flee from battle | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Golden Goose Egg | Grants a random wondrous reward after a random number of upgrades | Varies | ∞ (60)Total cost to reach level:🗯️ 2 🡢 60 3 🡢 180 4 🡢 360 5 🡢 600 6 🡢 900 7 🡢 1260 8 🡢 1680 9 🡢 2160 10 🡢 2700 | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Drum of War | Friendly creatures deal +1 Damage | +1 more Damage | 50 | IIIEpic | knights_honor_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mythic Magic Scroll | Adds the “Town Portal” spell to the hero’s Spellbook | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Orb of Inhibition | On the first round of the battle, heroes cannot use their Spellbook or active abilities | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Orb of Dawn | All of the hero’s Daylight spells have +1 level(s). Enemy hero has –1 Daylight spell level | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Orb of Eternity | All of the hero’s Arcane spells have +1 level(s). Enemy hero has –1 Arcane spell level | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Orb of Twilight | All of the hero’s Nightshade spells have +1 level(s). Enemy hero has –1 Nightshade spell level | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Primordial Orb | All of the hero’s Primal spells have +1 level(s). Enemy hero has –1 Primal spell level | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Runestone Shards | Makes all tier-2 spells available to the hero | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Shackles of War | Prevents surrender and flee in battle. (This affects both the wearer and their opponent.) | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Tactical Guide | The opponent cannot rearrange creatures before the start of battle | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Diplomatic Gifts | +10% to Persuasion Power in Diplomacy | +5% more Persuasion Power in Diplomacy | 100 | IVLegendary | ambassadors_word_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Daylight Tome | Allows the hero to cast all Daylight spells | IVLegendary | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Nightshade Tome | Allows the hero to cast all Nightshade spells | IVLegendary | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Primal Tome | Allows the hero to cast all Primal spells | IVLegendary | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Arcane Tome | Allows the hero to cast all Arcane spells | IVLegendary | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Demonic Heart | Replaces all the hero’s spells with their Masterful versions (if they exist) | IVLegendary | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Lifeblood Fae | Friendly creatures have +2 HP | +1 more HP | 75 | IVLegendary | elixir_of_life_item_set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pole Star | Global Map spells of the hero cost 0 mana | IVLegendary | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| unic_slot | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Holy Sigil of Eridore | While worn, grants all unlearned Subskills of the following Skills: Logistics, Battle Magic, Wisdom | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Holy Sigil of Insara | While worn, grants all unlearned Subskills of the following Skills: Leadership, Insight, Diplomacy, Tactics | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Holy Sigil of Mearea | While worn, grants all unlearned Subskills of the following Skills: Luck, Economy, Daylight Magic | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Holy Sigil of Quix | While worn, grants all unlearned Subskills of the following Skills: Arcane Magic, Scouting, Battlecraft, Thaumaturgy | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Holy Sigil of Roph | While worn, grants all unlearned Subskills of the following Skills: Righteousness, Necromancy, Murmuring, Triumvirate’s Strength, Abyssal Communion, Summon Swarm | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Holy Sigil of The Second Man | While worn, grants all unlearned Subskills of the following Skills: Offense, Summon Avatar, Siegecraft, Combat | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Holy Sigil of The Seven Magi | While worn, grants all unlearned Subskills of the following Skills: Sorcery, Nightshade Magic, Resistance | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Holy Sigil of Uurdt | While worn, grants all unlearned Subskills of the following Skills: Defense, Primal Magic, Recruitment | IIIEpic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-- Usage: see Module:ArtifactsOverview/doc
local p = {}
local f = mw.ustring.format
local SLOT_ORDER = {
left_hand = 1, -- Main Hand
right_hand = 2, -- Off Hand
armor = 3, -- Armor
head = 4, -- Head
boots = 5, -- Boots
belt = 6, -- Belt
back = 7, -- Back
ring = 8, -- Rings
item_slot = 9, -- Item
unic_slot = 10, -- Relic
}
local RARITY_ORDER = {
common = 1,
rare = 2,
epic = 3,
legendary = 4,
}
local SLOT_ICONS = {
armor = 'Icon_Equipment_Armor.png',
back = 'Icon_Equipment_Cloak.png',
belt = 'Icon_Equipment_Belt.png',
boots = 'Icon_Equipment_Boots.png',
head = 'Icon_Equipment_Helmet.png',
item_slot = 'Icon_Equipment_Sundries.png',
left_hand = 'Icon_Equipment_RightHand.png',
right_hand = 'Icon_Equipment_LeftHand.png',
ring = 'Icon_Equipment_Rings.png',
unic_slot = 'Icon_Equipment_Banner.png',
}
-- Note: The right side is just a fallback, it will seldom be used.
local TRANSLATION_IDS = {
wiki_none = 'None',
wiki_ao_artifact = 'Artifact',
unit_window_narrative = 'Description',
wiki_ao_upgrade = 'Upgrade', -- inventoryUpgradeItemLabel
wiki_ao_slot = 'Slot',
wiki_ao_rarity = 'Rarity',
wiki_ao_set = 'Set',
wiki_ao_upgrade_cost = 'Upgrade cost',
wiki_ao_armor = 'Armor',
wiki_ao_back = 'Back',
wiki_ao_belt = 'Belt',
wiki_ao_boots = 'Boots',
wiki_ao_head = 'Head',
wiki_ao_item_slot = 'Item',
wiki_ao_left_hand = 'Main Hand',
wiki_ao_right_hand = 'Off Hand',
wiki_ao_ring = 'Rings',
wiki_ao_unic_slot = 'Relic',
wiki_ao_common = 'Common',
wiki_ao_rare = 'Rare',
wiki_ao_epic = 'Epic',
wiki_ao_legendary = 'Legendary',
wiki_ao_special = 'Special',
wiki_ao_total = 'Total cost to reach level:',
}
local ROMAN = { 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII' }
-- Displays a variable
------------------------------------------------------------------------------------------------------------------------
local function dump(target)
return '<pre>' .. mw.dumpObject(target) .. '</pre>'
end
-- Spawns a safe robotic url from an English name, fit for adding it before the visible name
------------------------------------------------------------------------------------------------------------------------
local function getUrl(nameEn, lang)
if not nameEn then
return ''
end
local url = nameEn
if lang ~= 'en' then
url = url .. '/' .. lang
end
return url
end
-- Retrieves the text for some specific ids from Cargo Translations.
------------------------------------------------------------------------------------------------------------------------
local function translateIds(ids, lang, extra)
-- Key list
local list = {}
for key, _ in pairs(ids) do
list[#list + 1] = key
end
local idListString = '"' .. table.concat(list, '", "') .. '"'
-- Cargo
local where = {}
table.insert(where, 'target_id IN (' .. idListString .. ')')
table.insert(where, 'language = "' .. lang .. '"')
if extra then
table.insert(where, extra)
end
local results = mw.ext.cargo.query('Translation', 'target_id, name', {
where = table.concat(where, ' AND '),
limit = 100
})
-- Dictionary
local dictionary = mw.clone(ids)
for key, value in pairs(dictionary) do
dictionary[key] = value .. '🗯️'
end
for _, row in ipairs(results) do
local name = row['name']
if name and name ~= '' then
dictionary[row['target_id']] = name
end
end
return dictionary
end
-- Converts a dictionary into a linear array
------------------------------------------------------------------------------------------------------------------------
local function flatten(hub)
local list = {}
for _, entry in pairs(hub) do
list[#list + 1] = entry
end
return list
end
-- Parses and runs a Cargo query from wiki-like syntax
------------------------------------------------------------------------------------------------------------------------
local function runQuery(query, ...)
query = string.gsub(query, "%-%-.-\n", "") -- remove "comments"
query = select('#', ...) > 0 and mw.ustring.format(query, ...) or query
query = mw.text.trim(query)
local tables = ''
local fields = ''
local options = {}
for part in query:gmatch('[^|]+') do
local key, val = part:match('^%s*([^=]+)%s*=%s*(.-)%s*$')
if key and val then
key = mw.text.trim(key):lower()
val = mw.text.trim(val)
val = val:gsub('%s', ' ')
if key == 'tables' then
tables = val
elseif key == 'fields' then
fields = val
elseif key == 'limit' then
options[key] = tonumber(val) or val
elseif key == 'join on' then
options['join'] = val
else
options[key] = val
end
end
end
return mw.ext.cargo.query(tables, fields, options)
end
-- Interrogates the main Cargo table
------------------------------------------------------------------------------------------------------------------------
local function queryMain(lang)
return runQuery([[
tables =
Artifact = A,
Translation = T,
Translation = E
| join on =
A.id = T.target_id,
A.id = E.target_id
| fields =
A.id = id,
A.slot = slot,
A.rarity = rarity,
A.artifact_set_id = artifact_set_id,
A.max_level = max_level,
A.cost_base = cost_base,
A.cost_per_level = cost_per_level,
T.language = language,
T.name = name,
T.description = description,
T.type = translation_type,
E.name = nameEn,
| where =
A.id NOT LIKE 'campaign_%%'
AND T.language = '%s'
AND E.type = 'artifact'
AND E.language = 'en'
| limit =
1000
]], lang, lang, lang);
--table.insert(where, '(A.id = "enchanted_magic_scroll_artifact_day_10_magic_second_song" or A.id="enchanted_magic_scroll_artifact_day_13_magic_holy_arms")')
end
-- Folds magic scrolls into 3 artifacts (normal, enchanted and mythic):
------------------------------------------------------------------------------------------------------------------------
local function consolidateScrolls(lang, results)
local hub = {}
for _, row in ipairs(results) do
local id = row.id
if id:find('magic_scroll') then
if id:find('mythic') then
id = 'mythic_scroll_box_artifact'
else
if id:find('enchanted') then
id = 'enchanted_magic_scroll_artifact'
else
id = 'magic_scroll_artifact'
end
end
local entry = hub[id]
if not entry then
entry = {}
entry.id = id or ''
entry.name = row.name or ''
entry.nameEn = row.nameEn or ''
entry.spells = {}
entry.slot = row.slot or ''
entry.rarity = row.rarity or ''
entry.artifact_set_id = row.artifact_set_id or ''
entry.max_level = 0
entry.cost_base = 0
entry.cost_per_level = 0
entry.description = '' -- will be overridden below
entry.upgrade = ''
entry.narrative = '' -- will be overridden below
hub[id] = entry
end
if row.translation_type == 'artifact' then
local spellId = row.id:gsub('.*artifact_', '')
table.insert(entry.spells, spellId)
entry.description = row.description or ''
end
if row.translation_type == 'artifact_narrative' then
entry.narrative = row.description or ''
end
end
end
return hub
end
-- Folds all Cargo results into a single dictionary:
------------------------------------------------------------------------------------------------------------------------
local function consolidate(lang, results)
local hub = consolidateScrolls(lang, results)
for _, row in ipairs(results) do
local id = row.id
if not id:find('magic_scroll') then
local entry = hub[id]
if not entry then
entry = {}
entry.id = id or ''
entry.name = row.name or ''
entry.nameEn = row.nameEn or ''
entry.spells = {}
entry.slot = row.slot or ''
entry.rarity = row.rarity or ''
entry.artifact_set_id = row.artifact_set_id or ''
entry.max_level = tonumber(row.max_level) or 0
entry.cost_base = tonumber(row.cost_base) or 0
entry.cost_per_level = tonumber(row.cost_per_level) or 0
entry.description = '' -- will be overridden below
entry.upgrade = '' -- will be overridden below
entry.narrative = '' -- will be overridden below
hub[id] = entry
end
if row.translation_type == 'artifact' then
entry.description = row.description or ''
end
if row.translation_type == 'artifact_upgrade' then
entry.upgrade = row.description or ''
end
if row.translation_type == 'artifact_narrative' then
entry.narrative = row.description or ''
end
end
end
return hub
end
------------------------------------------------------------------------------------------------------------------------
local function sortList(a, b)
local slotA = SLOT_ORDER[a.slot] or 99
local slotB = SLOT_ORDER[b.slot] or 99
if slotA ~= slotB then
return slotA < slotB
end
local rarityA = RARITY_ORDER[a.rarity] or 99
local rarityB = RARITY_ORDER[b.rarity] or 99
if rarityA ~= rarityB then
return rarityA < rarityB
end
return a.id < b.id
end
-- Boilerplate for the header cells
------------------------------------------------------------------------------------------------------------------------
local function addTh(tr, text)
return tr:tag('th'):wikitext(text)
end
-- Boilerplate for the body cells
------------------------------------------------------------------------------------------------------------------------
local function addTd(tr, content)
if type(content) == "string" then
return tr:tag('td'):wikitext(content)
else
return tr:tag('td'):node(content)
end
end
-- Boilerplate for the separator rows
------------------------------------------------------------------------------------------------------------------------
local function addSeparator(htmlTable, className, content)
htmlTable:tag('tr')
:addClass('separator')
:addClass(className)
:tag('td'):attr('data-sort-value', ''):attr('colspan', 100):wikitext(content):done()
end
-- TABLE HEADER
------------------------------------------------------------------------------------------------------------------------
local function createHeader(htmlTable, words)
local tr = htmlTable:tag('tr')
--addTh(tr, 'id')
addTh(tr, words.wiki_ao_artifact):attr('colspan', 2)
addTh(tr, words.unit_window_narrative)
addTh(tr, words.wiki_ao_upgrade)
addTh(tr, words.wiki_ao_upgrade_cost)
addTh(tr, words.wiki_ao_slot)
addTh(tr, words.wiki_ao_rarity)
addTh(tr, words.wiki_ao_set)
--addTh(tr, 'narrative')
end
------------------------------------------------------------------------------------------------------------------------
local function renderIcon(id, nameEn, lang)
local url = getUrl(nameEn, lang)
return f('[[File:%s.png|64px|link=%s]]', id, url)
end
------------------------------------------------------------------------------------------------------------------------
local function renderName(name, nameEn, lang)
local url = getUrl(nameEn, lang)
return f('[[%s|%s]]', url, name)
end
------------------------------------------------------------------------------------------------------------------------
local function renderDescription(description)
description = mw.ustring.gsub(description, '[.。]-$', '') -- remove the ending dot
-- TODO: add links
return mw.text.trim(description)
end
------------------------------------------------------------------------------------------------------------------------
local function renderUpgrade(item, words, lang)
if item.max_level < 2 then
return ''
end
if item.id:find('goose_egg') then
local url = getUrl('Golden_Goose_Egg', lang)
return f('[[%s|%s]]', url, words.wiki_ao_special)
end
local text = item.upgrade
text = mw.ustring.gsub(text, '^.-[::]', '') -- remove the "Upgrade: " prefix
if item.max_level < 900 then
text = mw.ustring.gsub(text, '[.。]-$', '') -- remove the ending dot
end
--if item.max_level > 900 then
--text = mw.ustring.gsub(text, '[.。].-$', '') -- remove the last sentence which should say "Can be upgraded..."
--end
return mw.text.trim(text)
end
------------------------------------------------------------------------------------------------------------------------
local function buildUpgradeHint(item, words)
local levels = {words.wiki_ao_total}
local sum = 0
for i = 1, 9 do
local current = i * (item.cost_base + item.cost_per_level)
sum = sum + current
table.insert(levels, (i + 1) .. ' 🡢 ' .. sum)
end
return table.concat(levels, '<br>')
end
------------------------------------------------------------------------------------------------------------------------
local function addUpgradeCost(tr, item, words, frame)
if item.max_level > 900 then
local symbol = item.cost_per_level == 0 and '' or '+'
local nr = item.cost_per_level == 0 and item.cost_base or item.cost_per_level
local text = f('<span class{{=}}"infinity">∞</span> <span class{{=}}"step">(%s%s)</span>', symbol, nr)
local hint = buildUpgradeHint(item, words)
local wikitext = frame:preprocess(f('{{Hint|%s|%s}}', text, hint))
tr:tag('td'):wikitext(wikitext):attr('data-sort-value', 1000 + item.cost_per_level)
elseif item.max_level < 2 then
tr:tag('td'):attr('data-sort-value', 0)
else
local cost = item.cost_base + item.cost_per_level
tr:tag('td'):wikitext(cost):attr('data-sort-value', cost)
end
end
------------------------------------------------------------------------------------------------------------------------
local function renderSlot(item, words, frame)
local file = f('[[File:%s|48px|link=]]', SLOT_ICONS[item.slot])
local hint = words['wiki_ao_' .. item.slot]
return frame:preprocess(f('{{Hint|%s|%s}}', file, hint))
end
------------------------------------------------------------------------------------------------------------------------
local function renderRarity(item, words, frame)
local text = ROMAN[RARITY_ORDER[item.rarity]]
local hint = words['wiki_ao_' .. item.rarity]
return frame:preprocess(f('{{Hint|%s|%s}}', text, hint))
end
-- TABLE BODY
------------------------------------------------------------------------------------------------------------------------
local function createBody(htmlTable, list, lang, words, frame)
local currentRarity = list[1].rarity
local currentSlot = list[1].slot
for _, item in ipairs(list) do
-- separators
if item.slot ~= currentSlot then
currentSlot = item.slot
currentRarity = item.rarity
addSeparator(htmlTable, 'separator-large', currentSlot)
elseif item.rarity ~= currentRarity then
currentRarity = item.rarity
addSeparator(htmlTable, 'separator-tiny ' .. currentRarity, '')
end
local tr = htmlTable:tag('tr'):addClass('artifact'):addClass(item.rarity)
--addTd(tr, item.id)
addTd(tr, renderIcon(item.id, item.nameEn, lang))
addTd(tr, renderName(item.name, item.nameEn, lang))
addTd(tr, renderDescription(item.description))
addTd(tr, renderUpgrade(item, words, lang))
addUpgradeCost(tr, item, words, frame)
addTd(tr, renderSlot(item, words, frame)):attr('data-sort-value', SLOT_ORDER[item.slot])
addTd(tr, renderRarity(item, words, frame)):attr('data-sort-value', RARITY_ORDER[item.rarity])
addTd(tr, item.artifact_set_id)
--addTd(tr, item.narrative)
end
end
-- M A I N
------------------------------------------------------------------------------------------------------------------------
function p.display(frame)
--do return dump(frame) end
-- Args
local args = frame.args
local lang = args.lang ~= '' and args.lang or 'en'
--lang = 'fr'
-- Language
local words = translateIds(TRANSLATION_IDS, lang)
-- Cargo
local results = queryMain(lang)
local hub = consolidate(lang, results)
local list = flatten(hub);
if #list == 0 then return words.wiki_none end
-- Various manipulations
table.sort(list, sortList)
-- Table
local htmlTable = mw.html.create('table')
htmlTable:addClass('wikitable sortable table-nobands')
createHeader(htmlTable, words)
createBody(htmlTable, list, lang, words, frame)
-- Output
local styleTag = frame:extensionTag('templatestyles', '', { src = frame:getTitle() .. '/styles.css' })
return '<div class="artifacts-overview">' .. styleTag .. tostring(htmlTable) .. '</div>'
end
return p


