Minecraft Wiki
(Ajout des contenus des coffres pour bedrock 2)
Aucun résumé des modifications
 
(107 versions intermédiaires par 3 utilisateurs non affichées)
Ligne 17 : Ligne 17 :
 
item_weight, pool_total_item_weight )
 
item_weight, pool_total_item_weight )
   
  +
local inverse_result = 0 -- 1 - inverse_result = return value
local avg_rolls = ( min_pool_rolls + max_pool_rolls ) / 2
 
  +
local inverse_item_weight = pool_total_item_weight - item_weight
local relativeweight = item_weight / pool_total_item_weight
 
 
 
  +
-- will be used for the division in the for loop to avoid the slightly
return 1 - math.pow( 1 - relativeweight, avg_rolls )
 
  +
-- less performant math.pow(). The divisor already includes the probability
  +
-- of picking any specific number of rolls.
  +
local cur_dividend = pool_total_item_weight
  +
local cur_divisor = pool_total_item_weight * (max_pool_rolls - min_pool_rolls + 1)
  +
  +
for i = 0, max_pool_rolls do
  +
if i >= min_pool_rolls then
  +
inverse_result = inverse_result + cur_dividend / cur_divisor
  +
end
  +
cur_dividend = cur_dividend * inverse_item_weight -- simulate pow
  +
cur_divisor = cur_divisor * pool_total_item_weight -- simulate pow
  +
end
  +
  +
return 1 - inverse_result
 
 
 
end,
 
end,
 
 
java = '[[Version Java]]\n',
+
java = '[[version Java]]\n',
java_dev = '[[Version Java]]. À venir en [[1.17]]\n',
+
['java-upcoming'] = '[[version Java 1.20]]\n',
bedrock = '[[Version Bedrock]]\n',
+
bedrock = '[[version Bedrock]]\n',
bedrock_dev= '[[Version Bedrock]]. À venir en [[Version Bedrock 1.17|1.17]]\n',
+
['bedrock-upcoming']= '[[version Bedrock 1.20.0]]\n',
 
 
-- these define which sprite, label and link to use, in the table,
+
-- These 'items' define which sprite, label and link to use in the table.
-- and 'cannot_stack' and 'plural' dictate how to display the single-item summary
+
-- Properties 'cannot_stack', 'preserve_case', and 'plural' describe how to display the single-item summary in p.base2.
  +
-- Order within this 'items' list doesn't matter.
 
-- mettre article="partitif" fait utiliser "du" ou "de la" devant l'objet
 
-- mettre article="partitif" fait utiliser "du" ou "de la" devant l'objet
 
-- il faut mettre genre="féminin" pour les objets au nom féminin
 
-- il faut mettre genre="féminin" pour les objets au nom féminin
 
 
-- NOTE: order in this list doesn't matter.
 
   
  +
items = require("Module:CoffreRécompenses/objets"),
items = {
 
["arbalète"] = { "objet" },
 
["arbuste-mort"] = { "bloc" },
 
["argile"] = { "objet", link="Mouton cru" },
 
["armure-cheval-diamant"] = { "objet", title="Armure en diamant pour cheval", link="Armure pour cheval", cannot_stack=true },
 
["armure-cheval-fer"] = { "objet", title="Armure en fer pour cheval", link="Armure pour cheval", cannot_stack=true },
 
["armure-cheval-or"] = { "objet", title="Armure en or pour cheval", link="Armure pour cheval", cannot_stack=true },
 
["baies-sucrées"] = { "objet" },
 
["bambou"] = { "objet", link="Bambou" },
 
["bâton"] = { "objet" },
 
["blé"] = { "objet" },
 
["bloc-fer"] = { "bloc", title="Bloc de fer" },
 
["bloc-neige"] = { "bloc", title="Bloc de neige", link="Bloc de neige" },
 
["bloc-or"] = { "bloc", title="Bloc d'or" },
 
["bloc-os"] = { "bloc", title="Bloc d'os" },
 
["bœuf"] = { "objet", link="Bœuf cru" },
 
["bottes-cuir"] = { "objet", title="Bottes en cuir", link="Armure", cannot_stack=true },
 
["bottes-diamant"] = { "objet", title="Bottes en diamant", link="Armure", cannot_stack=true },
 
["bottes-fer"] = { "objet", title="Bottes en fer", link="Armure", cannot_stack=true },
 
["bottes-or"] = { "objet", title="Bottes en or", link="Armure", cannot_stack=true },
 
["bottes-mailles"] = { "objet", title="Bottes de mailles", link="Armure", cannot_stack=true },
 
["boule-de-neige"] = { "objet" },
 
["boule-feu"] = { "objet", title="Boule de feu" },
 
["boussole"] = { "objet" },
 
["briquet"] = { "objet", cannot_stack=true },
 
["bûche-acacia"] = { "bloc", title="Bûche d'acacia", id='bûche-acacia', link="Bûche" },
 
["bûche-acajou"] = { "bloc", title="Bûche d'acajou", id='bûche-acajou', link="Bûche" },
 
["bûche-bouleau"] = { "bloc", title="Bûche de bouleau", id='bûche-bouleau', link="Bûche" },
 
["bûche-chêne"] = { "bloc", title="Bûche de chêne", id='bûche-chêne', link="Bûche" },
 
["bûche-chêne-noir"] = { "bloc", title="Bûche de chêne noir", id='bûche-chêne-noir', link="Bûche" },
 
["bûche-chêne-seulement"] = { "bloc", title="Bûche de chêne", id='bûche-chêne', link="Bûche" },
 
["bûche-sapin"] = { "bloc", title="Bûche de sapin", id='bûche-sapin', link="Bûche" },
 
["cactus"] = { "bloc" },
 
["canne-pêche-enchantée"] = { "objet", id="canne-pêche", link="Canne à pêche", cannot_stack=true, note="enchantement-aléatoire" },
 
["carotte"] = { "objet" },
 
["carotte-dorée"] = { "objet" },
 
["carte-trésor-enfoui"] = { "objet", title="Carte d'exploration", link="Carte d'exploration" },
 
["carte-vierge"] = { "objet", title="Carte vierge", link="Carte (objet)" },
 
["casque-diamant"] = { "objet", title="Casque en diamant", link="Armure", cannot_stack=true },
 
["casque-fer"] = { "objet", title="Casque en fer", link="Armure", cannot_stack=true },
 
["casque-or"] = { "objet", title="Casque en or",link="Armure", cannot_stack=true },
 
["casque-mailles"] = { "objet", title="Casque de mailles",link="Armure", cannot_stack=true },
 
["chaîne"] = { "bloc" },
 
["chair-putréfiée"] = { "objet" },
 
["champignon-carmin"] = { "bloc" },
 
["champignon-marron"] = { "bloc" },
 
["champignon-rouge"] = { "bloc" },
 
["chapeau-cuir"] = { "objet", title="Chapeau en cuir", link="Armure", cannot_stack=true },
 
["charbon"] = { "objet" },
 
["cisailles"] = { "objet" },
 
["citrouille"] = { "bloc" },
 
["cloche"] = { "bloc" },
 
["cœur-de-la-mer"] = { "objet", link="Cœur de la mer" },
 
["coquelicot"] = { "bloc" },
 
["cotte-de-mailles"] = { "objet", title="Cotte de mailles", link="Armure", cannot_stack=true },
 
["crème-magma"] = { "objet", title="Crème de magma" },
 
["cristaux-de-prismarine"] = { "objet", title="Cristaux de prismarine" },
 
["crochet"] = { "bloc" },
 
["cuir"] = { "objet" },
 
["débris-antiques"] = { "bloc" },
 
["diamant"] = { "objet" },
 
["disque-doré"] = { "objet", title="Disque 13", link="Disque de musique", cannot_stack=true },
 
["disque-pigstep"] = { "objet", title="Disque Pigstep", link="Disque de musique", cannot_stack=true },
 
["disque-vert"] = { "objet", title="Disque cat", link="Disque de musique", cannot_stack=true },
 
["disque-mellohi"] = { "objet", title="Disque mellohi", link="Disque de musique", cannot_stack=true },
 
["disque-wait"] = { "objet", title="Disque wait", link="Disque de musique", cannot_stack=true },
 
["émeraude"] = { "objet" },
 
["épée-diamant"] = { "objet", title="Épée en diamant", link="Épée", cannot_stack=true },
 
["épée-fer"] = { "objet", title="Épée en fer", link="Épée", cannot_stack=true },
 
["épée-or"] = { "objet", title="Épée en or", link="Épée", cannot_stack=true },
 
["étiquette"] = { "objet" },
 
["fèves-cacao"] = { "objet" },
 
["ficelle"] = { "objet" },
 
["fiole-expérience"] = { "objet", title="Fiole d'expérience" },
 
["flèche"] = { "objet" },
 
["flèche-spectrale"] = { "objet" },
 
["fougère"] = { "bloc" },
 
["fourneau"] = { "bloc" },
 
["fragments-netherite"] = { "objet", title="Fragments de Netherite" },
 
["gâteau"] = { "bloc" },
 
["glace-bleue"] = { "bloc" },
 
["graines-betterave"] = { "objet", title="Graines de betterave", link="Graines de betterave" },
 
["graines-blé"] = { "objet", title="Graines de blé", link="Graines de blé" },
 
["graines-citrouille"] = { "objet", title="Graines de citrouille" },
 
["graines-pastèque"] = { "objet", title="Graines de pastèque" },
 
["grande fougère"] = { "bloc" },
 
["hache-bois"] = { "objet", title="Hache en bois", link="Hache", cannot_stack=true },
 
["hache-pierre"] = { "objet", title="Hache en pierre", link="Hache", cannot_stack=true },
 
["hautes-herbes"] = { "bloc" },
 
["houe-bois"] = { "objet", title="Houe en bois", link="Houe", cannot_stack=true },
 
["houe-diamant"] = { "objet", title="Houe en diamant", link="Houe", cannot_stack=true },
 
["jambières-diamant"] = { "objet", title="Jambières en diamant", link="Armure", cannot_stack=true },
 
["jambières-fer"] = { "objet", title="Jambières en fer", link="Armure", cannot_stack=true },
 
["jambières-or"] = { "objet", title="Jambières en or", link="Armure", cannot_stack=true },
 
["jambières-mailles"] = { "objet", title="Jambières de mailles", link="Armure", cannot_stack=true },
 
["laine-blanche"] = { "bloc" },
 
["laine-gris-clair"] = { "bloc" },
 
["laine-grise"] = { "bloc" },
 
["laine-marron"] = { "bloc" },
 
["laine-noire"] = { "bloc" },
 
["laisse"] = { "objet", title="Laisse", link="Laisse" },
 
["lapis-lazuli"] = { "objet", title="Lapis-lazuli", link="lapis-lazuli"},
 
["lingot-fer"] = { "objet", title="Lingot de fer" },
 
["lingot-netherite"] = { "objet", title="Lingot de Netherite" },
 
["lingot-or"] = { "objet", title="Lingot d'or" },
 
["livre"] = { "objet" },
 
["livre-vierge"] = { "objet", cannot_stack=true},
 
["livre-enchanté"] = { "objet", cannot_stack=true, note="enchantement-niveau-30" },
 
["livre-enchanté-agilité-âmes"] = { "objet", id='livre-enchanté', title="Livre enchanté", link="Livre enchanté", cannot_stack=true, note="enchantement-aléatoire-agilité-âmes" },
 
["livre-enchanté-alt"] = { "objet", id='livre-enchanté', title="Livre enchanté", link="Livre enchanté", cannot_stack=true, note="enchantement-aléatoire" },
 
["magnétite"] = { "bloc" },
 
["montre"] = { "objet" },
 
["montre"] = { "objet" },
 
["morue-cuite"] = { "objet", link="Poisson (nourriture)" },
 
["motif-bannière-groin"] = { "objet", id='motif-bannière', title="Motif de bannière Groin", link="Motif de bannière" },
 
["mouton-cru"] = { "objet", link="Mouton cru" },
 
["nylium-carmin"] = { "bloc" },
 
["obsidienne"] = { "bloc" },
 
["obsidienne-pleureuse"] = { "bloc", title="Obsidienne pleureuse" },
 
["œil-araignée"] = { "objet", title="Œil d'araignée", link="Œil d'araignée" },
 
["os"] = { "objet" },
 
["pain"] = { "objet" },
 
["pancarte-sapin"] = { "objet", title="Pancarte en sapin", id='pancarte-sapin', link="Pancarte" },
 
["pantalon-cuir"] = { "objet", title="Pantalon en cuir", link="Armure", cannot_stack=true },
 
["papier"] = { "objet" },
 
["pelle-diamant"] = { "objet", title="Pelle en diamant", link="Pelle", cannot_stack=true },
 
["pelle-fer"] = { "objet", title="Pelle en fer", link="Pelle", cannot_stack=true },
 
["pépite-fer"] = { "objet", title="Pépite de fer" },
 
["pépite-or"] = { "objet", title="Pépite d'or" },
 
["perle-ender"] = { "objet", title="Perle de l'Ender" },
 
["pierre-lumineuse"] = { "bloc" },
 
["pierre-taillée"] = { "bloc" },
 
["pioche-bois"] = { "objet", title="Pioche en bois", link="Pioche", cannot_stack=true },
 
["pioche-fer"] = { "objet", title="Pioche en fer", link="Pioche", cannot_stack=true },
 
["pioche-pierre"] = { "objet", title="Pioche en pierre", link="Pioche", cannot_stack=true },
 
["pissenlit"] = { "bloc" },
 
["planches-chêne"] = { "bloc", title="Planche de chêne", link="Planches", },
 
["plaque-pression-pondérée-légère"] = { "bloc", title="Plaque de pression pondérée légère" },
 
["plastron-diamant"] = { "objet", title="Plastron en diamant", link="Armure", cannot_stack=true },
 
["plastron-fer"] = { "objet", title="Plastron en fer", link="Armure", cannot_stack=true },
 
["plastron-or"] = { "objet", title="Plastron en or", link="Armure", cannot_stack=true },
 
["plume"] = { "objet" },
 
["poche-encre"] = { "objet", title="Poche d'encre"},
 
["pomme"] = { "objet" },
 
["pomme-dorée"] = { "objet", title="Pomme dorée", link="Pomme dorée" },
 
["pomme-dorée-enchantée"] = { "objet", title="Pomme dorée enchantée", link="Pomme dorée" },
 
["pomme-terre"] = { "objet", title="Pomme de terre" },
 
["pomme-terre-empoisonnée"] = { "objet", title="Pomme de terre empoisonnée" },
 
["porc-cru"] = { "objet", link="Porc cru" },
 
["porc-cuit"] = { "objet", link="Porc cuit" },
 
["potion-de-respiration-aquatique"] = { "objet", link='Potion' },
 
["potion-de-régénération"] = { "objet", link='Potion' },
 
["pot-fleurs"] = { "bloc", title="Pot de fleurs", link="Pot de fleurs" },
 
["poudre-canon"] = { "objet", title="Poudre à canon", article="partitif" },
 
["pousse-acacia"] = { "bloc", title="Pousse d'acacia", link="Pousse d'arbre" },
 
["pousse-chêne"] = { "bloc", title="Pousse de chêne", link="Pousse d'arbre" },
 
["pousse-sapin"] = { "bloc", title="Pousse de sapin", link="Pousse d'arbre" },
 
["quartz-nether"] = { "objet", title="Quartz du Nether" },
 
["racines-carmin"] = { "bloc" },
 
["rails"] = { "bloc" },
 
["rails-déclencheurs"] = { "bloc" },
 
["rails-détecteurs"] = { "bloc", title="Rails détecteurs" },
 
["rails-propulsion"] = { "bloc", title="Rails de propulsion" },
 
["redstone"] = { "objet" },
 
["roche"] = { "bloc" },
 
["roche-lisse"] = { "bloc", link="Roche" },
 
["roche-noire-dorée"] = { "bloc", title="Roche noire dorée", link="Roche noire" },
 
["sable"] = { "bloc" },
 
["sable-âmes"] = { "bloc", title="Sable des âmes" },
 
["saumon-cru"] = { "objet" },
 
["saumon-cuit"] = { "objet", link="Poisson (nourriture)" },
 
["seau"] = { "objet" },
 
["selle"] = { "objet", cannot_stack=true },
 
["silex"] = { "objet" },
 
["soupe-betterave"] = { "objet", title="Soupe de betteraves", link="Soupe de betteraves" },
 
["soupe-suspecte"] = { "objet", link="Soupe suspecte", note="soupe-suspecte" },
 
["tarte-citrouille"] = { "objet", title="Tarte à la citrouille" },
 
["teinture-jaune"] = { "objet" },
 
["teinture-verte"] = { "objet" },
 
["tnt"] = { "bloc", title="TNT" },
 
["torche"] = { "bloc" },
 
["tranche-pastèque-scintillante"] = { "objet", title="Tranche de pastèque scintillante" },
 
["très-hautes-herbes"] = { "bloc" },
 
["tunique-cuir"] = { "objet", title="Tunique en cuir", link="Armure", cannot_stack=true },
 
["verrues-du-nether"] = { "objet", title="Verrues du Nether" },
 
["œuf"] = { "objet" },
 
   
  +
notes = {
 
  +
["enchant-aléatoire"] = "La probabilité de tous les enchantements et niveaux d'enchantement est égale, ''y compris'' les enchantements de type Trésor (sauf [[Agilité des âmes]] et [[Furtivité rapide]]).",
  +
["enchant-aléatoire-agilité-âmes"] = "Enchanté avec un niveau aléatoire d'[[Agilité des âmes]].",
  +
["enchant-aléatoire-furtivité-rapide"] = "Enchanté avec un niveau aléatoire de [[Furtivité rapide]].",
  +
["enchant-5-15"] = "La probabilité de tous les enchantements (sauf [[Agilité des âmes]] et [[Furtivité rapide]]) est la même que pour une utilisation d'une [[table d'enchantement]] de niveau compris entre 5 et 15, mais la probabilité des enchantements multiples n'est pas réduite.",
  +
["enchant-5-20"] = "La probabilité de tous les enchantements (sauf [[Agilité des âmes]] et [[Furtivité rapide]]) est la même que pour une utilisation d'une [[table d'enchantement]] de niveau compris entre 5 et 20, mais la probabilité des enchantements multiples n'est pas réduite.",
  +
["enchant-20-25"] = "La probabilité de tous les enchantements (sauf [[Agilité des âmes]] et [[Furtivité rapide]]) est la même que pour une utilisation d'une [[table d'enchantement]] de niveau compris entre 20 et 25, mais la probabilité des enchantements multiples n'est pas réduite.",
  +
["enchant-20-39"] = "La probabilité de tous les enchantements (sauf [[Agilité des âmes]] et [[Furtivité rapide]]) est la même que pour une utilisation d'une [[table d'enchantement]] de niveau compris entre 20 et 39, mais la probabilité des enchantements multiples n'est pas réduite.",
  +
["enchant-30"] = "La probabilité de tous les enchantements (sauf [[Agilité des âmes]] et [[Furtivité rapide]]) est la même que pour une utilisation d'une [[table d'enchantement]] de niveau 30, mais la probabilité des enchantements multiples n'est pas réduite.",
  +
["enchant-30-50"] = "La probabilité de tous les enchantements (sauf [[Agilité des âmes]] et [[Furtivité rapide]]) est la même que pour une utilisation d'une [[table d'enchantement]] de niveau compris entre 30 et 50, mais la probabilité des enchantements multiples n'est pas réduite.",
   
["bottes-diamant-enchantées"] = { "objet", title="Bottes en diamant enchantées", id="bottes-diamant", link="Bottes en diamant", note="enchantement-niveau-20-39", cannot_stack=true },
 
["plastron-diamant-enchanté"] = { "objet", title="Plastron en diamant enchanté", id="plastron-diamant", link="Plastron en diamant", note="enchantement-niveau-20-39", cannot_stack=true },
 
["casque-diamant-enchanté"] = { "objet", title="Casque en diamant enchanté", id="casque-diamant", link="Casque en diamant", note="enchantement-niveau-20-39", cannot_stack=true },
 
["jambières-diamant-enchantées"] = { "objet", title="Jambières en diamant enchantées", id="jambières-diamant", link="Jambières en diamant", note="enchantement-niveau-20-39", cannot_stack=true },
 
["pioche-diamant-enchantée"] = { "objet", title="Pioche en diamant enchantée", id="pioche-diamant", link="Pioche en diamant", note="enchantement-niveau-20-39", cannot_stack=true },
 
["pioche-diamant-enchantée-aléatoire"] = { "objet", title="Pioche en diamant enchantée", id="pioche-diamant", link="Pioche en diamant", note="enchantement-aléatoire", cannot_stack=true },
 
["pelle-diamant-enchantée"] = { "objet", title="Pelle en diamant enchantée", id="pelle-diamant", link="Pelle en diamant", note="enchantement-niveau-20-39", cannot_stack=true },
 
["épée-diamant-enchantée"] = { "objet", title="Épée en diamant enchantée", id="épée-diamant", link="Épée en diamant", note="enchantement-niveau-20-39", cannot_stack=true },
 
["bottes-fer-enchantées"] = { "objet", title="Bottes en fer enchantées", id="bottes-fer", link="Bottes en fer", note="enchantement-niveau-20-39", cannot_stack=true },
 
["plastron-fer-enchanté"] = { "objet", title="Plastron en fer enchanté", id="plastron-fer", link="Plastron en fer", note="enchantement-niveau-20-39", cannot_stack=true },
 
["casque-fer-enchanté"] = { "objet", title="Casque en fer enchanté", id="casque-fer", link="Casque en fer", note="enchantement-niveau-20-39", cannot_stack=true },
 
["jambières-fer-enchantées"] = { "objet", title="Jambières en fer enchantées", id="jambières-fer", link="Jambières en fer", note="enchantement-niveau-20-39", cannot_stack=true },
 
["pioche-fer-enchantée"] = { "objet", title="Pioche en fer enchantée", id="pioche-fer", link="Pioche en fer", note="enchantement-niveau-20-39", cannot_stack=true },
 
["pelle-fer-enchantée"] = { "objet", title="Pelle en fer enchantée", id="pelle-fer", link="Pelle en fer", note="enchantement-niveau-20-39", cannot_stack=true },
 
["épée-fer-enchantée"] = { "objet", title="Épée en fer enchantée", id="épée-fer", link="Épée en fer", note="enchantement-niveau-20-39", cannot_stack=true },
 
["bottes-or-enchantées"] = { "objet", title="Bottes en or enchantées", id="bottes-or", link="Bottes en or", note="enchantement-aléatoire", cannot_stack=true },
 
["bottes-or-enchantées-agilité-âmes"] = { "objet", title="Bottes en or enchantées avec agilité des âmes", id="bottes-or", link="Bottes en or", note="enchantement-aléatoire-agilité-âmes", cannot_stack=true },
 
["plastron-or-enchanté"] = { "objet", title="Plastron en or enchanté", id="plastron-or", link="Plastron en or", note="enchantement-aléatoire", cannot_stack=true },
 
["casque-or-enchanté"] = { "objet", title="Casque en or enchanté", id="casque-or", link="Casque en or", note="enchantement-aléatoire", cannot_stack=true },
 
["jambières-or-enchantées"] = { "objet", title="Jambières en or enchantées", id="jambières-or", link="Jambières en or", note="enchantement-aléatoire", cannot_stack=true },
 
["hache-or-enchantée"] = { "objet", title="Hache en or enchantée", id="hache-or", link="Hache en or", note="enchantement-aléatoire", cannot_stack=true },
 
["houe-or-enchantée"] = { "objet", title="Houe en or enchantée", id="houe-or", link="Houe en or", note="enchantement-aléatoire", cannot_stack=true },
 
["pioche-or-enchantée"] = { "objet", title="Pioche en or enchantée", id="pioche-or", link="Pioche en or", note="enchantement-aléatoire", cannot_stack=true },
 
["pelle-or-enchantée"] = { "objet", title="Pelle en or enchantées", id="pelle-or", link="Pelle en or", note="enchantement-aléatoire", cannot_stack=true },
 
["épée-or-enchantée"] = { "objet", title="Épée en or enchantée", id="épée-or", link="Épée en or", note="enchantement-aléatoire", cannot_stack=true },
 
["chapeau-cuir-enchanté"] = { "objet", title="Chapeau en cuir enchanté", id="chapeau-cuir", link="Armure", note="enchantement-aléatoire", cannot_stack=true },
 
["tunique-cuir-enchantée"] = { "objet", title="Tunique en cuir enchantée", id="tunique-cuir", link="Armure", note="enchantement-aléatoire", cannot_stack=true },
 
["pantalon-cuir-enchanté"] = { "objet", title="Pantalon en cuir enchanté", id="pantalon-cuir", link="Armure", note="enchantement-aléatoire", cannot_stack=true },
 
["bottes-cuir-enchantées"] = { "objet", title="Bottes en cuir enchantées", id="bottes-cuir", link="Armure", note="enchantement-aléatoire", cannot_stack=true },
 
["chapeau-cuir-enchanté"] = { "objet", title="Chapeau en cuir enchanté", id="chapeau-cuir", link="Armure", note="enchantement-aléatoire", cannot_stack=true },
 
["tunique-cuir-enchantée"] = { "objet", title="Tunique en cuir enchantée", id="tunique-cuir", link="Armure", note="enchantement-aléatoire", cannot_stack=true },
 
["pantalon-cuir-enchanté"] = { "objet", title="Pantalon en cuir enchanté", id="pantalon-cuir", link="Armure", note="enchantement-aléatoire", cannot_stack=true },
 
["bottes-cuir-enchantées"] = { "objet", title="Bottes en cuir enchantées", id="bottes-cuir", link="Armure", note="enchantement-aléatoire", cannot_stack=true },
 
["arbalète-enchantée-endommagée"] = { "objet", title="Arbalète enchantée endommagée", id="arbalète", link="Arbalète", note="enchantement-aléatoire", note1="endommagé-0.1-0.5", cannot_stack=true },
 
["arbalète-enchantée-endommagée-2"] = { "objet", title="Arbalète enchantée endommagée", id="arbalète", link="Arbalète", note="enchantement-aléatoire", note1="endommagé-0.1-0.9", cannot_stack=true },
 
 
["épée-fer-enchantée-endommagée"] = { "objet", title="Épée en fer enchantée endommagée", id="épée-fer", link="Épée", note="enchantement-aléatoire", note="endommagé-0.8-1.0", cannot_stack=true },
 
["bottes-diamant-enchantées-endommagées"] = { "objet", title="Bottes en diamant enchantées endommagées", id="bottes-diamant", link="Bottes", note="enchantement-aléatoire", note1="endommagé-0.8-1.0", cannot_stack=true },
 
["plastron-diamant-enchanté-endommagé"] = { "objet", title="Plastron en diamant enchanté endommagé", id="plastron-diamant", link="Plastron", note="enchantement-aléatoire", note1="endommagé-0.8-1.0", cannot_stack=true },
 
["casque-diamant-enchanté-endommagé"] = { "objet", title="Casque en diamant enchanté endommagé", id="casque-diamant", link="Casque", note="enchantement-aléatoire", note1="endommagé-0.8-1.0", cannot_stack=true },
 
["jambières-diamant-enchantées-endommagées"] = { "objet", title="Jambières en diamant enchantées endommagées", id="jambières-diamant", link="Jambières", note="enchantement-aléatoire", note1="endommagé-0.8-1.0", cannot_stack=true },
 
["pelle-diamant-enchantée-endommagée"] = { "objet", title="Pelle en diamant enchantée endommagée", id="pelle-diamant", link="Pelle", note="enchantement-aléatoire", note1="endommagé-0.15-0.8", cannot_stack=true },
 
["épée-diamant-enchantée-endommagée"] = { "objet", title="Épée en diamant enchantée endommagée", id="épée-diamant", link="Épée", note="enchantement-aléatoire", note="endommagé-0.8-1.0", cannot_stack=true },
 
["pioche-diamant-enchantée-endommagée"] = { "objet", title="Pioche en diamant enchantée endommagée", id="pioche-diamant", link="Pioche", note="enchantement-aléatoire", note="endommagé-0.15-0.95", cannot_stack=true },
 
["bottes-diamant-endommagées"] = { "objet", title="Bottes en diamant endommagées", id="bottes-diamant", link="Bottes", note="endommagé-0.2-0.65", cannot_stack=true },
 
["plastron-diamant-endommagé"] = { "objet", title="Plastron en diamant endommagé", id="plastron-diamant", link="Plastron", note="endommagé-0.2-0.65", cannot_stack=true },
 
["casque-diamant-endommagé"] = { "objet", title="Casque en diamant endommagé", id="casque-diamant", link="Casque", note="endommagé-0.2-0.65", cannot_stack=true },
 
["jambières-diamant-endommagées"] = { "objet", title="Jambières en diamant endommagées", id="jambières-diamant", link="Jambières", note="endommagé-0.2-0.65", cannot_stack=true },
 
["épée-diamant-endommagée"] = { "objet", title="Épée en diamant endommagée", id="épée-diamant", link="Épée", note="endommagé-0.2-0.65", cannot_stack=true },
 
 
["vide"] = { "bloc", id="air", link='', title="Rien", note="rien" },
 
},
 
 
notes = {
 
["enchantement-aléatoire"] = "La probabilité de tous les enchantements et niveaux d'enchantement est égale, ''y compris'' les enchantements de type Trésor (sauf [[Agilité des âmes]]).",
 
["enchantement-aléatoire-agilité-âmes"] = "Enchanté avec un niveau aléatoire d'[[Agilité des âmes]].",
 
["enchantement-niveau-5-15"] = "La probabilité de tous les enchantements (sauf [[Agilité des âmes]]) est la même que pour une utilisation d'une [[table d'enchantement]] pour un niveau compris entre 5 et 15, mais la probabilité des enchantements multiples n'est pas réduite.",
 
["enchantement-niveau-5-20"] = "La probabilité de tous les enchantements (sauf [[Agilité des âmes]]) est la même que pour une utilisation d'une [[table d'enchantement]] pour un niveau compris entre 5 et 20, mais la probabilité des enchantements multiples n'est pas réduite.",
 
["enchantement-niveau-20-25"] = "La probabilité de tous les enchantements (sauf [[Agilité des âmes]]) est la même que pour une utilisation d'une [[table d'enchantement]] pour un niveau compris entre 20 et 25, mais la probabilité des enchantements multiples n'est pas réduite.",
 
["enchantement-niveau-20-39"] = "La probabilité de tous les enchantements (sauf [[Agilité des âmes]]) est la même que pour une utilisation d'une [[table d'enchantement]] pour un niveau compris entre 20 et 39, mais la probabilité des enchantements multiples n'est pas réduite.",
 
["enchantement-niveau-30"] = "La probabilité de tous les enchantements (sauf [[Agilité des âmes]]) est la même que pour une utilisation d'une [[table d'enchantement]] de niveau 30, mais la probabilité des enchantements multiples n'est pas réduite.",
 
["livre-aléatoire"] = "Tous les enchantements et tous les niveaux d'enchantement ont la même probabilité.",
 
 
["endommagé-0.05-0.15"] = "L'objet aura entre 5 % et 15 % de sa durabilité totale.",
 
["endommagé-0.05-0.15"] = "L'objet aura entre 5 % et 15 % de sa durabilité totale.",
 
["endommagé-0.1-0.5"] = "L'objet aura entre 10 % et 50 % de sa durabilité totale.",
 
["endommagé-0.1-0.5"] = "L'objet aura entre 10 % et 50 % de sa durabilité totale.",
Ligne 298 : Ligne 74 :
 
["endommagé-0.8-1.0"] = "L'objet aura entre 80 % et 100 % de sa durabilité totale.",
 
["endommagé-0.8-1.0"] = "L'objet aura entre 80 % et 100 % de sa durabilité totale.",
 
["rien"] = "'Rien' ne fait pas référence à la chance d'avoir un coffre vide. Il fait plutôt référence à la chance que le générateur de butin aléatoire n'ajoute aucun butin ''sur un seul jet .",
 
["rien"] = "'Rien' ne fait pas référence à la chance d'avoir un coffre vide. Il fait plutôt référence à la chance que le générateur de butin aléatoire n'ajoute aucun butin ''sur un seul jet .",
  +
["soupe-suspecte"] = "La soupe confère l'un des effets suivants : 5 à 7 secondes de [[Cécité]], 7 à 10 secondes de [[Sauts améliorés]], 7 à 10 secondes de [[Nyctalopie]], 10 à 20 secondes de [[Poison]], 7 à 10 secondes de [[Saturation]] ou 6 à 8 secondes de [[Faiblesse]].",
 
  +
["soupe-suspecte"] = "La soupe confère l'un des effets suivants : 5 à 7 secondes de [[Cécité]], 7 à 10 secondes de [[Sauts améliorés]], 7 à 10 secondes de [[Nyctalopie]], 10 à 20 secondes de [[Poison]], 7 à 10 secondes de [[Saturation]] ou 6 à 8 secondes de [[Faiblesse]].",
  +
["soupe-suspecte-2"] = "La soupe confère l'un des effets suivants : 5 à 7 secondes de [[Cécité]] ou 7 à 10 secondes de [[Nyctalopie]].",
  +
 
},
 
},
  +
  +
-- <ref group='FN' name='enchant-randomly'>
 
 
 
-- NOTE: order here doesn't matter.
 
-- NOTE: order here doesn't matter.
-- * in the table, chests will sort in alphabetical order
+
-- * in the table, chests are sorted in alphabetical order
-- * in the table, items will sort by chance, then by avg#, then alphabetically.
+
-- * in the table, items are sorted by chance, then by avg#, then alphabetically.
-- * If poolsDev is omitted, pools will be used. To omit a pool entirely in the dev version, set poolsDev = {}.
+
-- * If poolsJavaUpcoming is omitted, poolsJava is used. To omit a pool entirely, set it to {}.
  +
-- * If the loot is the same on both editions, use the same loot table twice.
 
 
  +
chests = require("Module:CoffreRécompenses/coffres"),
chests = {
 
["avant-poste-de-pillards"] = { -- pillager_outpost.json
 
header = "Avant-poste de pillards",
 
link = "[[Avant-poste de pillards]]",
 
structure = "Avant-poste de pillards",
 
conteneur = "Coffre des pillards",
 
structID = "avant-poste-de-pillards",
 
pools = {
 
{
 
rolls = {0,1},
 
items = {
 
["arbalète"] = {1,1,1},
 
}
 
},
 
{
 
rolls = {2,3},
 
items = {
 
["blé"] = {3,5,7},
 
["pomme-terre"] = {2,5,5},
 
["carotte"] = {3,5,5}
 
}
 
},
 
{
 
rolls = {1,3},
 
items = {
 
["bûche-chêne-noir"] = {2,3,1}
 
}
 
},
 
{
 
rolls = {2,3},
 
items = {
 
["fiole-expérience"] = {1,1,7},
 
["fil"] = {1,6,4},
 
["flèche"] = {2,7,4},
 
["crochet"] = {1,3,3},
 
["lingot-fer"] = {1,3,3},
 
["livre-enchanté-alt"] = {1,1,1}
 
}
 
},
 
},
 
poolsDev = {},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
},
 
["carte-d'épave-de-navire"] = { -- shipwreck_map.json
 
header = "Coffre à carte",
 
superheader = "[[Épave de navire]]",
 
link = "carte d'[[épave de navire]]",
 
structure = "Épave de navire",
 
conteneur = "Coffre à carte",
 
structID = "épave-navire",
 
pools = {
 
{
 
rolls = {1,1},
 
items = {
 
["carte-trésor-enfoui"] = {1,1,1},
 
}
 
},
 
{
 
rolls = {3,3},
 
items = {
 
["boussole"] = {1,1,1},
 
["carte-vierge"] = {1,1,1},
 
["montre"] = {1,1,1},
 
["papier"] = {1,10,20},
 
["plume"] = {1,5,10},
 
["livre"] = {1,5,5},
 
}
 
}
 
},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
poolsDev = {}
 
 
},
 
["réserve-d'épave-de-navire"] = { -- shipwreck_supply.json
 
header = "Réserve",
 
superheader = "[[\Épave de navire]]",
 
link = "réserve d'[[épave de navire]]",
 
structure = "Épave de navire",
 
conteneur = "Coffre de la réserve",
 
structID = "épave-navire",
 
poolsDevBedrock = {},
 
poolsDev = {},
 
pools = {
 
{
 
rolls = {3,10},
 
items = {
 
["papier"] = {1,12,8},
 
['pomme-terre'] = {2,6,7},
 
['pomme-terre-empoisonnée'] = {2,6,7},
 
["soupe-suspecte"] = {1,1,10},
 
["carotte"] = {4,8,7},
 
["blé"] = {8,21,7},
 
["bambou"] = {1,3,2},
 
["charbon"] = {2,8,6},
 
["chair-putréfiée"] = {5,24,5},
 
["citrouille"] = {1,3,2},
 
["poudre-canon"] = {1,5,3},
 
["tnt"] = {1,2,1},
 
["chapeau-cuir-enchanté"] = {1,1,3},
 
["tunique-cuir-enchantée"] = {1,1,3},
 
["pantalon-cuir-enchanté"] = {1,1,3},
 
["bottes-cuir-enchantées"] = {1,1,3},
 
}
 
},
 
},
 
poolsBedrock = pools,
 
},
 
["trésor-d'épave-de-navire"] = { -- shipwreck_treasure.json
 
header = "Trésor",
 
superheader = "[[Épave de navire]]",
 
link = "trésor d'[[épave de navire]]",
 
structure = "Épave de navire",
 
conteneur = "Coffre du trésor",
 
structID = "épave-navire",
 
pools = {
 
{
 
rolls = {3,6},
 
items = {
 
["lingot-fer"] = {1,5,90},
 
["lingot-or"] = {1,5,10},
 
["emeraude"] = {1,5,40},
 
["diamant"] = {1,1,5},
 
['fiole-expérience'] = {1,1,5},
 
}
 
},
 
{
 
rolls = {2,5},
 
items = {
 
["pépite-fer"] = {1,10,50},
 
["pépite-or"] = {1,10,10},
 
["lapis-lazuli"] = {1,10,20},
 
}
 
}
 
},
 
poolsBedrock = {},
 
poolsDevBedrock = {},
 
poolsDev = {}
 
},
 
["trésor-enfoui"] = { -- buried_treasure.json
 
header = "Trésor enfoui",
 
link = "[[trésor enfoui]]",
 
structure = "Trésor enfoui",
 
conteneur = "Coffre au trésor",
 
structID = "trésor-enfoui",
 
pools = {
 
{
 
rolls = {1,1},
 
items = {
 
["cœur-de-la-mer"] = {1,1,1},
 
}
 
},
 
{
 
rolls = {5,8},
 
items = {
 
["lingot-fer"] = {1,4,20},
 
["lingot-or"] = {1,4,10},
 
["tnt"] = {1,2,5},
 
}
 
},
 
{
 
rolls = {1,3},
 
items = {
 
["émeraude"] = {4,8,5},
 
["diamant"] = {1,2,5},
 
["cristaux-de-prismarine"] = {1,5,5},
 
}
 
},
 
{
 
rolls = {0,1},
 
items = {
 
["tunique-cuir"] = {1,1,1},
 
["épée-fer"] = {1,1,1},
 
}
 
},
 
{
 
rolls = {2,2},
 
items = {
 
["morue-cuite"] = {2,4,1},
 
["saumon-cuit"] = {2,4,1},
 
}
 
},
 
},
 
poolsBedrock = {
 
{
 
rolls = {1,1},
 
items = {
 
["cœur-de-la-mer"] = {1,1,1},
 
}
 
},
 
{
 
rolls = {5,12},
 
items = {
 
["cristaux-de-prismarine"] = {1,5,5},
 
["lingot-fer"] = {3,5,20},
 
["lingot-or"] = {1,5,10},
 
["tnt"] = {1,2,10},
 
["diamant"] = {1,1,15},
 
["disque-wait"] = {1,1,5},
 
["disque-mellohi"] = {1,1,5},
 
["étiquette"] = {1,1,10},
 
["cottes-mailles"] = {1,1,20},
 
["casque-mailles"] = {1,1,20},
 
["jambières-mailles"] = {1,1,20},
 
["bottes-mailles"] = {1,1,20},
 
["livre-vierge"] = {1,2,5},
 
["laisse"] = {1,3,10},
 
["fiole-expérience"] = {1,1,3},
 
["potion-de-respiration-aquatique"] = {1,1,15},
 
["potion-de-régéneration"] = {1,1,10},
 
["gâteau"] = {1,1,1},
 
}
 
},
 
},
 
poolsDevBedrock = {},
 
poolsDev = {}
 
},
 
["grande-ruine-sous-marine"] = { -- underwater_ruin_big.json
 
header = "Grande",
 
superheader = "[[Ruines sous-marines]]",
 
link = "grandes [[ruines sous-marines]]",
 
structure = "Ruines sous-marines",
 
conteneur = "Coffre de grande ruine",
 
structID = "ruines-sous-marines",
 
pools = {
 
{
 
rolls = {2,8},
 
items = {
 
["charbon"] = {1,4,10},
 
["pépite-or"] = {1,3,10},
 
["émeraude"] = {1,1,1},
 
["blé"] = {2,3,10},
 
}
 
},
 
{
 
rolls = {1,1},
 
items = {
 
["pomme-dorée"] = {1,1,1},
 
["livre-enchanté"] = {1,1,5},
 
["tunique-cuir"] = {1,1,1},
 
["casque-or"] = {1,1,1},
 
["canne-pêche-enchantée"] = {1,1,5},
 
["carte-trésor-enfoui"] = {1,1,10},
 
}
 
},
 
},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
poolsDev = {}
 
},
 
["petite-ruine-sous-marine"] = { -- underwater_ruin_small.json
 
header = "Petite",
 
superheader = "[[Ruines sous-marines]]",
 
link = "petites [[ruines sous-marines]]",
 
structure = "Ruines sous-marines",
 
conteneur = "Coffre de petite ruine",
 
structID = "ruines-sous-marines",
 
pools = {
 
{
 
rolls = {2,8},
 
items = {
 
["charbon"] = {1,4,10},
 
["hache-pierre"] = {1,1,2},
 
["chair-putréfiée"] = {1,1,5},
 
["émeraude"] = {1,1,1},
 
["blé"] = {2,3,10},
 
}
 
},
 
{
 
rolls = {1,1},
 
items = {
 
["tunique-cuir"] = {1,1,1},
 
["casque-or"] = {1,1,1},
 
["canne-pêche-enchantée"] = {1,1,5},
 
["carte-trésor-enfoui"] = {1,1,5},
 
}
 
},
 
},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
poolsDev = {}
 
},
 
["village-armurerie"] = { -- village\village_armorer.json
 
header = "Armurerie",
 
superheader = "[[Village]]",
 
link = "Armurerie de [[village]]",
 
structure = "Village",
 
conteneur = "Coffre de l'armurerie",
 
structID = "village",
 
pools = {
 
{
 
rolls = {1,5},
 
items = {
 
["lingot-fer"] = {1,3,2},
 
["pain"] = {1,4,4},
 
["casque-fer"] = {1,1,1},
 
["émeraude"] = {1,1,1}
 
}
 
},
 
},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
poolsDev = {},
 
},
 
["village-boucherie"] = { -- village\village_butcher.json
 
header = "Boucherie",
 
superheader = "[[Village]]",
 
link = "Boucherie de [[village]]",
 
structure = "Village",
 
conteneur = "Coffre de boucher",
 
structID = "village",
 
pools = {
 
{
 
rolls = {1,5},
 
items = {
 
["émeraude"] = {1,1,1},
 
["porc-cru"] = {1,3,6},
 
["blé"] = {1,3,6},
 
["bœuf"] = {1,3,6},
 
["mouton-cru"] = {1,3,6},
 
["charbon"] = {1,3,3}
 
}
 
},
 
},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
poolsDev = {},
 
},
 
["village-cartographe"] = { -- village\village_cartographer.json
 
header = "Cartographe",
 
superheader = "[[Village]]",
 
link = "Cartographe de [[village]]",
 
structure = "Village",
 
conteneur = "Coffre de cartographe",
 
structID = "village",
 
pools = {
 
{
 
rolls = {1,5},
 
items = {
 
["carte-vierge"] = {1,3,10},
 
["papier"] = {1,5,15},
 
["boussole"] = {1,1,5},
 
["pain"] = {1,4,15},
 
["bâton"] = {1,2,5}
 
}
 
},
 
},
 
pools = {
 
{
 
rolls = {1,5},
 
items = {
 
["carte-vierge"] = {1,3,10},
 
["papier"] = {1,5,15},
 
["boussole"] = {1,1,5},
 
["pain"] = {1,4,15},
 
["pousse-chêne"] = {1,2,5}
 
}
 
},
 
},
 
poolsDevBedrock = {},
 
poolsDev = {},
 
},
 
["village-fléchier"] = { -- village\village_fletcher.json
 
header = "Fléchier",
 
superheader = "[[Village]]",
 
link = "Fléchier de [[village]]",
 
structure = "Village",
 
conteneur = "Coffre de fléchier",
 
structID = "village",
 
pools = {
 
{
 
rolls = {1,5},
 
items = {
 
["émeraude"] = {1,1,1},
 
["flèche"] = {1,3,2},
 
["plume"] = {1,3,6},
 
["œuf"] = {1,3,2},
 
["briquet"] = {1,3,6},
 
["bâton"] = {1,3,6}
 
}
 
},
 
},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
poolsDev = {},
 
},
 
["village-maçon"] = { -- village\village_mason.json
 
header = "Maçon",
 
superheader = "[[Village]]",
 
link = "Maçon de [[village]]",
 
structure = "Village",
 
conteneur = "Coffre de maçon",
 
structID = "village",
 
pools = {
 
{
 
rolls = {1,5},
 
items = {
 
["argile"] = {1,3,1},
 
["pot-fleurs"] = {1,1,1},
 
["roche"] = {1,1,2},
 
["pierre-taillée"] = {1,1,2},
 
["pain"] = {1,4,4},
 
["teinture-jaune"] = {1,1,1},
 
["roche-lisse"] = {1,1,1},
 
["émeraude"] = {1,1,1}
 
}
 
},
 
},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
poolsDev = {},
 
},
 
["village-bergerie"] = { -- village\village_shepherd.json
 
header = "Bergerie",
 
superheader = "[[Village]]",
 
link = "Bergerie de [[village]]",
 
structure = "Village",
 
conteneur = "Coffre de bergerie",
 
structID = "village",
 
pools = {
 
{
 
rolls = {1,5},
 
items = {
 
["laine-blanche"] = {1,8,6},
 
["laine-noire"] = {1,3,3},
 
["laine-grise"] = {1,3,2},
 
["laine-marron"] = {1,3,2},
 
["laine-gris-clair"] = {1,3,2},
 
["émeraude"] = {1,1,1},
 
["cisailles"] = {1,1,1},
 
["blé"] = {1,6,6}
 
}
 
},
 
},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
poolsDev = {},
 
},
 
["village-tannerie"] = { -- village\village_tannery.json
 
header = "Tannerie",
 
superheader = "[[Village]]",
 
link = "Tannerie de [[village]]",
 
structure = "Village",
 
conteneur = "Coffre de tannerie",
 
structID = "village",
 
pools = {
 
{
 
rolls = {1,5},
 
items = {
 
["cuir"] = {1,3,1},
 
["tunique-cuir"] = {1,1,2},
 
["bottes-cuir"] = {1,1,2},
 
["chapeau-cuir"] = {1,1,2},
 
["pain"] = {1,4,5},
 
["pantalon-cuir"] = {1,1,2},
 
["selle"] = {1,1,1},
 
["émeraude"] = {1,4,1}
 
}
 
},
 
},
 
poolsDev = {},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
},
 
["village-temple"] = { -- village\village_temple.json
 
header = "Temple",
 
superheader = "[[Village]]",
 
link = "Temple de [[village]]",
 
structure = "Village",
 
conteneur = "Coffre de temple",
 
structID = "village",
 
pools = {
 
{
 
rolls = {3,8},
 
items = {
 
["redstone"] = {1,4,2},
 
["pain"] = {1,4,7},
 
["chair-putréfiée"] = {1,4,7},
 
["lapis-lazuli"] = {1,4,1},
 
["lingot-or"] = {1,4,1},
 
["émeraude"] = {1,4,1}
 
}
 
},
 
},
 
poolsDev = {},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
},
 
["village-forgeron-outils"] = { -- village\village_toolsmith.json
 
header = "Forgeron d'outils",
 
superheader = "[[Village]]",
 
link = "Forgeron d'outils de [[village]]",
 
structure = "Village",
 
conteneur = "Coffre de forgeron d'outils",
 
structID = "village",
 
pools = {
 
{
 
rolls = {3,8},
 
items = {
 
["diamant"] = {1,3,1},
 
["lingot-fer"] = {1,5,5},
 
["lingot-or"] = {1,3,1},
 
["pain"] = {1,3,15},
 
["pioche-fer"] = {1,1,5},
 
["charbon"] = {1,3,1},
 
["bâton"] = {1,3,20},
 
["pelle-fer"] = {1,1,5}
 
}
 
},
 
},
 
poolsDev = {},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
},
 
["village-forgeron-armes"] = { -- village\village_weaponsmith.json
 
header = "Forgeron d'armes",
 
superheader = "[[Village]]",
 
link = "Forgeron d'armes de [[village]]",
 
structure = "Village",
 
conteneur = "Coffre de forgeron d'armes",
 
structID = "village",
 
pools = {
 
{
 
rolls = {3,8},
 
items = {
 
["diamant"] = {1,3,3},
 
["lingot-fer"] = {1,5,10},
 
["lingot-or"] = {1,3,5},
 
["pain"] = {1,3,15},
 
["pomme"] = {1,3,15},
 
["pioche-fer"] = {1,1,5},
 
["épée-fer"] = {1,1,5},
 
["plastron-fer"] = {1,1,5},
 
["casque-fer"] = {1,1,5},
 
["jambières-fer"] = {1,1,5},
 
["bottes-fer"] = {1,1,5},
 
["obsidienne"] = {3,7,5},
 
["pousse-chêne"] = {3,7,5},
 
["armure-cheval-fer"] = {1,1,1},
 
["armure-cheval-or"] = {1,1,1},
 
["armure-cheval-diamant"] = {1,1,1},
 
["selle"] = {1,1,3}
 
}
 
},
 
},
 
poolsDev = {},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
},
 
["village-désert"] = { -- village\village_desert_house.json
 
header = "Maison du désert",
 
superheader = "[[Village]]",
 
link = "Maison de [[village]] du désert",
 
structure = "Village",
 
conteneur = "Coffre de maison du désert",
 
structID = "village",
 
pools = {
 
{
 
rolls = {3,8},
 
items = {
 
["argile"] = {1,1,1},
 
["teinture-verte"] = {1,1,1},
 
["cactus"] = {1,4,10},
 
["blé"] = {1,7,10},
 
["pain"] = {1,4,10},
 
["livre"] = {1,1,1},
 
["arbuste-mort"] = {1,3,2},
 
["émeraude"] = {1,3,1}
 
}
 
},
 
},
 
poolsDev = {},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
},
 
["village-plaine"] = { -- village\village_plains_house.json
 
header = "Maison des plaines",
 
superheader = "[[Village]]",
 
link = "Maison de [[village]] des plaines",
 
structure = "Village",
 
conteneur = "Coffre de maison des plaines",
 
structID = "village",
 
pools = {
 
{
 
rolls = {3,8},
 
items = {
 
["pépite-or"] = {1,3,1},
 
["pissenlit"] = {1,1,1},
 
["coquelicot"] = {1,1,1},
 
["pomme-terre"] = {1,7,10},
 
["pain"] = {1,4,10},
 
["pomme"] = {1,5,10},
 
["émeraude"] = {1,4,2},
 
["pousse-chêne"] = {1,2,5}
 
}
 
},
 
},
 
poolsDev = {},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
},
 
["village-savane"] = { -- village\village_savanna_house.json
 
header = "Maison de la savane",
 
superheader = "[[Village]]",
 
link = "Maison de [[village]] de la savane",
 
structure = "Village",
 
conteneur = "Coffre de maison de la savane",
 
structID = "village",
 
pools = {
 
{
 
rolls = {3,8},
 
items = {
 
["pépite-or"] = {1,3,1},
 
["herbe"] = {1,1,5},
 
["hautes-herbes"] = {1,1,5},
 
["blé"] = {1,4,10},
 
["graines-blé"] = {1,5,10},
 
["émeraude"] = {1,4,2},
 
["pousse-acacia"] = {1,2,10},
 
["selle"] = {1,1,1},
 
["torche"] = {1,2,1},
 
["seau"] = {1,1,1}
 
}
 
},
 
},
 
poolsDev = {},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
},
 
["village-toundra"] = { -- village\village_snowy_house.json
 
header = "Maison de la toundra",
 
superheader = "[[Village]]",
 
link = "Maison de [[village]] de la toundra",
 
structure = "Village",
 
conteneur = "Coffre de maison de la toundra",
 
structID = "village",
 
pools = {
 
{
 
rolls = {3,8},
 
items = {
 
["glace-bleue"] = {1,1,1},
 
["bloc-neige"] = {1,1,4},
 
["pomme-terre"] = {1,7,10},
 
["pain"] = {1,4,10},
 
["graines-betterave"] = {1,5,10},
 
["soupe-betteraves"] = {1,1,1},
 
["fourneau"] = {1,1,1},
 
["émeraude"] = {1,4,1},
 
["boule-de-neige"] = {1,7,10},
 
["charbon"] = {1,4,5}
 
}
 
},
 
},
 
poolsDev = {},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
},
 
["village-taïga"] = { -- village\village_taiga_house.json
 
header = "Maison de la taïga",
 
superheader = "[[Village]]",
 
link = "Maison de [[village]] de la taïga",
 
structure = "Village",
 
conteneur = "Coffre de maison de la taïga",
 
structID = "village",
 
pools = {
 
{
 
rolls = {3,8},
 
items = {
 
["pépite-fer"] = {1,5,1},
 
["fougère"] = {1,1,2},
 
["grande-fougère"] = {1,1,2},
 
["pomme-terre"] = {1,7,10},
 
["baies-sucrées"] = {1,7,5},
 
["pain"] = {1,4,10},
 
["graines-citrouille"] = {1,5,5},
 
["tarte-citrouille"] = {1,1,1},
 
["émeraude"] = {1,4,2},
 
["pousse-sapin"] = {1,5,5},
 
["pancarte-sapin"] = {1,1,1},
 
["bûche-sapin"] = {1,5,10}
 
}
 
},
 
},
 
poolsDev = {},
 
poolsBedrock = {
 
{
 
rolls = {3,8},
 
items = {
 
["pépite-fer"] = {1,5,1},
 
["fougère"] = {1,1,2},
 
["grande-fougère"] = {1,1,2},
 
["pomme-terre"] = {1,7,10},
 
["pain"] = {1,4,10},
 
["graines-citrouille"] = {1,5,5},
 
["tarte-citrouille"] = {1,1,1},
 
["émeraude"] = {1,4,2},
 
["pousse-sapin"] = {1,5,5},
 
["pancarte-chêne"] = {1,1,1},
 
["bûche-sapin"] = {1,5,10}
 
}
 
},
 
},
 
poolsDevBedrock = {},
 
},
 
["village-maison-2-pièces"] = { -- village\village_two_room_house.json
 
header = "Maison 2 pièces",
 
superheader = "[[Village]]",
 
link = "Maison 2 pièces de [[village]]",
 
structure = "Village",
 
conteneur = "Coffre de maison 2 piéces",
 
structID = "village",
 
poolsBedrock = {},
 
poolsDevBedrock = {},
 
poolsDev = {},
 
pools = {
 
{
 
rolls = {6,8},
 
items = {
 
["pomme-terre"] = {5,8,10},
 
["carotte"] = {4,8,10},
 
["blé"] = {8,12,15},
 
["graines-blé"] = {2,4,5},
 
["betterave"] = {5,8,5},
 
["houe-bois"] = {1,1,1}
 
}
 
},
 
}
 
},
 
["autel-fort"] = {
 
header = "Autel",
 
superheader = "[[Fort]]",
 
link = "autel de [[fort]]",
 
structure = "Forts",
 
conteneur = "Coffre de l'autel",
 
structID = "fort",
 
pools = {
 
{
 
rolls = {2,3},
 
items = {
 
["diamant"] = {1,3,3},
 
["lingot-fer"] = {1,5,10},
 
["lingot-or"] = {1,3,5},
 
["pain"] = {1,3,15},
 
["pomme"] = {1,3,15},
 
["pioche-fer"] = {1,1,5},
 
["épée-fer"] = {1,1,5},
 
["plastron-fer"] = {1,1,5},
 
["casque-fer"] = {1,1,5},
 
["jambières-fer"] = {1,1,5},
 
["bottes-fer"] = {1,1,5},
 
["armure-cheval-fer"] = {1,1,1},
 
["armure-cheval-or"] = {1,1,1},
 
["armure-cheval-diamant"] = {1,1,1},
 
["perle-ender"] = {1,1,10},
 
["redstone"] = {4,9,5},
 
["pomme-dorée"] = {1,1,1},
 
["selle"] = {1,1,1},
 
["livre-enchanté"] = {1,1,1}
 
}
 
},
 
},
 
poolsBedrock = {
 
{
 
rolls = {2,3},
 
items = {
 
["perle-ender"] = {1,1,50},
 
["diamant"] = {1,3,15},
 
["émeraude"] = {1,3,15},
 
["lingot-fer"] = {1,5,50},
 
["lingot-or"] = {1,3,25},
 
["pain"] = {1,3,75},
 
["pomme"] = {1,3,75},
 
["pioche-fer"] = {1,1,25},
 
["épée-fer"] = {1,1,25},
 
["plastron-fer"] = {1,1,25},
 
["casque-fer"] = {1,1,25},
 
["jambières-fer"] = {1,1,25},
 
["bottes-fer"] = {1,1,25},
 
["armure-cheval-fer"] = {1,1,5},
 
["armure-cheval-or"] = {1,1,5},
 
["armure-cheval-diamant"] = {1,1,5},
 
["redstone"] = {4,9,25},
 
["pomme-dorée"] = {1,1,5},
 
["selle"] = {1,1,5},
 
["livre-enchanté"] = {1,1,6}
 
}
 
},
 
},
 
poolsDevBedrock = {},
 
poolsDev = {}
 
},
 
["bibliothèque-fort"] = {
 
header = "Bibliothèque",
 
superheader = "[[Fort]]",
 
link = "bibliothèque de [[fort]]",
 
structure = "Forts",
 
conteneur = "Coffre de bibliothèque",
 
structID = "fort",
 
pools = {
 
{
 
rolls = {2,10},
 
items = {
 
["livre-enchanté"] = {1,1,10},
 
["livre"] = {1,3,20},
 
["papier"] = {2,7,20},
 
["carte-vierge"] = {1,1,1},
 
["boussole"] = {1,1,1}
 
}
 
},
 
},
 
poolsBedrock = {
 
{
 
rolls = {2,10},
 
items = {
 
["livre-enchanté"] = {1,1,60},
 
["livre"] = {1,3,100},
 
["papier"] = {2,7,100},
 
["carte-vierge"] = {1,1,5},
 
["boussole"] = {1,1,5}
 
}
 
},
 
},
 
poolsDevBedrock = {},
 
poolsDev = {}
 
},
 
["entrepôt-fort"] = {
 
header = "Entrepôt",
 
superheader = "[[Fort]]",
 
link = "entrepôt de [[fort]]",
 
structure = "Forts",
 
conteneur = "Coffre d'entrepôt",
 
structID = "fort",
 
pools = {
 
{
 
rolls = {1,4},
 
items = {
 
["lingot-fer"] = {1,5,10},
 
["lingot-or"] = {1,3,5},
 
["pain"] = {1,3,15},
 
["pomme"] = {1,3,15},
 
["pioche-fer"] = {1,1,1},
 
["redstone"] = {4,9,5},
 
["livre-enchanté"] = {1,1,1},
 
["charbon"] = {3,8,10}
 
}
 
},
 
},
 
poolsBedrock = {
 
{
 
rolls = {1,4},
 
items = {
 
["lingot-fer"] = {1,5,50},
 
["lingot-or"] = {1,3,25},
 
["pain"] = {1,3,75},
 
["pomme"] = {1,3,75},
 
["pioche-fer"] = {1,1,5},
 
["redstone"] = {4,9,25},
 
["livre-enchanté"] = {1,1,6},
 
["charbon"] = {3,8,50},
 
["poche-encre"] = {1,3,75},
 
}
 
},
 
},
 
poolsDevBedrock = {},
 
poolsDev = {},
 
},
 
["bonus"] = {
 
header = "[[Coffre#Coffre bonus|Bonus]]",
 
link = "[[Coffre#Coffre bonus|bonus]]",
 
structure = "Coffre bonus",
 
conteneur = "Coffre bonus",
 
structID = "jour",
 
pools = {
 
{
 
rolls = {1,1},
 
items = {
 
["hache-pierre"] = {1,1,1},
 
["hache-bois"] = {1,1,3},
 
}
 
},
 
{
 
rolls = {1,1},
 
items = {
 
["pioche-pierre"] = {1,1,1},
 
["pioche-bois"] = {1,1,3}
 
}
 
},
 
{
 
rolls = {3,3},
 
items = {
 
["pomme"] = {1,2,5},
 
["pain"] = {1,2,3},
 
["saumon-cru"] = {1,2,3},
 
}
 
},
 
{
 
rolls = {4,4},
 
items = {
 
["bâton"] = {1,12,10},
 
["planches-chêne"] = {1,12,10},
 
["bûche-chêne"] = {1,3,3},
 
["bûche-bouleau"] = {1,3,3},
 
["bûche-sapin"] = {1,3,3},
 
["bûche-acajou"] = {1,3,3},
 
["bûche-acacia"] = {1,3,3},
 
["bûche-chêne-noir"] = {1,3,3},
 
}
 
},
 
},
 
poolsBedrock = {
 
{
 
rolls = {1,1},
 
items = {
 
["hache-pierre"] = {1,1,1},
 
["hache-bois"] = {1,1,3},
 
}
 
},
 
{
 
rolls = {1,1},
 
items = {
 
["pioche-pierre"] = {1,1,1},
 
["pioche-bois"] = {1,1,3}
 
}
 
},
 
{
 
rolls = {1,1},
 
items = {
 
["pomme"] = {1,2,1}
 
}
 
},
 
{
 
rolls = {1,1},
 
items = {
 
["pain"] = {1,2,1}
 
}
 
},
 
{
 
rolls = {1,1},
 
items = {
 
["saumon-cru"] = {1,2,1}
 
}
 
},
 
{
 
rolls = {1,1},
 
items = {
 
["bâton"] = {1,12,1}
 
}
 
},
 
{
 
rolls = {1,1},
 
items = {
 
["planches-chêne"] = {1,12,1}
 
}
 
},
 
{
 
rolls = {1,1},
 
items = {
 
["bûche-chêne-noir"] = {1,3,1},
 
["bûche-acacia"] = {1,3,1},
 
}
 
},
 
{
 
rolls = {1,1},
 
items = {
 
["bûche-chêne"] = {1,3,1},
 
["bûche-sapin"] = {1,3,1},
 
["bûche-bouleau"] = {1,3,1},
 
["bûche-acajou"] = {1,3,1},
 
}
 
},
 
{
 
rolls = {1,1},
 
items = {
 
["pomme-de-terre"] = {1,2,3},
 
["carotte"] = {1,2,3},
 
}
 
},
 
{
 
rolls = {1,1},
 
items = {
 
["pousse-chêne"] = {4,4,2},
 
["pousse-sapin"] = {4,4,2},
 
["pousse-bouleau"] = {4,4,2},
 
["pousse-acajou"] = {4,4,4},
 
["pousse-chêne-noir"] = {4,4,2},
 
["poussea-acacia"] = {4,4,2},
 
}
 
},
 
{
 
rolls = {1,1},
 
items = {
 
["graines-pastèque"] = {1,2,3},
 
["graines-citrouille"] = {1,2,3},
 
["graines-betterave"] = {1,2,3},
 
}
 
},
 
{
 
rolls = {1,1},
 
items = {
 
["cactus"] = {1,2,3},
 
["fèves-cacao"] = {1,2,2},
 
}
 
},
 
{
 
rolls = {1,1},
 
items = {
 
["champignon-marron"] = {1,2,2},
 
}
 
},
 
},
 
poolsDevBedrock = {},
 
poolsDev = {}
 
},
 
["donjon"] = {
 
header = "[[Donjon]]",
 
link = "[[donjon]]",
 
structure = "Donjon",
 
conteneur = "Coffre de donjon",
 
structID = "donjon",
 
pools = {
 
{
 
rolls = {1,3},
 
items = {
 
["selle"] = {1,1,20},
 
["pomme-dorée"] = {1,1,15},
 
["pomme-dorée-enchantée"] = {1,1,2},
 
["disque-doré"] = {1,1,15},
 
["disque-vert"] = {1,1,15},
 
["étiquette"] = {1,1,20},
 
["armure-cheval-or"] = {1,1,10},
 
["armure-cheval-fer"] = {1,1,15},
 
["armure-cheval-diamant"] = {1,1,5},
 
["livre-enchanté-alt"] = {1,1,10},
 
}
 
},
 
{
 
rolls = {1,4},
 
items = {
 
["lingot-fer"] = {1,4,10},
 
["lingot-or"] = {1,4,5},
 
["pain"] = {1,1,20},
 
["blé"] = {1,4,20},
 
["seau"] = {1,1,10},
 
["redstone"] = {1,4,15},
 
["charbon"] = {1,4,15},
 
["graines-pastèque"] = {2,4,10},
 
["graines-citrouille"] = {2,4,10},
 
["graines-betterave"] = {2,4,10},
 
}
 
},
 
{
 
rolls = {3,3},
 
items = {
 
["os"] = {1,8,10},
 
["poudre-canon"] = {1,8,10},
 
["chair-putréfiée"] = {1,8,10},
 
["ficelle"] = {1,8,10},
 
}
 
},
 
},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
poolsDev = {}
 
},
 
["puits-mine-abandonné"] = {
 
chest_type = "wagonnet de stockage",
 
header = "[[Puits de mine abandonné]]",
 
link = "[[puits de mine abandonné]]s",
 
structure = "Mine abandonnée",
 
conteneur = "Wagonnet de stockage",
 
structID = "puits-mine-abandonné",
 
pools = {
 
{
 
rolls = {1,1},
 
items = {
 
["pomme-dorée"] = {1,1,20},
 
["pomme-dorée-enchantée"] = {1,1,1},
 
["étiquette"] = {1,1,30},
 
["livre-enchanté-alt"] = {1,1,10},
 
["pioche-fer"] = {1,1,5},
 
["vide"] = {1,1,5},
 
}
 
},
 
{
 
rolls = {2,4},
 
items = {
 
["lingot-fer"] = {1,5,10},
 
["lingot-or"] = {1,3,5},
 
["redstone"] = {4,9,5},
 
["lapis-lazuli"] = {4,9,5},
 
["diamant"] = {1,2,3},
 
["charbon"] = {3,8,10},
 
["pain"] = {1,3,15},
 
["graines-pastèque"] = {2,4,10},
 
["graines-citrouille"] = {2,4,10},
 
["graines-betterave"] = {2,4,10},
 
}
 
},
 
{
 
rolls = {3,3},
 
items = {
 
["rails"] = {4,8,20},
 
["rails-propulsion"] = {1,4,5},
 
["rails-détecteurs"] = {1,4,5},
 
["rails-déclencheurs"] = {1,4,5},
 
["torche"] = {1,16,15},
 
}
 
},
 
},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
poolsDev = {}
 
},
 
["forteresse-nether"] = {
 
header = "[[Forteresse du Nether|Forteresse]]<br>[[Forteresse du Nether|du Nether]]",
 
link = "[[forteresse du Nether]]",
 
structure = "Forteresse du Nether",
 
conteneur = "Coffre des allées",
 
structID = "forteresse-nether",
 
pools = {
 
{
 
rolls = {2,4},
 
items = {
 
["diamant"] = {1,3,5},
 
["lingot-fer"] = {1,5,5},
 
["lingot-or"] = {1,3,15},
 
["épée-or"] = {1,1,5},
 
["plastron-or"] = {1,1,5},
 
["briquet"] = {1,1,5},
 
["verrues-du-nether"] = {3,7,5},
 
["selle"] = {1,1,10},
 
["armure-cheval-or"] = {1,1,8},
 
["armure-cheval-fer"] = {1,1,5},
 
["armure-cheval-diamant"] = {1,1,3},
 
["obsidienne"] = {2,4,2},
 
}
 
},
 
},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
poolsDev = {}
 
},
 
["temple-désert"] = {
 
header = "Temple du [[Pyramide|désert]]",
 
link = "[[Pyramide|temple du désert]]",
 
structure = "Temple du désert",
 
conteneur = "Coffre de la crypte",
 
structID = "pyramides",
 
pools = {
 
{
 
rolls = {2,4},
 
items = {
 
["diamant"] = {1,3,5},
 
["lingot-fer"] = {1,5,15},
 
["lingot-or"] = {2,7,15},
 
["émeraude"] = {1,3,15},
 
["os"] = {4,6,25},
 
["œil-araignée"] = {1,3,25},
 
["chair-putréfiée"] = {3,7,25},
 
["selle"] = {1,1,20},
 
["armure-cheval-fer"] = {1,1,15},
 
["armure-cheval-or"] = {1,1,10},
 
["armure-cheval-diamant"] = {1,1,5},
 
["livre-enchanté"] = {1,1,20},
 
["pomme-dorée"] = {1,1,20},
 
["pomme-dorée-enchantée"] = {1,1,2},
 
["vide"] = {1,1,15},
 
}
 
},
 
{
 
rolls = {4,4},
 
items = {
 
["os"] = {1,8,10},
 
["poudre-canon"] = {1,8,10},
 
["chair-putréfiée"] = {1,8,10},
 
["ficelle"] = {1,8,10},
 
["sable"] = {1,8,10},
 
}
 
},
 
},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
poolsDev = {}
 
},
 
["temple-jungle"] = {
 
header = "[[Temple de la jungle]]",
 
link = "[[temple de la jungle]]",
 
structure = "Temple de la jungle",
 
conteneur = "Coffre du temple",
 
structID = "temple-jungle",
 
pools = {
 
{
 
rolls = {2,6},
 
items = {
 
["diamant"] = {1,3,3},
 
["lingot-fer"] = {1,5,10},
 
["lingot-or"] = {2,7,15},
 
["émeraude"] = {1,3,2},
 
["armure-cheval-fer"] = {1,1,1},
 
["armure-cheval-or"] = {1,1,1},
 
["armure-cheval-diamant"] = {1,1,1},
 
["bambou"] = {1,3,15},
 
["selle"] = {1,1,3},
 
["livre-enchanté-alt"] = {1,1,1},
 
["os"] = {4,6,20},
 
["chair-putréfiée"] = {3,7,16}
 
}
 
},
 
},
 
poolsDev = {},
 
poolsBedrock = {
 
{
 
rolls = {2,6},
 
items = {
 
["diamant"] = {1,3,15},
 
["lingot-fer"] = {1,5,50},
 
["lingot-or"] = {2,7,75},
 
["émeraude"] = {1,3,10},
 
["armure-cheval-fer"] = {1,1,5},
 
["armure-cheval-or"] = {1,1,5},
 
["armure-cheval-diamant"] = {1,1,5},
 
["bambou"] = {1,3,75},
 
["selle"] = {1,1,15},
 
["livre-enchanté-alt"] = {1,1,6},
 
["os"] = {4,6,100},
 
["chair-putréfiée"] = {3,7,80}
 
}
 
},
 
},
 
poolsDevBedrock = {},
 
},
 
["distributeur-temple-jungle"] = { -- jungle_temple_dispenser.json
 
chest_type = "distributeur",
 
header = "[[Temple de la jungle]]",
 
link = "[[temple de la jungle]]",
 
structure = "Temple de la jungle",
 
conteneur = "Distributeurs du temple",
 
structID = "temple-jungle",
 
pools = {
 
{
 
rolls = {1,2},
 
items = {
 
["flèche"] = {2,7,30}
 
}
 
},
 
},
 
poolsBedrock = {
 
{
 
rolls = {2,2},
 
items = {
 
["flèche"] = {2,7,30}
 
}
 
},
 
},
 
poolsDevBedrock = {},
 
poolsDev = {}
 
},
 
["cité-end"] = {
 
header = "[[Cité de l'End]]",
 
link = "[[Cité de l'End]]",
 
structure = "Cité de l'End",
 
conteneur = "Coffre des cités",
 
structID = "cité-end",
 
pools = {
 
{
 
rolls = {2,6},
 
items = {
 
["diamant"] = {2,7,5},
 
["lingot-fer"] = {4,8,10},
 
["lingot-or"] = {2,7,15},
 
["émeraude"] = {2,6,2},
 
["graines-betterave"] = {1,10,5},
 
["selle"] = {1,1,3},
 
["armure-cheval-fer"] = {1,1,1},
 
["armure-cheval-or"] = {1,1,1},
 
["armure-cheval-diamant"] = {1,1,1},
 
["épée-diamant-enchantée"] = {1,1,3},
 
["bottes-diamant-enchantées"] = {1,1,3},
 
["plastron-diamant-enchanté"] = {1,1,3},
 
["jambières-diamant-enchantées"] = {1,1,3},
 
["casque-diamant-enchanté"] = {1,1,3},
 
["pioche-diamant-enchantée"] = {1,1,3},
 
["pelle-diamant-enchantée"] = {1,1,3},
 
["épée-fer-enchantée"] = {1,1,3},
 
["bottes-fer-enchantées"] = {1,1,3},
 
["plastron-fer-enchanté"] = {1,1,3},
 
["jambières-fer-enchantées"] = {1,1,3},
 
["casque-fer-enchanté"] = {1,1,3},
 
["pioche-fer-enchantée"] = {1,1,3},
 
["pelle-fer-enchantée"] = {1,1,3},
 
}
 
},
 
},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
poolsDev = {}
 
},
 
["igloo"] = {
 
header = "[[Igloo]]",
 
link = "[[igloo]]",
 
structure = "Igloo",
 
conteneur = "Coffre de la cave",
 
structID = "igloo",
 
pools = {
 
{
 
rolls = {2,8},
 
items = {
 
["pomme"] = {1,3,15},
 
["charbon"] = {1,4,15},
 
["pépite-or"] = {1,3,10},
 
["hache-pierre"] = {1,1,2},
 
["chair-putréfiée"] = {1,1,10},
 
["émeraude"] = {1,1,1},
 
["blé"] = {2,3,10}
 
}
 
},
 
{
 
rolls = {1,1},
 
items = {
 
["pomme-dorée"] = {1,1,1},
 
}
 
},
 
},
 
poolsBedrock = pools,
 
poolsDevBedrock = {},
 
poolsDev = {}
 
},
 
["bastion-pont"] = { -- bastion_bridge.json
 
header = "Pont",
 
superheader = "[[Vestiges de bastion]]",
 
link = "[[Vestiges de bastion|Vestiges de bastion#Pont]]",
 
structure = "Vestiges de bastion",
 
conteneur = "Coffre de pont",
 
structID = "vestiges-bastion",
 
pools = {
 
{
 
rolls = {1,1},
 
items = {
 
["magnétite"] = {1,1,1},
 
}
 
},
 
{
 
rolls = {1,2},
 
items = {
 
["arbalète-enchantée-endommagée"] = {1,1,1},
 
["flèche-spectrale"] = {10,28,1},
 
["roche-noire-dorée"] = {8,12,1},
 
["obsidienne-pleureuse"] = {3,8,1},
 
["bloc-or"] = {1,1,1},
 
["lingot-or"] = {4,9,1},
 
["lingot-fer"] = {4,9,1},
 
["golden-sword"] = {1,1,1},
 
["bottes-or-enchantées"] = {1,1,1},
 
["plastron-or-enchanté"] = {1,1,1},
 
["jambières-or-enchantées"] = {1,1,1},
 
["casque-or-enchanté"] = {1,1,1},
 
["hache-or-enchantée"] = {1,1,1},
 
}
 
},
 
{
 
rolls = {2,4},
 
items = {
 
["ficelle"] = {1,6,1},
 
["cuir"] = {1,3,1},
 
["flèche"] = {5,17,1},
 
["pépite-fer"] = {2,6,1},
 
["pépite-or"] = {2,6,1},
 
}
 
}
 
},
 
poolsDev = {},
 
poolsBedrock = {
 
{
 
rolls = {1,1},
 
items = {
 
["magnétite"] = {1,1,1},
 
}
 
},
 
{
 
rolls = {1,2},
 
items = {
 
["arbalète-enchantée-endommagée"] = {1,1,1},
 
["flèche"] = {2,12,1},
 
["roche-noire-dorée"] = {5,8,1},
 
["obsidienne-pleureuse"] = {3,8,1},
 
["bloc-or"] = {1,1,1},
 
["lingot-or"] = {2,8,1},
 
["lingot-fer"] = {2,8,1},
 
["golden-sword"] = {1,1,1},
 
["bottes-or-enchantées"] = {1,1,1},
 
["plastron-or-enchanté"] = {1,1,1},
 
["jambières-or-enchantées"] = {1,1,1},
 
["casque-or-enchanté"] = {1,1,1},
 
}
 
},
 
{
 
rolls = {2,4},
 
items = {
 
["ficelle"] = {1,6,1},
 
["cuir"] = {1,3,1},
 
["flèche"] = {5,17,1},
 
["pépite-fer"] = {2,6,1},
 
["pépite-or"] = {2,6,1},
 
}
 
}
 
},
 
poolsDevBedrock = {},
 
},
 
["bastion-écuries-hoglin"] = { -- bastion_hoglin_stable.json
 
header = "Écuries de hoglin",
 
superheader = "[[Vestiges de bastion]]",
 
link = "[[Vestiges de bastion|Vestiges de bastion#Écuries de hoglin]]",
 
structure = "Vestiges de bastion",
 
conteneur = "Coffre d'écuries de hoglin",
 
structID = "vestiges-bastion",
 
pools = {
 
{
 
rolls = {1,1},
 
items = {
 
["pelle-diamant-enchantée-endommagée"] = {1,1,15},
 
["pioche-diamant-enchantée-endommagée"] = {1,1,12},
 
["fragments-netherite"] = {1,1,8},
 
["débris-antiques"] = {1,1,12},
 
["débris-antiques"] = {2,2,5},
 
["selle"] = {1,1,12},
 
["bloc-or"] = {2,4,16},
 
["carotte-dorée"] = {8,17,10},
 
["pomme-dorée"] = {1,1,10},
 
}
 
},
 
{
 
rolls = {3,4},
 
items = {
 
["hache-or-enchantée"] = {1,1,1},
 
["obsidienne-pleureuse"] = {1,5,1},
 
["pierre-lumineuse"] = {3,6,1},
 
["roche-noire-dorée"] = {2,5,1},
 
["sable-âmes"] = {2,7,1},
 
["nylium-carmin"] = {2,7,1},
 
["pépite-or"] = {2,8,1},
 
["cuir"] = {1,3,1},
 
["flèche"] = {5,17,1},
 
["ficelle"] = {3,8,1},
 
["porc-cru"] = {2,5,1},
 
["porc-cuit"] = {2,5,1},
 
["champignon-carmin"] = {2,7,1},
 
["racines-carmin"] = {2,7,1},
 
}
 
}
 
},
 
poolsBedrock = {
 
{
 
rolls = {1,1},
 
items = {
 
["pelle-diamant-enchantée-endommagée"] = {1,1,15},
 
["débris-antiques"] = {1,1,3},
 
["fragments-netherite"] = {1,1,2},
 
["selle"] = {1,1,10},
 
["bloc-or"] = {2,4,25},
 
["houe-or-enchantée"] = {1,1,15},
 
["vide"] = {1,1,45},
 
}
 
},
 
{
 
rolls = {3,4},
 
items = {
 
["pierre-lumineuse"] = {1,5,1},
 
["roche-noire-dorée"] = {1,5,1},
 
["sable-âmes"] = {2,7,1},
 
["nylium-carmin"] = {2,7,1},
 
["pépite-or"] = {2,8,1},
 
["cuir"] = {1,3,1},
 
["flèche"] = {5,17,1},
 
["ficelle"] = {3,8,1},
 
["porc-cru"] = {2,5,1},
 
["porc-cuit"] = {2,5,1},
 
["champignon-carmin"] = {2,7,1},
 
["racines-carmin"] = {2,7,1},
 
}
 
}
 
},
 
poolsDevBedrock = {},
 
poolsDev = {},
 
},
 
["bastion-autre"] = { -- bastion_other.json
 
header = "[[Bastion]]",
 
superheader = "[[Vestiges de bastion]]",
 
link = "[[Vestiges de bastion]]",
 
structure = "Vestiges de bastion",
 
conteneur = "Coffre divers",
 
structID = "vestiges-bastion",
 
pools = {
 
{
 
rolls = {1,1},
 
items = {
 
["pioche-diamant-enchantée-aléatoire"] = {1,1,6},
 
["pelle-diamant"] = {1,1,6},
 
["arbalète-enchantée-endommagée-2"] = {1,1,6},
 
["débris-antiques"] = {1,1,12},
 
["fragments-netherite"] = {1,1,4},
 
["flèche-spectrale"] = {10,22,10},
 
["motif-bannière-groin"] = {1,1,9},
 
["disque-pigstep"] = {1,1,5},
 
["carotte-dorée"] = {6,17,12},
 
["pomme-dorée"] = {1,1,9},
 
["livre-enchanté-agilité-âmes"] = {1,1,10},
 
}
 
},
 
{
 
rolls = {2,2},
 
items = {
 
["épée-fer-enchantée-endommagée"] = {1,1,2},
 
["bloc-fer"] = {1,1,2},
 
["bottes-or-enchantées-agilité-âmes"] = {1,1,1},
 
["hache-or-enchantée"] = {1,1,1},
 
["bloc-or"] = {1,1,2},
 
["arbalète"] = {1,1,1},
 
["lingot-or"] = {1,6,2},
 
["lingot-fer"] = {1,6,2},
 
["épée-or"] = {1,1,1},
 
["plastron-or"] = {1,1,1},
 
["casque-or"] = {1,1,1},
 
["jambières-or"] = {1,1,1},
 
["bottes-or"] = {1,1,1},
 
["obsidienne-pleureuse"] = {1,5,2},
 
}
 
},
 
{
 
rolls = {3,4},
 
items = {
 
["roche-noire-dorée"] = {1,5,2},
 
["chaîne"] = {2,10,1},
 
["crème-magma"] = {2,6,2},
 
["bloc-os"] = {3,6,1},
 
["pépite-fer"] = {2,8,1},
 
["obsidienne"] = {4,6,1},
 
["pépite-or"] = {2,8,1},
 
["ficelle"] = {4,6,1},
 
["flèche"] = {5,17,2},
 
["porc-cuit"] = {1,1,1},
 
}
 
}
 
},
 
poolsDev = {},
 
poolsBedrock = {
 
{
 
rolls = {1,1},
 
items = {
 
["arbalète-enchantée-endommagée"] = {1,1,12},
 
["débris-antiques"] = {1,1,2},
 
["fragments-netherite"] = {1,1,2},
 
["flèche"] = {2,5,16},
 
["motif-bannière-groin"] = {1,1,5},
 
["disque-pigstep"] = {1,1,3},
 
["livre-enchanté-agilité-âmes"] = {1,1,10},
 
["vide"] = {1,1,50},
 
}
 
},
 
{
 
rolls = {2,2},
 
items = {
 
["bottes-or-enchantées-agilité-âmes"] = {1,1,1},
 
["bloc-or"] = {1,1,1},
 
["arbalète"] = {1,1,1},
 
["lingot-or"] = {1,6,1},
 
["lingot-fer"] = {1,6,1},
 
["épée-or"] = {1,1,1},
 
["plastron-or"] = {1,1,1},
 
["casque-or"] = {1,1,1},
 
["jambières-or"] = {1,1,1},
 
["bottes-or"] = {1,1,1},
 
["vide"] = {1,1,2},
 
}
 
},
 
{
 
rolls = {3,4},
 
items = {
 
["obsidienne-pleureuse"] = {1,5,1},
 
["roche-noire-dorée"] = {1,5,1},
 
["chaîne"] = {2,10,1},
 
["crème-magma"] = {2,6,1},
 
["bloc-os"] = {3,6,1},
 
["pépite-fer"] = {2,8,1},
 
["obsidienne"] = {4,6,1},
 
["pépite-or"] = {2,8,1},
 
["ficelle"] = {4,6,1},
 
["flèche"] = {5,17,2},
 
}
 
}
 
},
 
poolsDevBedrock = {},
 
},
 
["bastion-trésor"] = { -- bastion_treasure.json
 
header = "Salle au trésor",
 
superheader = "[[Vestiges de bastion]]",
 
link = "[[Vestiges de bastion|Vestiges de bastion#Salle au trésor]]",
 
structure = "Vestiges de bastion",
 
conteneur = "Coffre de salle au trésor",
 
structID = "vestiges-bastion",
 
poolsBedrock = {},
 
poolsDevBedrock = {},
 
poolsDev = {},
 
pools = {
 
{
 
rolls = {3,3},
 
items = {
 
["lingot-netherite"] = {1,1,15},
 
["débris-antiques"] = {1,1,10},
 
["fragments-netherite"] = {1,1,8},
 
["débris-antiques"] = {2,2,4},
 
["épée-diamant-enchantée-endommagée"] = {1,1,6},
 
["plastron-diamant-enchanté-endommagé"] = {1,1,6},
 
["casque-diamant-enchanté-endommagé"] = {1,1,6},
 
["jambières-diamant-enchantées-endommagées"] = {1,1,6},
 
["bottes-diamant-enchantées-endommagées"] = {1,1,6},
 
["épée-diamant"] = {1,1,6},
 
["plastron-diamant"] = {1,1,5},
 
["casque-diamant"] = {1,1,5},
 
["jambières-diamant"] = {1,1,5},
 
["bottes-diamant"] = {1,1,5},
 
["diamant"] = {2,6,5},
 
["pomme-dorée-enchantée"] = {1,1,2},
 
}
 
},
 
{
 
rolls = {3,4},
 
items = {
 
["flèche-spectrale"] = {12,25,1},
 
["bloc-or"] = {2,5,1},
 
["bloc-fer"] = {2,5,1},
 
["lingot-or"] = {3,9,1},
 
["lingot-fer"] = {3,9,1},
 
["obsidienne-pleureuse"] = {3,5,1},
 
["quartz-nether"] = {8,23,1},
 
["roche-noire-dorée"] = {5,15,1},
 
["crème-magma"] = {3,8,1},
 
}
 
}
 
},
 
},
 
["portail-ruine"] = { --ruined_portal.json
 
header = "[[Portail en ruine]]",
 
link = "[[Portail en ruine]]",
 
structure = "Portail en ruine",
 
conteneur = "Coffre du portail",
 
structID = "portail-ruine",
 
pools = {
 
{
 
rolls = {4,8},
 
items = {
 
["obsidienne"] = {1,2,40},
 
["silex"] = {1,4,40},
 
["pépite-fer"] = {9,18,40},
 
["briquet"] = {1,1,40},
 
["boule-feu"] = {1,1,40},
 
["pomme-dorée"] = {1,1,40},
 
["pépite-or"] = {4,24,15},
 
["épée-or-enchantée"] = {1,1,15},
 
["hache-or-enchantée"] = {1,1,15},
 
["houe-or-enchantée"] = {1,1,15},
 
["pioche-or-enchantée"] = {1,1,15},
 
["pelle-or-enchantée"] = {1,1,15},
 
["casque-or-enchanté"] = {1,1,15},
 
["plastron-or-enchanté"] = {1,1,15},
 
["jambières-or-enchantées"] = {1,1,15},
 
["bottes-or-enchantées"] = {1,1,15},
 
["tranche-pastèque-scintillante"] = {4,13,5},
 
["armure-cheval-or"] = {1,1,5},
 
["plaque-pression-pondérée-légère"] = {1,1,5},
 
["carotte-dorée"] = {4,12,5},
 
["montre"] = {1,1,5},
 
["lingot-or"] = {2,8,5},
 
["cloche"] = {1,1,1},
 
["pomme-dorée-enchantée"] = {1,1,1},
 
["bloc-or"] = {1,2,1},
 
}
 
}
 
},
 
poolsBedrock = {},
 
poolsDevBedrock = {},
 
poolsDev = {}
 
},
 
["manoir"] = { -- woodland_mansion.json
 
header = "[[Manoir]]",
 
link = "[[manoir]]s",
 
structure = "Manoir",
 
conteneur = "Coffre du manoir",
 
structID = "manoir",
 
pools = {
 
{
 
rolls = {1,3},
 
items = {
 
["laisse"] = {1,1,20},
 
["pomme-dorée"] = {1,1,15},
 
["pomme-dorée-enchantée"] = {1,1,2},
 
["disque-doré"] = {1,1,15},
 
["disque-vert"] = {1,1,15},
 
["étiquette"] = {1,1,20},
 
["cotte-de-mailles"] = {1,1,10},
 
["houe-diamant"] = {1,1,15},
 
["plastron-diamant"] = {1,1,5},
 
["livre-enchanté-alt"] = {1,1,10},
 
}
 
},
 
{
 
rolls = {1,4},
 
items = {
 
["lingot-fer"] = {1,4,10},
 
["lingot-or"] = {1,4,5},
 
["pain"] = {1,1,20},
 
["blé"] = {1,4,20},
 
["seau"] = {1,1,10},
 
["redstone"] = {1,4,15},
 
["charbon"] = {1,4,15},
 
["graines-pastèque"] = {2,4,10},
 
["graines-citrouille"] = {2,4,10},
 
["graines-betterave"] = {2,4,10},
 
}
 
},
 
{
 
rolls = {3,3},
 
items = {
 
["os"] = {1,8,10},
 
["poudre-canon"] = {1,8,10},
 
["chair-putréfiée"] = {1,8,10},
 
["ficelle"] = {1,8,10},
 
}
 
},
 
},
 
poolsBedrock = {},
 
poolsDevBedrock = {},
 
poolsDev = {}
 
},
 
},
 
   
 
-- these values are used:
 
-- these values are used:
Ligne 2 052 : Ligne 100 :
 
["nether"] = "forteresse-nether",
 
["nether"] = "forteresse-nether",
 
["forteresse"] = "forteresse-nether",
 
["forteresse"] = "forteresse-nether",
  +
 
["armurerie"] = "village-armurerie",
 
["armurerie"] = "village-armurerie",
 
["boucherie"] = "village-boucherie",
 
["boucherie"] = "village-boucherie",
Ligne 2 060 : Ligne 109 :
 
["forgeron-armes"] = "village-forgeron-armes",
 
["forgeron-armes"] = "village-forgeron-armes",
 
["forgeron-outils"] = "village-forgeron-outils",
 
["forgeron-outils"] = "village-forgeron-outils",
  +
 
["désert"] = "village-désert",
 
["désert"] = "village-désert",
 
["plaine"] = "village-plaine",
 
["plaine"] = "village-plaine",
Ligne 2 065 : Ligne 115 :
 
["toundra"] = "village-toundra",
 
["toundra"] = "village-toundra",
 
["taïga"] = "village-taïga",
 
["taïga"] = "village-taïga",
  +
["2-pièces"] = "village-maison-2-pièces",
 
 
["autel"] = "autel-fort",
 
["autel"] = "autel-fort",
 
["entrepôt"] = "entrepôt-fort",
 
["entrepôt"] = "entrepôt-fort",
 
["bibliothèque"] = "bibliothèque-fort",
 
["bibliothèque"] = "bibliothèque-fort",
 
["écuries-hoglin"] = "bastion-écuries-hoglin",
 
["écuries-hoglin"] = "bastion-écuries-hoglin",
["bastion-autre"] = "bastion"
+
["bastion-autre"] = "bastion",
  +
  +
["pyramide-brosse"] = "temple-désert-brosse"
 
 
 
},
 
},
Ligne 2 083 : Ligne 135 :
 
 
 
display_names = {
 
display_names = {
["puits-mine-abandonné"] = "puits de mine abandonné",
+
["puits-de-mine-abandonné"] = "puits de mine abandonné",
 
["forteresse-nether"] = "forteresse du Nether",
 
["forteresse-nether"] = "forteresse du Nether",
 
["nether"] = "forteresse du Nether",
 
["nether"] = "forteresse du Nether",
Ligne 2 101 : Ligne 153 :
 
["toundra"] = "maison de village de la toundra",
 
["toundra"] = "maison de village de la toundra",
 
["taïga"] = "maison de village de la taïga",
 
["taïga"] = "maison de village de la taïga",
["2-pièces"] = "maison 2 pièces de village",
 
 
["jungle"] = "temple de la jungle",
 
["jungle"] = "temple de la jungle",
 
["temple-désert"] = "pyramide",
 
["temple-désert"] = "pyramide",
 
["temple-jungle"] = "temple de la jungle",
 
["temple-jungle"] = "temple de la jungle",
["distributeur-temple-jungle"] = "temple de la jungle",
+
["distributeur-temple-jungle"] = "distributeur de temple de la jungle",
 
["autel-fort"] = "autel",
 
["autel-fort"] = "autel",
 
["bibliothèque-fort"] = "bibliothèque",
 
["bibliothèque-fort"] = "bibliothèque",
Ligne 2 112 : Ligne 163 :
 
["bastion-pont"] = "pont de vestiges de bastion",
 
["bastion-pont"] = "pont de vestiges de bastion",
 
["bastion-écuries-hoglin"] = "écuries de Hoglin",
 
["bastion-écuries-hoglin"] = "écuries de Hoglin",
["bastion-autre"] = "bastion",
+
["bastion-autre"] = "bastion",
["bastion-trésor"] = "salle au trésor de vestiges de bastion"
+
["bastion-trésor"] = "salle au trésor de vestiges de bastion",
  +
["temple-désert-brosse"] = "sable suspect de pyramide",
  +
["ruines-sous-marines-froides-brosse"] = "gravier suspect de ruines sous-marines froides",
  +
["ruines-sous-marines-chaudes-brosse"] = "sable suspect de ruines sous-marines chaudes",
  +
["puits-du-désert-brosse"] = "sable suspect de puits du désert",
  +
["ruines-de-sentier-brosse"] = "gravier suspect commun de ruines de sentier",
  +
["ruines-de-sentier-brosse-rare"] = "gravier suspect rare de ruines de sentier"
 
},
 
},
 
 
Ligne 2 146 : Ligne 203 :
 
local chests, columns = q.massage_args( args )
 
local chests, columns = q.massage_args( args )
 
 
if #chests == 0 then
+
assert(#chests > 0, "pas d'arguments valides")
return "<span class='error'>Module:CoffreRécompenses : arguments invalides</span>"
 
end
 
   
 
q.fill_in_chest_derivative_data( chests )
 
q.fill_in_chest_derivative_data( chests )
Ligne 2 154 : Ligne 209 :
 
-- construct an ordered list dictating the order of the rows
 
-- construct an ordered list dictating the order of the rows
 
 
  +
local ordered_item_rows_java = {}
local ordered_item_rows, ordered_item_rows_dev
 
  +
local ordered_item_rows_java_upcoming = {}
  +
local ordered_item_rows_bedrock = {}
  +
local ordered_item_rows_bedrock_upcoming = {}
   
 
local ret = {}
 
local ret = {}
  +
if args.dev and args.dev ~= '0' then
 
  +
local java_specified = args.java and args.java ~= '0';
local ordered_item_rows = q.construct_ordered_item_rows( chests, 'Dev' )
 
  +
local java_upcoming_specified = args['java-upcoming'] and args['java-upcoming'] ~= '0';
if q.tablelength( ordered_item_rows ) > 0 then
 
  +
local bedrock_specified = args.bedrock and args.bedrock ~= '0';
table.insert( ret, q.print_table( chests, columns, ordered_item_rows, 'Dev' ) )
 
  +
local bedrock_upcoming_specified = args['bedrock-upcoming'] and args['bedrock-upcoming'] ~= '0';
  +
  +
local any_specified = java_specified or java_upcoming_specified or bedrock_specified or bedrock_upcoming_specified
  +
  +
if any_specified then
  +
  +
if java_specified then
  +
ordered_item_rows_java = q.construct_ordered_item_rows( chests, 'Java' )
  +
end
  +
if java_upcoming_specified then
  +
ordered_item_rows_java_upcoming = q.construct_ordered_item_rows( chests, 'JavaUpcoming' )
  +
end
  +
if bedrock_specified then
  +
ordered_item_rows_bedrock = q.construct_ordered_item_rows( chests, 'Bedrock' )
  +
end
  +
if bedrock_upcoming_specified then
  +
ordered_item_rows_bedrock_upcoming = q.construct_ordered_item_rows( chests, 'BedrockUpcoming' )
 
end
 
end
  +
 
else
 
else
  +
local ordered_item_rows = q.construct_ordered_item_rows( chests, '' )
 
  +
local java_excluded = args.java and args.java == '0';
local ordered_item_rows_dev = q.construct_ordered_item_rows( chests, 'Dev' )
 
  +
local java_upcoming_excluded = args['java-upcoming'] and args['java-upcoming'] == '0';
 
  +
local bedrock_excluded = args.bedrock and args.bedrock == '0';
if q.tablelength( ordered_item_rows ) > 0 then
 
  +
local bedrock_upcoming_excluded = args['bedrock-upcoming'] and args['bedrock-upcoming'] == '0';
table.insert( ret, q.print_table( chests, columns, ordered_item_rows, '' ) )
 
end
+
  +
if not java_excluded then
if q.tablelength( ordered_item_rows_dev ) > 0 and q.compare_tables( ordered_item_rows, ordered_item_rows_dev ) then
 
  +
ordered_item_rows_java = q.construct_ordered_item_rows( chests, 'Java' )
table.insert( ret, p.current_frame:preprocess( p.java_dev ) .. q.lcfirst( q.print_table( chests, columns, ordered_item_rows_dev, 'Dev' ) ) )
 
  +
end
  +
if not java_upcoming_excluded then
  +
ordered_item_rows_java_upcoming = q.construct_ordered_item_rows( chests, 'JavaUpcoming' )
  +
end
  +
if not bedrock_excluded then
  +
ordered_item_rows_bedrock = q.construct_ordered_item_rows( chests, 'Bedrock' )
  +
end
  +
if not bedrock_upcoming_excluded then
  +
ordered_item_rows_bedrock_upcoming = q.construct_ordered_item_rows( chests, 'BedrockUpcoming' )
 
end
 
end
  +
  +
end
  +
  +
if q.tablelength( ordered_item_rows_java ) > 0 then
  +
table.insert( ret, 'Dans la ' .. p.current_frame:preprocess( p.java ) .. ', ' .. q.lcfirst( q.print_table( chests, columns, ordered_item_rows_java, 'Java' ) ) )
  +
end
  +
if q.tablelength( ordered_item_rows_java_upcoming ) > 0 and q.compare_tables( ordered_item_rows_java, ordered_item_rows_java_upcoming ) then
  +
table.insert( ret, 'Dans la ' .. p.current_frame:preprocess( p['java-upcoming'] ) .. ', ' .. q.lcfirst( q.print_table( chests, columns, ordered_item_rows_java_upcoming, 'JavaUpcoming' ) ) )
  +
end
  +
if q.tablelength( ordered_item_rows_bedrock ) > 0 and q.compare_tables( ordered_item_rows_java, ordered_item_rows_bedrock ) then
  +
table.insert( ret, 'Dans la ' .. p.current_frame:preprocess( p.bedrock ) .. ', ' .. q.lcfirst( q.print_table( chests, columns, ordered_item_rows_bedrock, 'Bedrock' ) ) )
  +
end
  +
if q.tablelength( ordered_item_rows_bedrock_upcoming ) > 0 and q.compare_tables( ordered_item_rows_bedrock, ordered_item_rows_bedrock_upcoming ) then
  +
table.insert( ret, 'Dans la ' .. p.current_frame:preprocess( p['bedrock-upcoming'] ) .. ', ' .. q.lcfirst( q.print_table( chests, columns, ordered_item_rows_bedrock_upcoming, 'BedrockUpcoming' ) ) )
 
end
 
end
  +
  +
table.insert( ret, "<div class=mobileonly>" )
  +
table.insert( ret, p.current_frame:expandTemplate{ title = 'FNlist', args = {} } )
  +
table.insert( ret, "</div>" )
   
 
return table.concat( ret, '\n\n' )
 
return table.concat( ret, '\n\n' )
Ligne 2 224 : Ligne 327 :
   
 
local args = { ... }
 
local args = { ... }
if args[1] == p.current_frame then
+
if args[1] == p.current_frame then
 
args = require( 'Module:ProcessArgs' ).merge( true )
 
args = require( 'Module:ProcessArgs' ).merge( true )
 
else
 
else
 
args = args[1]
 
args = args[1]
  +
end
  +
  +
local itemname = args[1]
  +
  +
if p.items[itemname] == nil then
  +
return '<span style="color:red;">Objet "' .. itemname .. '" inconnu</span>'
  +
end
  +
  +
if args.java and args.java ~= '0' then
  +
javaChances = q.single_item_find_values( itemname, 'poolsJava' )
  +
javaUpcomingChances = {}
  +
bedrockChances = {}
  +
bedrockUpcomingChances = {}
  +
else
  +
if args['java-upcoming'] and args['java-upcoming'] ~= '0' then
  +
javaChances = q.single_item_find_values( itemname, 'poolsJavaUpcoming' )
  +
javaUpcomingChances = {}
  +
bedrockChances = {}
  +
bedrockUpcomingChances = {}
  +
else
  +
if args.bedrock and args.bedrock ~= '0' then
  +
javaChances = q.single_item_find_values( itemname, 'poolsBedrock' )
  +
javaUpcomingChances = {}
  +
bedrockChances = {}
  +
bedrockUpcomingChances = {}
  +
else
  +
if args['bedrock-upcoming'] and args['bedrock-upcoming'] ~= '0' then
  +
javaChances = q.single_item_find_values( itemname, 'poolsBedrockUpcoming' )
  +
javaUpcomingChances = {}
  +
bedrockChances = {}
  +
bedrockUpcomingChances = {}
  +
else
  +
javaChances = q.single_item_find_values( itemname, 'poolsJava' )
  +
javaUpcomingChances = q.single_item_find_values( itemname, 'poolsJavaUpcoming', javaChances )
  +
bedrockChances = q.single_item_find_values( itemname, 'poolsBedrock' )
  +
bedrockUpcomingChances = q.single_item_find_values( itemname, 'poolsBedrockUpcoming', javaChances, bedrockChances )
  +
end
  +
end
  +
end
 
end
 
end
 
 
  +
local html = {}
  +
  +
local any_current = q.tablelength( javaChances ) > 0
  +
local any_changes_upcoming = q.tablelength( javaUpcomingChances ) > 0 and q.compare_tables( javaChances, javaUpcomingChances )
  +
local any_standard = any_current or any_changes_upcoming
  +
  +
local any_bedrock_current = q.tablelength( bedrockChances ) > 0
  +
local any_bedrock_upcoming = q.tablelength( bedrockUpcomingChances ) > 0 and q.compare_tables( bedrockChances, bedrockUpcomingChances )
  +
local any_bedrock = any_bedrock_current or any_bedrock_upcoming
  +
  +
local change_case = p.items[itemname].preserve_case == nil or p.items[itemname].preserve_case ~= true
  +
  +
if any_current then
  +
table.insert( html, p.base2_sub( itemname, javaChances ) )
  +
end
  +
if any_changes_upcoming then
  +
table.insert( html, p.current_frame:preprocess( p['java-upcoming'] ) .. ( change_case and q.lcfirst( p.base2_sub( itemname, javaUpcomingChances, any_current ) ) or p.base2_sub( itemname, javaUpcomingChances, any_current ) ) )
  +
end
  +
if any_bedrock_current then
  +
table.insert( html, ( any_standard and '\n\n' or '' ) .. p.current_frame:preprocess( p.bedrock ) .. ( change_case and q.lcfirst( p.base2_sub( itemname, bedrockChances, any_standard ) ) or p.base2_sub( itemname, bedrockChances, any_standard ) ) )
  +
end
  +
if any_bedrock_upcoming then
  +
table.insert( html, ( any_standard and not any_bedrock_current and '\n\n' or '' ) .. p.current_frame:preprocess( p['bedrock-upcoming'] ) .. ( change_case and q.lcfirst( p.base2_sub( itemname, bedrockUpcomingChances, any_bedrock_current or any_standard ) ) or p.base2_sub( itemname, bedrockUpcomingChances, any_bedrock_current or any_standard ) ) )
  +
end
  +
  +
if args.nocat then
  +
else
  +
table.insert( html, '[[Catégorie:Pages avec des modèles de coffre à récompenses]]' )
  +
if p.items[itemname].category ~= nil and p.items[itemname].category ~= false then
  +
table.insert( html, '[[Catégorie:Pages contenant des objets spécifiques de coffre à récompenses]]' )
  +
end
  +
if any_bedrock and (mw.title.getCurrentTitle().namespace == 0) then
  +
table.insert( html, '[[Catégorie:Information spécifique à la version Bedrock]]' )
  +
end
  +
end
  +
  +
return table.concat( html, ' ' )
  +
end
  +
  +
p.base2_sub = function( itemname, chances, use_they )
  +
  +
local html = {}
  +
local item_display_name = ''
  +
  +
if use_they then
  +
item_display_name = 'ils'
  +
else
  +
if p.items[itemname].plural ~= nil and p.items[itemname].plural ~= false then
  +
item_display_name = p.items[itemname].plural
  +
else
  +
if p.items[itemname].title ~= nil then
  +
item_display_name = p.items[itemname].title
  +
else
  +
item_display_name = string.gsub( itemname, '-', ' ' )
  +
end
  +
if p.items[itemname].plural == nil or p.items[itemname].plural ~= false then
  +
item_display_name = q.single_item_plural( item_display_name )
  +
end
  +
end
  +
  +
if p.items[itemname].preserve_case == nil or p.items[itemname].preserve_case ~= true then
  +
item_display_name = q.capitalize( item_display_name )
  +
end
  +
  +
if p.items[itemname].note and p.notes[p.items[itemname].note] then
  +
item_display_name = item_display_name .. p.current_frame:extensionTag( 'ref', p.notes[p.items[itemname].note], { group='FN', name=p.items[itemname].note } )
  +
end
  +
  +
if p.items[itemname].note1 and p.notes[p.items[itemname].note1] then
  +
if p.items[itemname].note == nil or p.notes[p.items[itemname].note] == nil or p.items[itemname].note ~= p.items[itemname].note1 then
  +
item_display_name = item_display_name .. p.current_frame:extensionTag( 'ref', p.notes[p.items[itemname].note1], { group='FN', name=p.items[itemname].note1 } )
  +
end
  +
end
  +
end
  +
  +
table.insert( html, item_display_name )
  +
table.insert( html, ' peut être trouvé(e) ' )
  +
  +
local html_stacks = {}
  +
local stack_sep = ', '
  +
local ns = q.tablelength( chances )
  +
local s = 0
  +
  +
for stacksize, chest_details in pairs( chances ) do
  +
s = s + 1
  +
  +
local html_per_stack = { 'dans ' }
  +
local c = 0
  +
local nc = q.tablelength( chest_details )
  +
local sep = ( nc > 2 and ', ' or ' ' )
  +
if nc > 2 and s ~= ns then
  +
stack_sep = '; '
  +
end
  +
for k, chest in pairs( chest_details ) do
  +
c = c + 1
  +
if c == nc and nc > 1 then
  +
table.insert( html_per_stack, 'et ' )
  +
end
  +
if chest.chance == 1 then
  +
table.insert( html_per_stack, " tout " )
  +
else
  +
table.insert( html_per_stack, string.format("%.1f", chest.chance*100) )
  +
table.insert( html_per_stack, "% de " )
  +
end
  +
if chest.chest_type == 'wagonnet de stockage' then
  +
table.insert( html_per_stack, ' [[wagonnet de stockage|wagonnets de stockage]] dans ' )
  +
table.insert( html_per_stack, p.chests[chest.chest_name].link )
  +
elseif chest.chest_type == 'distributeur' then
  +
table.insert( html_per_stack, ' [[distributeur]]s dans ' )
  +
table.insert( html_per_stack, p.chests[chest.chest_name].link )
  +
else
  +
table.insert( html_per_stack, p.chests[chest.chest_name].link )
  +
table.insert( html_per_stack, ' coffres' )
  +
end
  +
table.insert( html_per_stack, sep )
  +
end
  +
if nc > 2 then
  +
table.insert( html_per_stack, 'tout ' )
  +
end
  +
table.insert( html_per_stack, 'dans ' )
  +
if p.items[itemname].cannot_stack ~= nil then
  +
table.insert( html_per_stack, 'groupes de ' )
  +
else
  +
table.insert( html_per_stack, 'piles de ' )
  +
end
  +
table.insert( html_per_stack, stacksize )
  +
  +
table.insert( html_stacks, table.concat( html_per_stack ) )
  +
end
  +
  +
local stackwise_summaries = ''
  +
if #html_stacks == 1 then
  +
table.insert( html, html_stacks[1] )
  +
else
  +
for i = 1, #html_stacks - 1 do
  +
table.insert( html, html_stacks[ i ] )
  +
table.insert( html, stack_sep )
  +
end
  +
table.insert( html, 'et ' )
  +
table.insert( html, html_stacks[#html_stacks] )
  +
end
  +
  +
table.insert( html, '.' )
  +
  +
return table.concat( html )
  +
  +
end
  +
  +
p.base2_test = function()
  +
  +
items = {}
  +
for item_name, v in pairs( p.items ) do
  +
table.insert( items, p.base2{ item_name, ["nocat"]=true } .. '\n\n' )
  +
end
  +
  +
table.sort( items )
  +
  +
return table.concat(items)
  +
end
  +
  +
  +
  +
  +
  +
  +
  +
  +
p.base3 = function( ... )
  +
  +
p.current_frame = mw.getCurrentFrame()
  +
  +
local args = { ... }
  +
if args[1] == p.current_frame then
  +
args = require( 'Module:ProcessArgs' ).merge( true )
  +
else
  +
args = args[1]
  +
end
  +
 
local z = args[1]
 
local z = args[1]
  +
 
local rC = {}
+
local html_java = {}
local rDC = {}
+
local html_java_u = {}
local bC = {}
+
local html_bedrock = {}
local bDC = {}
+
local html_bedrock_u = {}
  +
 
local rErr = ""
 
local rErr = ""
  +
 
 
local zT = {}
 
local zT = {}
 
if args[1] == "!!!TOUS!!!" then
 
if args[1] == "!!!TOUS!!!" then
Ligne 2 247 : Ligne 568 :
 
zT = mw.text.split( args[1], ',' )
 
zT = mw.text.split( args[1], ',' )
 
end
 
end
  +
 
local bandeau_java = ""
 
local bandeau_java_dev = ""
 
local bandeau_bedrock = ""
 
local bandeau_bedrock_dev = ""
 
 
 
for x, itemname in pairs( zT ) do
 
for x, itemname in pairs( zT ) do
  +
 
if p.items[itemname] == nil then
 
if p.items[itemname] == nil then
rErr = rErr .. "<span class='error'>Objet " .. itemname .. " inconnu</span>\n"
+
rErr = rErr .. "<span class='error'>Objet " .. itemname .. " inconnu.</span>\n"
 
else
 
else
  +
local javaChances, javaDevChances, bedrockChances, bedrockDevChances
 
  +
local javaChances, javaUpcomingChances, bedrockChances, bedrockUpcomingChances
javaChances = q.single_item_find_values( itemname, 'pools' )
 
  +
javaDevChances = q.single_item_find_values( itemname, 'poolsDev' )
 
  +
if args.java and args.java ~= '0' then
bedrockChances = q.single_item_find_values( itemname, 'poolsBedrock' )
 
bedrockDevChances = q.single_item_find_values( itemname, 'poolsDevBedrock' )
+
javaChances = q.single_item_find_values( itemname, 'poolsJava' )
  +
javaUpcomingChances = {}
 
  +
bedrockChances = {}
if q.tablelength( javaChances ) > 0 then
 
  +
bedrockUpcomingChances = {}
bandeau_java = '|-\n!colspan=5|'..p.java
 
  +
else
table.insert( rC, p.base2_sub( itemname, javaChances ) )
 
  +
if args['java-upcoming'] and args['java-upcoming'] ~= '0' then
  +
javaChances = q.single_item_find_values( itemname, 'poolsJavaUpcoming' )
  +
javaUpcomingChances = {}
  +
bedrockChances = {}
  +
bedrockUpcomingChances = {}
  +
else
  +
if args.bedrock and args.bedrock ~= '0' then
  +
javaChances = q.single_item_find_values( itemname, 'poolsBedrock' )
  +
javaUpcomingChances = {}
  +
bedrockChances = {}
  +
bedrockUpcomingChances = {}
  +
else
  +
if args['bedrock-upcoming'] and args['bedrock-upcoming'] ~= '0' then
  +
javaChances = q.single_item_find_values( itemname, 'poolsBedrockUpcoming' )
  +
javaUpcomingChances = {}
  +
bedrockChances = {}
  +
bedrockUpcomingChances = {}
  +
else
  +
javaChances = q.single_item_find_values( itemname, 'poolsJava' )
  +
javaUpcomingChances = q.single_item_find_values( itemname, 'poolsJavaUpcoming', javaChances )
  +
bedrockChances = q.single_item_find_values( itemname, 'poolsBedrock' )
  +
bedrockUpcomingChances = q.single_item_find_values( itemname, 'poolsBedrockUpcoming', javaChances, bedrockChances )
  +
end
  +
end
  +
end
 
end
 
end
  +
if q.tablelength( javaDevChances ) > 0 and q.compare_tables( javaChances, javaDevChances ) then
 
  +
local any_current = q.tablelength( javaChances ) > 0
bandeau_java_dev = '|-\n!colspan=5|'..p.java_dev
 
  +
local any_changes_upcoming = q.tablelength( javaUpcomingChances ) > 0 and q.compare_tables( javaChances, javaUpcomingChances )
table.insert( rDC, p.base2_sub( itemname, javaDevChances ) )
 
  +
local any_standard = any_current or any_changes_upcoming
  +
  +
local any_bedrock_current = q.tablelength( bedrockChances ) > 0
  +
local any_bedrock_upcoming = q.tablelength( bedrockUpcomingChances ) > 0 and q.compare_tables( bedrockChances, bedrockUpcomingChances )
  +
local any_bedrock = any_bedrock_current or any_bedrock_upcoming
  +
  +
if any_current then
  +
table.insert( html_java, p.base3_sub( itemname, javaChances ) )
 
end
 
end
if q.tablelength( bedrockChances ) > 0 then
+
if any_changes_upcoming then
  +
table.insert( html_java_u, p.base3_sub( itemname, javaUpcomingChances ) )
bandeau_bedrock = '|-\n!colspan=5|'..p.bedrock
 
table.insert( bC, p.base2_sub( itemname, bedrockChances ) )
 
 
end
 
end
  +
if any_bedrock_current then
if q.tablelength( bedrockDevChances ) > 0 and q.compare_tables( bedrockChances, bedrockDevChances ) then
 
  +
table.insert( html_bedrock, p.base3_sub( itemname, bedrockChances ) )
bandeau_bedrock_dev = '|-\n!colspan=5|'..p.bedrock_dev
 
table.insert( bDC, p.base2_sub( itemname, bedrockDevChances ) )
 
 
end
 
end
  +
if any_bedrock_upcoming then
end
 
  +
table.insert( html_bedrock_u, p.base3_sub( itemname, bedrockUpcomingChances ) )
  +
end
  +
  +
end
 
end
 
end
  +
 
return rErr .. '{| class="wikitable sortable" \n! Objet \n! Structure \n! Conteneur \n! Quantité \n! Chance \n' .. bandeau_java .. table.concat( rC ) .. bandeau_java_dev .. table.concat( rDC ) .. bandeau_bedrock .. table.concat( bC ) .. bandeau_bedrock_dev .. table.concat( bDC ) .. '|}' .. p.current_frame:extensionTag( 'references', "", { group="note" } )
+
local output = rErr .. '{| class="wikitable sortable" \n! Objet \n! Structure \n! Conteneur \n! Quantité \n! Chance \n'
  +
if q.tablelength( html_java ) > 0 then
  +
output = output .. '|-\n!colspan=5|' .. p['java'] .. ' \n' .. table.concat( html_java )
  +
end
  +
if q.tablelength( html_java_u ) > 0 then
  +
output = output .. '|-\n!colspan=5|' .. p['java-upcoming'] .. ' \n' .. table.concat( html_java_u )
  +
end
  +
if q.tablelength( html_bedrock ) > 0 then
  +
output = output .. '|-\n!colspan=5|' .. p.bedrock .. ' \n' .. table.concat( html_bedrock )
  +
end
  +
if q.tablelength( html_bedrock_u ) > 0 then
  +
output = output .. '|-\n!colspan=5|' .. p['bedrock-upcoming'] .. ' \n' .. table.concat( html_bedrock_u )
  +
end
  +
output = output .. '|}' .. p.current_frame:extensionTag( 'references', "", { group="FN" } )
  +
  +
return output
 
end
 
end
   
p.base2_sub = function( itemname, chances )
+
p.base3_sub = function( itemname, chances )
 
local html = {}
 
local html = {}
 
local item_display_name = ''
 
local item_display_name = ''
 
local output = ""
 
local output = ""
 
lang = mw.getContentLanguage()
 
lang = mw.getContentLanguage()
  +
 
 
if p.items[itemname].title ~= nil then
 
if p.items[itemname].title ~= nil then
 
item_display_name = p.items[itemname].title
 
item_display_name = p.items[itemname].title
 
else
 
else
item_display_name = string.gsub( itemname, '-', ' ' )
+
item_display_name = q.capitalize( string.gsub( itemname, '-', ' ' ) )
 
end
 
end
 
item_display_name = q.capitalize( item_display_name )
 
   
 
local listeObjet = {}
 
local listeObjet = {}
Ligne 2 303 : Ligne 668 :
 
local s = 0
 
local s = 0
 
local m = 0
 
local m = 0
  +
 
 
local rn = 0
 
local rn = 0
   
 
for stacksize, chest_details in pairs( chances ) do
 
for stacksize, chest_details in pairs( chances ) do
 
s = s + 1
 
s = s + 1
  +
 
 
local nc = q.tablelength( chest_details )
 
local nc = q.tablelength( chest_details )
 
local c = 0
 
local c = 0
Ligne 2 314 : Ligne 679 :
 
c = c + 1
 
c = c + 1
 
rn = rn + 1
 
rn = rn + 1
  +
local containerText = p.chests[chest.chest_name].conteneur
  +
if string.len(containerText) == 0 then
  +
containerText = 'Coffre'
  +
end
 
local r = ""
 
local r = ""
  +
 
r = r .. '|' .. p.chests[chest.chest_name].conteneur .. '\n|' .. stacksize .. '\n|' .. lang:formatNum( math.floor( chest.chance*1000 + 0.5 ) /10 ) .. ' %' .. '\n'
+
r = r .. '|' .. string.gsub( containerText, ' ', '&nbsp;' ) .. '\n|' .. stacksize .. '\n|' .. lang:formatNum( math.floor( chest.chance*1000 + 0.5 ) /10 ) .. '%' .. '\n'
 
if ns ~= s or nc ~= c then
 
if ns ~= s or nc ~= c then
r = r
+
r = r
 
end
 
end
  +
 
 
table.insert( listeObjet , { p.chests[chest.chest_name].structID , p.chests[chest.chest_name].structure, r } )
 
table.insert( listeObjet , { p.chests[chest.chest_name].structID , p.chests[chest.chest_name].structure, r } )
  +
 
 
end
 
end
 
m = m + nc
 
m = m + nc
Ligne 2 352 : Ligne 721 :
   
 
return "|-\n| rowspan=" .. m .. "|'''" .. p.getItem(itemname, item_display_name) .. "'''\n" .. output
 
return "|-\n| rowspan=" .. m .. "|'''" .. p.getItem(itemname, item_display_name) .. "'''\n" .. output
  +
 
 
end
 
end
   
Ligne 2 360 : Ligne 729 :
 
local link = item_display_name
 
local link = item_display_name
 
local m = itemname
 
local m = itemname
  +
 
 
if p.items[itemname].title ~= nil then
 
if p.items[itemname].title ~= nil then
 
k = p.items[itemname].title
 
k = p.items[itemname].title
Ligne 2 370 : Ligne 739 :
 
m = p.items[itemname].id
 
m = p.items[itemname].id
 
end
 
end
  +
 
 
if p.items[itemname][1] == "objet" then
 
if p.items[itemname][1] == "objet" then
 
s = p.current_frame:expandTemplate{ title = 'LienObjet', args = { link , k , id = m } }
 
s = p.current_frame:expandTemplate{ title = 'LienObjet', args = { link , k , id = m } }
Ligne 2 376 : Ligne 745 :
 
s = p.current_frame:expandTemplate{ title = 'LienBloc', args = { link , k , id = m } }
 
s = p.current_frame:expandTemplate{ title = 'LienBloc', args = { link , k , id = m } }
 
end
 
end
  +
if p.items[itemname].note ~= nil and p.items[itemname].note ~= "" then
 
s = s .. p.current_frame:extensionTag( 'ref', p.notes[p.items[itemname].note], { group='note', name=p.items[itemname].note } )
+
if p.items[itemname].note and p.notes[p.items[itemname].note] then
  +
s = s .. p.current_frame:extensionTag( 'ref', p.notes[p.items[itemname].note], { group='FN', name=p.items[itemname].note } )
 
end
 
end
  +
  +
if p.items[itemname].note1 and p.notes[p.items[itemname].note1] then
  +
if p.items[itemname].note == nil or p.notes[p.items[itemname].note] == nil or p.items[itemname].note ~= p.items[itemname].note1 then
  +
s = s .. p.current_frame:extensionTag( 'ref', p.notes[p.items[itemname].note1], { group='FN', name=p.items[itemname].note1 } )
  +
end
  +
end
  +
 
return s
 
return s
  +
 
 
end
 
end
  +
  +
  +
  +
  +
  +
  +
   
 
q = {
 
q = {
Ligne 2 390 : Ligne 774 :
 
return count
 
return count
 
end,
 
end,
  +
 
single_item_find_values = function( itemname, key )
+
deepcopy = function(orig)
  +
local orig_type = type(orig)
 
  +
local copy
  +
if orig_type == 'table' then
  +
copy = {}
  +
for orig_key, orig_value in next, orig, nil do
  +
copy[q.deepcopy(orig_key)] = q.deepcopy(orig_value)
  +
end
  +
setmetatable(copy, q.deepcopy(getmetatable(orig)))
  +
else -- number, string, boolean, etc
  +
copy = orig
  +
end
  +
return copy
  +
end,
  +
  +
single_item_find_values = function( itemname, poolsKey, exclusions_param, other_exclusions_param )
  +
 
local chances = {}
 
local chances = {}
  +
  +
local exclusions = q.deepcopy(exclusions_param or {})
  +
local other_exclusions = q.deepcopy(other_exclusions_param or {})
  +
  +
for stacksize, other_exclusion_list in pairs(other_exclusions) do
  +
if exclusions[stacksize] == nil then
  +
exclusions[stacksize] = {}
  +
end
  +
for _, other_exclusion in pairs(other_exclusion_list) do
  +
local already_in_here = false
  +
for _, exclusion in pairs(exclusions[stacksize]) do
  +
if exclusion["chest_name"] == other_exclusion["chest_name"] and exclusion["chance"] == other_exclusion["chance"] then
  +
already_in_here = true
  +
break
  +
end
  +
end
  +
if not already_in_here then
  +
table.insert( exclusions[stacksize], other_exclusion )
  +
end
  +
end
  +
end
   
 
for chest_name, chest in pairs( p.chests ) do
 
for chest_name, chest in pairs( p.chests ) do
 
local poolchances = {}
 
local poolchances = {}
for k, pool in pairs( chest[key] or chest.pools or {} ) do
+
for k, pool in pairs( chest[poolsKey] or chest.poolsJava or {} ) do
 
local poolitem = pool.items[itemname]
 
local poolitem = pool.items[itemname]
 
if poolitem ~= nil then
 
if poolitem ~= nil then
  +
 
 
local stacksize = poolitem[1]
 
local stacksize = poolitem[1]
 
if poolitem[1] ~= poolitem[2] then
 
if poolitem[1] ~= poolitem[2] then
stacksize = stacksize .. "-" .. poolitem[2]
+
stacksize = stacksize .. "" .. poolitem[2]
end
+
end
 
local itemweight = poolitem[3]
 
 
local pool_total_item_weight = 0
 
for itemname, item in pairs(pool.items) do
 
pool_total_item_weight = pool_total_item_weight + item[3]
 
end
 
 
local chance = p.calc_chance_any_of_this_item_per_pool(
 
pool.rolls[1], pool.rolls[2],
 
itemweight, pool_total_item_weight )
 
   
  +
local itemweight = poolitem[3]
if poolchances[stacksize] == nil then
 
  +
poolchances[stacksize] = chance
 
  +
local pool_total_item_weight = 0
else
 
  +
for itemname, item in pairs(pool.items) do
poolchances[stacksize] = poolchances[stacksize] + (1 - poolchances[stacksize]) * chance
 
  +
pool_total_item_weight = pool_total_item_weight + item[3]
  +
end
  +
  +
local chance = p.calc_chance_any_of_this_item_per_pool(
  +
pool.rolls[1], pool.rolls[2],
  +
itemweight, pool_total_item_weight )
  +
  +
if poolchances[stacksize] == nil then
  +
poolchances[stacksize] = chance
  +
else
  +
poolchances[stacksize] = poolchances[stacksize] + (1 - poolchances[stacksize]) * chance
  +
end
 
end
 
end
 
end
 
end
end
 
 
for stacksize, chance in pairs( poolchances ) do
 
for stacksize, chance in pairs( poolchances ) do
  +
local excluded = false
if chances[stacksize] == nil then
 
chances[stacksize] = {}
+
for _, exclusion in pairs( exclusions[stacksize] or {} ) do
  +
if exclusion["chest_name"] == chest_name and exclusion["chance"] == chance then
  +
excluded = true
  +
break
  +
end
  +
end
  +
if not excluded then
  +
if chances[stacksize] == nil then
  +
chances[stacksize] = {}
  +
end
  +
table.insert( chances[stacksize], { ["chance"]=chance, ["chest_name"]=chest_name, ["chest_type"]=( chest.chest_type or "chest" ) } )
 
end
 
end
table.insert( chances[stacksize], { ["chance"]=chance, ["chest_name"]=chest_name, ["chest_type"]=( chest.chest_type or "coffre" ) } )
 
 
end
 
end
 
end
 
end
   
 
return chances
 
return chances
  +
 
 
end,
 
end,
  +
 
  +
single_item_plural = function( itemname )
  +
  +
if string.sub( itemname, -2 ) == 'ss'
  +
or string.sub( itemname, -2 ) == 'ch'
  +
or string.sub( itemname, -2 ) == 'sh'
  +
or string.sub( itemname, -1 ) == 's' then
  +
return itemname .. 'es'
  +
end
  +
  +
return itemname .. 's'
  +
  +
end,
  +
 
massage_args = function( args )
 
massage_args = function( args )
   
 
-- find what columns to put
 
-- find what columns to put
  +
 
 
local columns = {}
 
local columns = {}
  +
 
 
for k, _arg in pairs(args) do
 
for k, _arg in pairs(args) do
 
if p.columns[_arg] ~= nil then
 
if p.columns[_arg] ~= nil then
Ligne 2 447 : Ligne 889 :
 
end
 
end
 
end
 
end
  +
 
 
if q.tablelength(columns) == 0 then
 
if q.tablelength(columns) == 0 then
 
for column_name, v in pairs(p.columns) do
 
for column_name, v in pairs(p.columns) do
Ligne 2 453 : Ligne 895 :
 
end
 
end
 
end
 
end
  +
 
 
-- find what chests to show
 
-- find what chests to show
   
 
local chests = {}
 
local chests = {}
  +
 
 
for k, _arg in pairs(args) do
 
for k, _arg in pairs(args) do
 
if p.chests[_arg] ~= nil then
 
if p.chests[_arg] ~= nil then
 
table.insert( chests, _arg )
 
table.insert( chests, _arg )
elseif p.synonyms[_arg] ~= nil then
+
elseif p.synonyms[_arg] ~= nil then
 
table.insert( chests, p.synonyms[_arg] )
 
table.insert( chests, p.synonyms[_arg] )
 
end
 
end
 
if p.display_names[_arg] ~= nil then
 
if p.display_names[_arg] ~= nil then
 
local chestname = _arg
 
local chestname = _arg
if p.chests[chestname] == nil then
+
if p.chests[chestname] == nil then
 
chestname = p.synonyms[_arg]
 
chestname = p.synonyms[_arg]
 
end
 
end
Ligne 2 472 : Ligne 914 :
 
end
 
end
 
end
 
end
  +
 
if #chests == 0 then
 
for chest_name, chest in pairs(p.chests) do
 
local chest_type = ( chest.chest_type or "coffre" )
 
if chest_type == "coffre" or chest_type == "wagonnet de stockage" then
 
table.insert( chests, chest_name )
 
end
 
end
 
end
 
 
 
table.sort( chests )
 
table.sort( chests )
  +
 
 
return chests, columns
 
return chests, columns
  +
 
 
end,
 
end,
   
 
sort_items = function( e1, e2 )
 
sort_items = function( e1, e2 )
  +
 
 
if e1.chanceany ~= e2.chanceany then return ( e1.chanceany > e2.chanceany ) end
 
if e1.chanceany ~= e2.chanceany then return ( e1.chanceany > e2.chanceany ) end
 
if e1.avgamount ~= e2.avgamount then return ( e1.avgamount > e2.avgamount ) end
 
if e1.avgamount ~= e2.avgamount then return ( e1.avgamount > e2.avgamount ) end
  +
 
 
if e1.material == nil then
 
if e1.material == nil then
  +
 
 
e1.material = 0
 
e1.material = 0
 
if string.find( e1.itemname, "cuir" ) ~= nil then e1.material = 1 end
 
if string.find( e1.itemname, "cuir" ) ~= nil then e1.material = 1 end
Ligne 2 500 : Ligne 933 :
 
if string.find( e1.itemname, "or" ) ~= nil then e1.material = 3 end
 
if string.find( e1.itemname, "or" ) ~= nil then e1.material = 3 end
 
if string.find( e1.itemname, "diamant" ) ~= nil then e1.material = 4 end
 
if string.find( e1.itemname, "diamant" ) ~= nil then e1.material = 4 end
  +
if string.find( e1.itemname, "netherite" ) ~= nil then e1.material = 5 end
 
e1.armor = 0
 
e1.armor = 0
 
if string.find( e1.itemname, "casque" ) ~= nil or string.find( e1.itemname, "chapeau" ) ~= nil then e1.armor = 1 end
 
if string.find( e1.itemname, "casque" ) ~= nil or string.find( e1.itemname, "chapeau" ) ~= nil then e1.armor = 1 end
Ligne 2 505 : Ligne 939 :
 
if string.find( e1.itemname, "jambières" ) ~= nil or string.find( e1.itemname, "pantalon" ) ~= nil then e1.armor = 3 end
 
if string.find( e1.itemname, "jambières" ) ~= nil or string.find( e1.itemname, "pantalon" ) ~= nil then e1.armor = 3 end
 
if string.find( e1.itemname, "bottes" ) ~= nil then e1.armor = 4 end
 
if string.find( e1.itemname, "bottes" ) ~= nil then e1.armor = 4 end
  +
 
 
end
 
end
  +
 
 
if e2.material == nil then
 
if e2.material == nil then
  +
 
 
e2.material = 0
 
e2.material = 0
 
if string.find( e2.itemname, "cuir" ) ~= nil then e2.material = 1 end
 
if string.find( e2.itemname, "cuir" ) ~= nil then e2.material = 1 end
Ligne 2 520 : Ligne 954 :
 
if string.find( e2.itemname, "jambières" ) ~= nil or string.find( e2.itemname, "pantalon" ) ~= nil then e2.armor = 3 end
 
if string.find( e2.itemname, "jambières" ) ~= nil or string.find( e2.itemname, "pantalon" ) ~= nil then e2.armor = 3 end
 
if string.find( e2.itemname, "bottes" ) ~= nil then e2.armor = 4 end
 
if string.find( e2.itemname, "bottes" ) ~= nil then e2.armor = 4 end
  +
 
 
end
 
end
  +
 
 
if e1.material ~= e2.material then return ( e1.material < e2.material ) end
 
if e1.material ~= e2.material then return ( e1.material < e2.material ) end
 
if e1.armor ~= e2.armor then return ( e1.armor < e2.armor ) end
 
if e1.armor ~= e2.armor then return ( e1.armor < e2.armor ) end
  +
 
 
return ( e1.itemname < e2.itemname )
 
return ( e1.itemname < e2.itemname )
  +
 
 
end,
 
end,
  +
 
 
fill_in_chest_derivative_data = function( chest_names )
 
fill_in_chest_derivative_data = function( chest_names )
   
Ligne 2 536 : Ligne 970 :
 
if chest == nil then break end
 
if chest == nil then break end
   
chest.allRolls = {}
+
chest.allRollsJava = {}
chest.itemData = {}
+
chest.itemDataJava = {}
for k, pool in pairs( chest.pools or {} ) do
+
for k, pool in pairs( chest.poolsJava or {} ) do
table.insert( chest.allRolls, q.tern( pool.rolls[1] == pool.rolls[2], pool.rolls[1], pool.rolls[1]..' à '..pool.rolls[2] ) )
+
table.insert( chest.allRollsJava, ( pool.rolls[1] == pool.rolls[2] and pool.rolls[1] or pool.rolls[1]..''..pool.rolls[2] ) )
   
 
local total_weight = 0
 
local total_weight = 0
Ligne 2 547 : Ligne 981 :
 
pool.totalweight = total_weight
 
pool.totalweight = total_weight
   
q.fill_in_chest_item_details( chest.itemData, pool, #chest.allRolls )
+
q.fill_in_chest_item_details( chest.itemDataJava, pool, #chest.allRollsJava )
 
end
 
end
   
chest.allRollsDev = {}
+
chest.allRollsJavaUpcoming = {}
chest.itemDataDev = {}
+
chest.itemDataJavaUpcoming = {}
for k, pool in pairs( chest.poolsDev or chest.pools or {} ) do
+
for k, pool in pairs( chest.poolsJavaUpcoming or chest.poolsJava or {} ) do
table.insert( chest.allRollsDev, q.tern( pool.rolls[1] == pool.rolls[2], pool.rolls[1], pool.rolls[1]..' à '..pool.rolls[2] ) )
+
table.insert( chest.allRollsJavaUpcoming, ( pool.rolls[1] == pool.rolls[2] and pool.rolls[1] or pool.rolls[1]..''..pool.rolls[2] ) )
   
 
local total_weight = 0
 
local total_weight = 0
Ligne 2 561 : Ligne 995 :
 
pool.totalweight = total_weight
 
pool.totalweight = total_weight
   
q.fill_in_chest_item_details( chest.itemDataDev, pool, #chest.allRollsDev )
+
q.fill_in_chest_item_details( chest.itemDataJavaUpcoming, pool, #chest.allRollsJavaUpcoming )
  +
end
  +
  +
chest.allRollsBedrock = {}
  +
chest.itemDataBedrock = {}
  +
for k, pool in pairs( chest.poolsBedrock or chest.poolsJava or {} ) do
  +
table.insert( chest.allRollsBedrock, ( pool.rolls[1] == pool.rolls[2] and pool.rolls[1] or pool.rolls[1]..'–'..pool.rolls[2] ) )
  +
  +
local total_weight = 0
  +
for itemname, item in pairs(pool.items) do
  +
total_weight = total_weight + item[3]
  +
end
  +
pool.totalweight = total_weight
  +
  +
q.fill_in_chest_item_details( chest.itemDataBedrock, pool, #chest.allRollsBedrock )
  +
end
  +
  +
chest.allRollsBedrockUpcoming = {}
  +
chest.itemDataBedrockUpcoming = {}
  +
for k, pool in pairs( chest.poolsBedrockUpcoming or chest.poolsJava or {} ) do
  +
table.insert( chest.allRollsBedrockUpcoming, ( pool.rolls[1] == pool.rolls[2] and pool.rolls[1] or pool.rolls[1]..'–'..pool.rolls[2] ) )
  +
  +
local total_weight = 0
  +
for itemname, item in pairs(pool.items) do
  +
total_weight = total_weight + item[3]
  +
end
  +
pool.totalweight = total_weight
  +
  +
q.fill_in_chest_item_details( chest.itemDataBedrockUpcoming, pool, #chest.allRollsBedrockUpcoming )
 
end
 
end
 
end
 
end
Ligne 2 574 : Ligne 1 036 :
 
local max_pool_rolls = pool.rolls[2]
 
local max_pool_rolls = pool.rolls[2]
 
local item_weight = item[3]
 
local item_weight = item[3]
  +
 
 
if data[item_name] == nil then
 
if data[item_name] == nil then
 
data[item_name] = {
 
data[item_name] = {
Ligne 2 593 : Ligne 1 055 :
 
end
 
end
   
data[item_name].avgamount = data[item_name].avgamount + p.calc_average_amount_this_item_per_pool(
+
data[item_name].avgamount = data[item_name].avgamount + p.calc_average_amount_this_item_per_pool(
min_stacksize, max_stacksize,
+
min_stacksize, max_stacksize,
min_pool_rolls, max_pool_rolls,
+
min_pool_rolls, max_pool_rolls,
 
item_weight, pool.totalweight )
 
item_weight, pool.totalweight )
  +
 
 
data[item_name].chanceany = data[item_name].chanceany + (1 - data[item_name].chanceany) * p.calc_chance_any_of_this_item_per_pool(
 
data[item_name].chanceany = data[item_name].chanceany + (1 - data[item_name].chanceany) * p.calc_chance_any_of_this_item_per_pool(
min_pool_rolls, max_pool_rolls,
+
min_pool_rolls, max_pool_rolls,
 
item_weight, pool.totalweight )
 
item_weight, pool.totalweight )
   
 
data[item_name].sortsize[ct] = ( min_stacksize + max_stacksize ) / 2
 
data[item_name].sortsize[ct] = ( min_stacksize + max_stacksize ) / 2
 
data[item_name].sortweight[ct] = item_weight;
 
data[item_name].sortweight[ct] = item_weight;
data[item_name].sizes[ct] = q.tern( min_stacksize == max_stacksize, min_stacksize, min_stacksize .. '–' .. max_stacksize )
+
data[item_name].sizes[ct] = ( min_stacksize == max_stacksize and min_stacksize or min_stacksize .. '–' .. max_stacksize )
 
data[item_name].weights[ct] = p.current_frame:expandTemplate{ title = 'fraction', args = { item_weight, pool.totalweight } }
 
data[item_name].weights[ct] = p.current_frame:expandTemplate{ title = 'fraction', args = { item_weight, pool.totalweight } }
 
end
 
end
Ligne 2 626 : Ligne 1 088 :
 
table.insert( items_from_first_table, item )
 
table.insert( items_from_first_table, item )
 
end
 
end
  +
 
 
table.sort( items_from_first_table, q.sort_items )
 
table.sort( items_from_first_table, q.sort_items )
  +
 
 
for k, item in pairs( items_from_first_table ) do
 
for k, item in pairs( items_from_first_table ) do
 
table.insert( item_names_ordered, item.itemname )
 
table.insert( item_names_ordered, item.itemname )
 
item_chests[item.itemname] = true
 
item_chests[item.itemname] = true
 
end
 
end
  +
 
 
return item_names_ordered, item_chests
 
return item_names_ordered, item_chests
 
end,
 
end,
Ligne 2 639 : Ligne 1 101 :
 
get_ordered_items_from_other_chests = function( chest_names, item_chests, suffix )
 
get_ordered_items_from_other_chests = function( chest_names, item_chests, suffix )
 
local items_not_from_first_table = {}
 
local items_not_from_first_table = {}
  +
 
 
for chest_idx = 2, #chest_names do
 
for chest_idx = 2, #chest_names do
 
for item_name, item in pairs( p.chests[chest_names[chest_idx]]['itemData'..suffix] ) do
 
for item_name, item in pairs( p.chests[chest_names[chest_idx]]['itemData'..suffix] ) do
Ligne 2 651 : Ligne 1 113 :
   
 
table.sort( items_not_from_first_table, q.sort_items )
 
table.sort( items_not_from_first_table, q.sort_items )
  +
 
 
return items_not_from_first_table
 
return items_not_from_first_table
 
end,
 
end,
Ligne 2 659 : Ligne 1 121 :
 
table.insert( item_names_ordered, item.itemname )
 
table.insert( item_names_ordered, item.itemname )
 
end
 
end
  +
 
 
return item_names_ordered
 
return item_names_ordered
 
end,
 
end,
Ligne 2 667 : Ligne 1 129 :
 
item_names_ordered[k] = {itemname}
 
item_names_ordered[k] = {itemname}
 
for chest_idx = 1, #chest_names do
 
for chest_idx = 1, #chest_names do
if suffix == 'Dev' or p.chests[chest_names[chest_idx]]['pools'..suffix] ~= nil then
+
if suffix == 'JavaUpcoming' or p.chests[chest_names[chest_idx]]['pools'..suffix] ~= nil then
 
local item_data = p.chests[chest_names[chest_idx]]['itemData'..suffix][itemname]
 
local item_data = p.chests[chest_names[chest_idx]]['itemData'..suffix][itemname]
 
if item_data == nil then
 
if item_data == nil then
Ligne 2 673 : Ligne 1 135 :
 
else
 
else
 
table.insert( item_names_ordered[k], item_data )
 
table.insert( item_names_ordered[k], item_data )
end
+
end
 
end
 
end
 
end
 
end
Ligne 2 684 : Ligne 1 146 :
 
-- for the first chest, sort its by chance desc, then by avg amount desc, then alphabetically asc
 
-- for the first chest, sort its by chance desc, then by avg amount desc, then alphabetically asc
 
local item_names_ordered, item_chests = q.construct_ordered_items_from_first_chest( chest_names, suffix )
 
local item_names_ordered, item_chests = q.construct_ordered_items_from_first_chest( chest_names, suffix )
  +
 
 
if #chest_names > 1 then
 
if #chest_names > 1 then
 
-- after that, sort all the remaining items in list order
 
-- after that, sort all the remaining items in list order
Ligne 2 693 : Ligne 1 155 :
 
-- set up item_names_ordered so that each is a row, representing chest values
 
-- set up item_names_ordered so that each is a row, representing chest values
 
item_names_ordered = q.set_up_ordered_item_rows( chest_names, item_names_ordered, suffix )
 
item_names_ordered = q.set_up_ordered_item_rows( chest_names, item_names_ordered, suffix )
  +
 
 
return item_names_ordered
 
return item_names_ordered
 
end,
 
end,
   
 
print_table = function( chest_names, columns, ordered_item_rows, suffix )
 
print_table = function( chest_names, columns, ordered_item_rows, suffix )
 
 
local html = {}
 
local html = {}
  +
 
 
local use_roll_row = false
 
local use_roll_row = false
 
local use_superheader = false
 
local use_superheader = false
Ligne 2 711 : Ligne 1 172 :
 
end
 
end
 
superheader_sizes[sh] = superheader_sizes[sh] + 1
 
superheader_sizes[sh] = superheader_sizes[sh] + 1
  +
use_superheader = true
 
  +
if #chest_names > 1 then
  +
use_superheader = true
  +
end
 
end
 
end
 
local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
 
local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
Ligne 2 721 : Ligne 1 185 :
 
use_roll_row = false
 
use_roll_row = false
 
end
 
end
  +
 
local rowspan = ( 1 + q.tern( #chest_names > 1, 1, 0 ) + q.tern( use_superheader, 1, 0 ) )
+
local rowspan = ( #chest_names > 1 and 1 or 0 ) + ( use_superheader and 1 or 0 ) + 1
 
local hide_col_description = rowspan > 1 and q.tablelength(columns) == 1
 
local hide_col_description = rowspan > 1 and q.tablelength(columns) == 1
 
if use_roll_row then
 
if use_roll_row then
 
rowspan = rowspan + 1
 
rowspan = rowspan + 1
 
end
 
end
  +
 
 
if q.tablelength(columns) == 1 then
 
if q.tablelength(columns) == 1 then
 
for column_name, v in pairs(columns) do
 
for column_name, v in pairs(columns) do
 
table.insert( html, "Les valeurs représentent " )
 
table.insert( html, "Les valeurs représentent " )
table.insert( html, p.columns[column_name] )
+
table.insert( html, p.columns[column_name]:lower() )
 
table.insert( html, "\n" )
 
table.insert( html, "\n" )
 
end
 
end
Ligne 2 737 : Ligne 1 201 :
   
 
if #chest_names == 1 then
 
if #chest_names == 1 then
  +
 
 
if q.tablelength(columns) == 1 then
 
if q.tablelength(columns) == 1 then
 
table.insert( html, "<br>" )
 
table.insert( html, "<br>" )
 
end
 
end
  +
 
 
local chest_name = chest_names[1]
 
local chest_name = chest_names[1]
 
local allRolls = p.chests[chest_name]['allRolls'..suffix]
 
local allRolls = p.chests[chest_name]['allRolls'..suffix]
Ligne 2 749 : Ligne 1 213 :
   
 
chest_name = chest_name:gsub( "-", " " )
 
chest_name = chest_name:gsub( "-", " " )
  +
 
  +
if chest_type ~= 'coffre' and chest_type ~= 'wagonnet de stockage' then
table.insert( html, "Chaque coffre " )
 
  +
table.insert( html, "Chaque " )
  +
else
  +
table.insert( html, "Chaque coffre " )
 
if string.find(mw.ustring.lower(chest_name), 'bonus') == nil then -- "coffre bonus", pas "coffre de bonus"
 
if string.find(mw.ustring.lower(chest_name), 'bonus') == nil then -- "coffre bonus", pas "coffre de bonus"
 
if string.find(mw.ustring.lower(chest_name), '^[aeiouyéÉ]') ~= nil then -- "coffre d'entrepôt", pas "coffre de entrepôt"
 
if string.find(mw.ustring.lower(chest_name), '^[aeiouyéÉ]') ~= nil then -- "coffre d'entrepôt", pas "coffre de entrepôt"
Ligne 2 758 : Ligne 1 225 :
 
end
 
end
 
end
 
end
  +
end
  +
 
table.insert( html, display_name or chest_name )
 
table.insert( html, display_name or chest_name )
 
table.insert( html, " contient " )
 
table.insert( html, " contient " )
Ligne 2 765 : Ligne 1 234 :
 
table.insert( html, #allRolls )
 
table.insert( html, #allRolls )
 
table.insert( html, ' groupes de ' )
 
table.insert( html, ' groupes de ' )
local s = q.tern( #allRolls > 2, ', ', ' ' )
+
local s = ( #allRolls > 2 and ', ' or ' ' )
 
for i = 1, #allRolls-1 do
 
for i = 1, #allRolls-1 do
 
table.insert( html, allRolls[i] )
 
table.insert( html, allRolls[i] )
Ligne 2 775 : Ligne 1 244 :
 
table.insert( html, " piles d'objets, avec la répartition suivante : \n" )
 
table.insert( html, " piles d'objets, avec la répartition suivante : \n" )
 
end
 
end
  +
 
 
table.insert( html, '<div style="overflow:auto">\n' )
 
table.insert( html, '<div style="overflow:auto">\n' )
table.insert( html, "<table class='wikitable sortable jquery-tablesorter'>\n" )
+
table.insert( html, '<table class="wikitable sortable jquery-tablesorter">\n' )
 
table.insert( html, "<tr>\n" )
 
table.insert( html, "<tr>\n" )
 
table.insert( html, "<th rowspan=" )
 
table.insert( html, "<th rowspan=" )
table.insert( html, ( rowspan - q.tern( hide_col_description, 1, 0 ) ) )
+
table.insert( html, ( rowspan - ( hide_col_description and 1 or 0 ) ) )
table.insert( html, "></th>\n" )
+
table.insert( html, "> Objet </th>\n" )
  +
 
 
local superheader_cols_used = {}
 
local superheader_cols_used = {}
  +
 
 
if #chest_names > 1 then
 
if #chest_names > 1 then
 
local row1, row2 = {}, {}
 
local row1, row2 = {}, {}
   
 
for i = 1, #chest_names do
 
for i = 1, #chest_names do
  +
 
if suffix == 'Dev' or p.chests[chest_names[i]]['pools'..suffix] ~= nil then
+
if suffix == 'JavaUpcoming' or p.chests[chest_names[i]]['pools'..suffix] ~= nil then
 
local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
 
local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
 
local colspan = q.tablelength(columns)
 
local colspan = q.tablelength(columns)
Ligne 2 801 : Ligne 1 270 :
 
end
 
end
 
local row = row1
 
local row = row1
  +
 
 
rowspan = 1
 
rowspan = 1
 
if use_superheader then
 
if use_superheader then
Ligne 2 836 : Ligne 1 305 :
 
table.insert( row, allRolls[1] )
 
table.insert( row, allRolls[1] )
 
else
 
else
local s = q.tern( #allRolls > 2, ', ', ' ' )
+
local s = ( #allRolls > 2 and ', ' or ' ' )
 
for i = 1, #allRolls-1 do
 
for i = 1, #allRolls-1 do
 
table.insert( row, allRolls[i] )
 
table.insert( row, allRolls[i] )
Ligne 2 849 : Ligne 1 318 :
 
end
 
end
 
end
 
end
  +
 
 
table.insert( html, table.concat( row1 ) )
 
table.insert( html, table.concat( row1 ) )
 
table.insert( html, "</tr><tr>\n" )
 
table.insert( html, "</tr><tr>\n" )
Ligne 2 866 : Ligne 1 335 :
 
end
 
end
 
for i = 1, #chest_names do
 
for i = 1, #chest_names do
if suffix == 'Dev' or p.chests[chest_names[i]]['pools'..suffix] ~= nil then
+
if suffix == 'JavaUpcoming' or p.chests[chest_names[i]]['pools'..suffix] ~= nil then
 
local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
 
local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
 
local allRollsSpan = #allRolls == 0 and 1 or #allRolls
 
local allRollsSpan = #allRolls == 0 and 1 or #allRolls
Ligne 2 876 : Ligne 1 345 :
 
end
 
end
   
if columns['taillepiles'] ~= nil then
+
if columns['taillepiles'] ~= nil then
table.insert( html, headersort_th_colspan_open )
+
table.insert( html, headersort_th_colspan_open )
table.insert( html, p.columns['taillepiles'] )
+
table.insert( html, p.columns['taillepiles'] )
table.insert( html, "'> Taille des piles </abbr></th>\n" )
+
table.insert( html, "'> Taille des piles </abbr> <span class=mobileonly>")
  +
table.insert( html, p.current_frame:extensionTag{
end
 
  +
name = 'ref', content = p.columns['taillepiles'], args = { name = 'taillepiles', group = 'FN' }
if columns['poids'] ~= nil then
 
  +
} )
table.insert( html, headersort_th_colspan_open )
 
table.insert( html, p.columns['poids'] )
+
table.insert( html, "</span></th>\n" )
  +
end
table.insert( html, "'> Poids" )
 
  +
if columns['poids'] ~= nil then
table.insert( html, "</abbr></th>\n" )
 
  +
table.insert( html, headersort_th_colspan_open )
end
 
if columns['objets'] ~= nil then
+
table.insert( html, p.columns['poids'] )
table.insert( html, headersort_th_open )
+
table.insert( html, "'> Poids </abbr> <span class=mobileonly> ")
table.insert( html, p.columns['objets'] )
+
table.insert( html, p.current_frame:extensionTag{
  +
name = 'ref', content = p.columns['poids'], args = { name = 'poids', group = 'FN' }
table.insert( html, "'> Nb. d'objets </abbr></th>\n" )
 
end
+
} )
  +
table.insert( html, "</span></th>\n" )
if columns['probabilité'] ~= nil then
 
  +
end
table.insert( html, headersort_th_open )
 
table.insert( html, p.columns['probabilité'] )
+
if columns['probabilité'] ~= nil then
table.insert( html, "'> Probabilité </abbr></th>\n" )
+
table.insert( html, headersort_th_open )
  +
table.insert( html, p.columns['probabilité'] )
end
 
  +
table.insert( html, "'> Probabilité </abbr> <span class=mobileonly> ")
if columns['coffres'] ~= nil then
 
table.insert( html, headersort_th_open )
+
table.insert( html, p.current_frame:extensionTag{
  +
name = 'ref', content = p.columns['probabilité'], args = { name = 'probabilité', group = 'FN' }
table.insert( html, p.columns['coffres'] )
 
  +
} )
table.insert( html, "'> Nb. de coffres à ouvrir </abbr></th>\n" )
 
  +
table.insert( html, "</span></th>\n" )
  +
end
  +
if columns['objets'] ~= nil then
  +
table.insert( html, headersort_th_open )
  +
table.insert( html, p.columns['objets'] )
  +
table.insert( html, "'> Nb. d'objets </abbr> <span class=mobileonly> ")
  +
table.insert( html, p.current_frame:extensionTag{
  +
name = 'ref', content = p.columns['objets'], args = { name = 'objets', group = 'FN' }
  +
} )
  +
table.insert( html, "</span></th>\n" )
  +
end
  +
if columns['coffres'] ~= nil then
  +
table.insert( html, headersort_th_open )
  +
table.insert( html, p.columns['coffres'] )
  +
table.insert( html, "'> Nb. de coffres à ouvrir </abbr> <span class=mobileonly> ")
  +
table.insert( html, p.current_frame:extensionTag{
  +
name = 'ref', content = p.columns['coffres'], args = { name = 'coffres', group = 'FN' }
  +
} )
  +
table.insert( html, "</span></th>\n" )
 
end
 
end
 
end
 
end
Ligne 2 906 : Ligne 1 394 :
 
table.insert( html, "</tr><tr>\n" )
 
table.insert( html, "</tr><tr>\n" )
 
end
 
end
  +
 
 
if use_roll_row then
 
if use_roll_row then
 
local rowcols = ( columns['taillepiles'] ~= nil and 1 or 0 ) + ( columns['poids'] ~= nil and 1 or 0 )
 
local rowcols = ( columns['taillepiles'] ~= nil and 1 or 0 ) + ( columns['poids'] ~= nil and 1 or 0 )
Ligne 2 914 : Ligne 1 402 :
 
for j = 1, rowcols do
 
for j = 1, rowcols do
 
for k = 1, #allRolls do
 
for k = 1, #allRolls do
table.insert( html, "<th class='headersort' role='columnheader button' data-sort-type='number' style='font-weight:normal'>" )
+
table.insert( html, "<th class='headersort' role='columnheader button' data-sort-type='number' style='font-weight:normal'><abbr title='Le coffre choisit " )
  +
table.insert( html, allRolls[k] )
  +
table.insert( html, " pile(s) aléatoirement parmi celles-ci.'>" )
 
table.insert( html, allRolls[k] )
 
table.insert( html, allRolls[k] )
table.insert( html, "×</th>\n" )
+
table.insert( html, "×</abbr></th>\n" )
 
end
 
end
 
end
 
end
Ligne 2 929 : Ligne 1 419 :
   
 
local chest_item = ordered_item_rows[i][j]
 
local chest_item = ordered_item_rows[i][j]
  +
 
 
if type( chest_item ) == "table" then
 
if type( chest_item ) == "table" then
  +
 
 
local avg_amount = string.format("%.3f", chest_item.avgamount)
 
local avg_amount = string.format("%.3f", chest_item.avgamount)
local chance_any = string.format("%.1f", chest_item.chanceany*100) .. " %"
+
local chance_any = string.format("%.1f", chest_item.chanceany*100) .. "%"
 
local num_chests = string.format("%.1f", 1/chest_item.chanceany)
 
local num_chests = string.format("%.1f", 1/chest_item.chanceany)
  +
 
 
table.insert( html, "\n" )
 
table.insert( html, "\n" )
 
if columns['taillepiles'] ~= nil then
 
if columns['taillepiles'] ~= nil then
 
for k = 1, #chest_item.sizes do
 
for k = 1, #chest_item.sizes do
 
table.insert( html, "<td style='text-align:center;' data-sort-value='" )
 
table.insert( html, "<td style='text-align:center;' data-sort-value='" )
table.insert( html, chest_item.sortsize[k] )
+
table.insert( html, ( chest_item.sortsize[k] == 0 and "9e99" or chest_item.sortsize[k] ) )
 
table.insert( html, "'>" )
 
table.insert( html, "'>" )
 
table.insert( html, chest_item.sizes[k] )
 
table.insert( html, chest_item.sizes[k] )
Ligne 2 949 : Ligne 1 439 :
 
for k = 1, #chest_item.sizes do
 
for k = 1, #chest_item.sizes do
 
table.insert( html, "<td style='text-align:center;' data-sort-value='" )
 
table.insert( html, "<td style='text-align:center;' data-sort-value='" )
table.insert( html, chest_item.sortweight[k] )
+
table.insert( html, ( chest_item.sortweight[k] == 0 and "9e99" or chest_item.sortweight[k] ) )
 
table.insert( html, "'>" )
 
table.insert( html, "'>" )
 
table.insert( html, chest_item.weights[k] )
 
table.insert( html, chest_item.weights[k] )
 
table.insert( html, "</td>" )
 
table.insert( html, "</td>" )
 
end
 
end
  +
end
  +
if columns['probabilité'] ~= nil then
  +
table.insert( html, "<td style='text-align:center;'>" )
  +
table.insert( html, chance_any )
  +
table.insert( html, "</td>" )
 
end
 
end
 
if columns['objets'] ~= nil then
 
if columns['objets'] ~= nil then
 
table.insert( html, "<td style='text-align:center;'>" )
 
table.insert( html, "<td style='text-align:center;'>" )
 
table.insert( html, avg_amount )
 
table.insert( html, avg_amount )
table.insert( html, "</td>" )
 
end
 
if columns['probabilité'] ~= nil then
 
table.insert( html, "<td style='text-align:right;'>" )
 
table.insert( html, chance_any )
 
 
table.insert( html, "</td>" )
 
table.insert( html, "</td>" )
 
end
 
end
 
if columns['coffres'] ~= nil then
 
if columns['coffres'] ~= nil then
table.insert( html, "<td style='text-align:right;'>" )
+
table.insert( html, "<td style='text-align:center;'>" )
 
table.insert( html, num_chests )
 
table.insert( html, num_chests )
 
table.insert( html, "</td>" )
 
table.insert( html, "</td>" )
 
end
 
end
  +
 
 
elseif type( chest_item ) == "boolean" then
 
elseif type( chest_item ) == "boolean" then
 
local allRolls = p.chests[chest_names[j-1]]['allRolls'..suffix]
 
local allRolls = p.chests[chest_names[j-1]]['allRolls'..suffix]
Ligne 2 978 : Ligne 1 468 :
 
if columns['taillepiles'] ~= nil then
 
if columns['taillepiles'] ~= nil then
 
for k = 1, allRollsSpan do
 
for k = 1, allRollsSpan do
table.insert( html, "<td data-sort-value='0' style='text-align:center;'>—</td>" )
+
table.insert( html, "<td data-sort-value='9e99' style='text-align:center;'>—</td>" )
 
end
 
end
 
end
 
end
 
if columns['poids'] ~= nil then
 
if columns['poids'] ~= nil then
 
for k = 1, allRollsSpan do
 
for k = 1, allRollsSpan do
table.insert( html, "<td data-sort-value='0' style='text-align:center;'>—</td>" )
+
table.insert( html, "<td data-sort-value='9e99' style='text-align:center;'>—</td>" )
 
end
 
end
end
 
if columns['objets'] ~= nil then
 
table.insert( html, "<td data-sort-value='0' style='text-align:center;'>—</td>" )
 
 
end
 
end
 
if columns['probabilité'] ~= nil then
 
if columns['probabilité'] ~= nil then
table.insert( html, "<td data-sort-value='0' style='text-align:right;'>—</td>" )
+
table.insert( html, "<td data-sort-value='9e99' style='text-align:center;'>—</td>" )
  +
end
  +
if columns['objets'] ~= nil then
  +
table.insert( html, "<td data-sort-value='9e99' style='text-align:center;'>—</td>" )
 
end
 
end
 
if columns['coffres'] ~= nil then
 
if columns['coffres'] ~= nil then
table.insert( html, "<td data-sort-value='9e99' style='text-align:right;'>—</td>" )
+
table.insert( html, "<td data-sort-value='9e99' style='text-align:center;'>—</td>" )
 
end
 
end
 
else
 
else
Ligne 2 999 : Ligne 1 489 :
 
table.insert( html, "</tr><tr>" )
 
table.insert( html, "</tr><tr>" )
 
end
 
end
  +
 
 
local item = p.items[chest_item]
 
local item = p.items[chest_item]
  +
 
 
local s = require( 'Module:Sprite' )
 
local s = require( 'Module:Sprite' )
 
table.insert( html, "\n<td>" )
 
table.insert( html, "\n<td>" )
local image, spriteCat = s.link{
+
local image, spriteCat = s.link {
id=item.id or chest_item,
+
id = item.id or chest_item,
link=item.link or item.title or string.gsub(chest_item,'-',' '),
+
link = item.link or item.title or string.gsub(chest_item,'-',' '),
text=q.capitalize(item.title or string.gsub(chest_item,'-',' ')),
+
text = q.capitalize(item.title or string.gsub(chest_item,'-',' ')),
  +
wrap = 'true',
data= q.tern( item[1] == 'objet', 'ObjetSprite', 'BlocSprite' )
 
  +
data = ( item[1] == 'objet' and 'ObjetSprite' or 'BlocSprite' )
 
}
 
}
 
table.insert( html, image )
 
table.insert( html, image )
 
table.insert( html, spriteCat )
 
table.insert( html, spriteCat )
  +
 
if item.note and p.notes[item.note] then
 
if item.note and p.notes[item.note] then
table.insert( html, p.current_frame:extensionTag( 'ref', p.notes[item.note], { group='note', name=item.note } ) )
+
table.insert( html, p.current_frame:extensionTag( 'ref', p.notes[item.note], { group='FN', name=item.note } ) )
 
end
 
end
  +
  +
if item.note1 and p.notes[item.note1] then
  +
if item.note == nil or p.notes[item.note] == nil or item.note ~= item.note1 then
  +
table.insert( html, p.current_frame:extensionTag( 'ref', p.notes[item.note1], { group='FN', name=item.note1 } ) )
  +
end
  +
end
  +
 
table.insert( html, "</td>" )
 
table.insert( html, "</td>" )
 
end
 
end
  +
 
 
if j == #ordered_item_rows[i] then
 
if j == #ordered_item_rows[i] then
 
table.insert( html, "</tr>" )
 
table.insert( html, "</tr>" )
 
end
 
end
  +
 
 
end
 
end
 
table.insert( html, "\n" )
 
table.insert( html, "\n" )
 
end
 
end
 
end
 
end
  +
 
table.insert( html, "</table></div>" )
+
table.insert( html, "</table></div>")
  +
 
 
return table.concat( html )
 
return table.concat( html )
  +
 
 
end,
 
end,
  +
 
 
titlecase = function( str )
 
titlecase = function( str )
 
local buf = {}
 
local buf = {}
Ligne 3 040 : Ligne 1 539 :
 
else
 
else
 
local first, rest = string.sub( word, 1, 1 ), string.sub( word, 2 )
 
local first, rest = string.sub( word, 1, 1 ), string.sub( word, 2 )
table.insert( buf, mw.ustring.upper(first) .. mw.ustring.lower(rest) )
+
table.insert( buf, string.upper(first) .. string.lower(rest) )
 
end
 
end
end
+
end
 
return table.concat( buf, " " )
 
return table.concat( buf, " " )
 
end,
 
end,
  +
 
 
capitalize = function( str )
 
capitalize = function( str )
return ( str:gsub( "^%l", mw.ustring.upper ):gsub( "^é", "É" ) )
+
return ( string.lower(str):gsub( "^%l", string.upper ):gsub( "^é", "É" ) )
 
end,
 
end,
  +
 
 
lcfirst = function( str )
 
lcfirst = function( str )
 
return ( string.gsub( str, "^%u", string.lower ) )
 
return ( string.gsub( str, "^%u", string.lower ) )
end,
 
 
tern = function( cond , T , F )
 
if cond then return T else return F end
 
 
end,
 
end,
   

Dernière version du 21 avril 2023 à 09:34

Ce module permet de gérer les modèles {{CoffreRécompenses}} et {{CoffreRécompensesObjet}}.

  • p.base() est la fonction qui permet de générer un tableau pour chaque coffre ;
  • p.base2() est la fonction qui permet de générer un tableau avec un ou plusieurs objets.

Voir les modèles respectifs pour plus d'information sur l'utilisation.

Les données utilisées par le module sont situées dans les tableaux du haut de la page.

Maintenance

Voir aussi : Module:CoffreRécompenses/objets et Module:CoffreRécompenses/coffres
[voir | modifier | historique | purger]La documentation ci-dessus est insérée depuis Module:CoffreRécompenses/doc.
local p = {

	calc_average_amount_this_item_per_pool = function( 
			min_stacksize, max_stacksize,
			min_pool_rolls, max_pool_rolls, 
			item_weight, pool_total_item_weight )

		local avg_stacksize = ( min_stacksize + max_stacksize ) / 2
		local avg_rolls = ( min_pool_rolls + max_pool_rolls ) / 2
		
		return avg_stacksize * avg_rolls * item_weight / pool_total_item_weight
		
	end,
	
	calc_chance_any_of_this_item_per_pool = function( 
			min_pool_rolls, max_pool_rolls,
			item_weight, pool_total_item_weight )

		local inverse_result = 0 -- 1 - inverse_result = return value
		local inverse_item_weight = pool_total_item_weight - item_weight
		
		-- will be used for the division in the for loop to avoid the slightly
		-- less performant math.pow(). The divisor already includes the probability
		-- of picking any specific number of rolls.
		local cur_dividend = pool_total_item_weight
		local cur_divisor = pool_total_item_weight * (max_pool_rolls - min_pool_rolls + 1)
		
		for i = 0, max_pool_rolls do
			if i >= min_pool_rolls then
				inverse_result = inverse_result + cur_dividend / cur_divisor
			end
			cur_dividend = cur_dividend * inverse_item_weight -- simulate pow
			cur_divisor = cur_divisor * pool_total_item_weight -- simulate pow
		end
		
		return 1 - inverse_result
		
	end,
	
	java = '[[version Java]]\n',
	['java-upcoming'] = '[[version Java 1.20]]\n',
	bedrock = '[[version Bedrock]]\n',
	['bedrock-upcoming']= '[[version Bedrock 1.20.0]]\n',
	
	-- These 'items' define which sprite, label and link to use in the table.
	-- Properties 'cannot_stack', 'preserve_case', and 'plural' describe how to display the single-item summary in p.base2.
	-- Order within this 'items' list doesn't matter.
	-- mettre article="partitif" fait utiliser "du" ou "de la" devant l'objet
	-- il faut mettre genre="féminin" pour les objets au nom féminin
	

	items = require("Module:CoffreRécompenses/objets"),

	notes = {
		["enchant-aléatoire"] = "La probabilité de tous les enchantements et niveaux d'enchantement est égale, ''y compris'' les enchantements de type Trésor (sauf [[Agilité des âmes]] et [[Furtivité rapide]]).",
		["enchant-aléatoire-agilité-âmes"] = "Enchanté avec un niveau aléatoire d'[[Agilité des âmes]].",
		["enchant-aléatoire-furtivité-rapide"] = "Enchanté avec un niveau aléatoire de [[Furtivité rapide]].",
		["enchant-5-15"] = "La probabilité de tous les enchantements (sauf [[Agilité des âmes]] et [[Furtivité rapide]]) est la même que pour une utilisation d'une [[table d'enchantement]] de niveau compris entre 5 et 15, mais la probabilité des enchantements multiples n'est pas réduite.",
		["enchant-5-20"] = "La probabilité de tous les enchantements (sauf [[Agilité des âmes]] et [[Furtivité rapide]]) est la même que pour une utilisation d'une [[table d'enchantement]] de niveau compris entre 5 et 20, mais la probabilité des enchantements multiples n'est pas réduite.",
		["enchant-20-25"] = "La probabilité de tous les enchantements (sauf [[Agilité des âmes]] et [[Furtivité rapide]]) est la même que pour une utilisation d'une [[table d'enchantement]] de niveau compris entre 20 et 25, mais la probabilité des enchantements multiples n'est pas réduite.",
		["enchant-20-39"] = "La probabilité de tous les enchantements (sauf [[Agilité des âmes]] et [[Furtivité rapide]]) est la même que pour une utilisation d'une [[table d'enchantement]] de niveau compris entre 20 et 39, mais la probabilité des enchantements multiples n'est pas réduite.",
		["enchant-30"] = "La probabilité de tous les enchantements (sauf [[Agilité des âmes]] et [[Furtivité rapide]]) est la même que pour une utilisation d'une [[table d'enchantement]] de niveau 30, mais la probabilité des enchantements multiples n'est pas réduite.",
		["enchant-30-50"] = "La probabilité de tous les enchantements (sauf [[Agilité des âmes]] et [[Furtivité rapide]]) est la même que pour une utilisation d'une [[table d'enchantement]] de niveau compris entre 30 et 50, mais la probabilité des enchantements multiples n'est pas réduite.",

		["endommagé-0.05-0.15"] = "L'objet aura entre 5 % et 15 % de sa durabilité totale.",
		["endommagé-0.1-0.5"] = "L'objet aura entre 10 % et 50 % de sa durabilité totale.",
		["endommagé-0.1-0.9"] = "L'objet aura entre 10 % et 90 % de sa durabilité totale.",
		["endommagé-0.1-0.95"] = "L'objet aura entre 10 % et 95 % de sa durabilité totale.",
		["endommagé-0.15-0.45"] = "L'objet aura entre 15 % et 45 % de sa durabilité totale.",
	    ["endommagé-0.15-0.8"] = "L'objet aura entre 15 % et 80 % de sa durabilité totale.",
		["endommagé-0.15-0.85"] = "L'objet aura entre 15 % et 85 % de sa durabilité totale.",
		["endommagé-0.15-0.95"] = "L'objet aura entre 15 % et 95 % de sa durabilité totale.",
		["endommagé-0.2-0.65"] = "L'objet aura entre 20 % et 64 % de sa durabilité totale.",
		["endommagé-0.8-1.0"] = "L'objet aura entre 80 % et 100 % de sa durabilité totale.",
		["rien"] = "'Rien' ne fait pas référence à la chance d'avoir un coffre vide. Il fait plutôt référence à la chance que le générateur de butin aléatoire n'ajoute aucun butin ''sur un seul jet .",
		
        ["soupe-suspecte"] = "La soupe confère l'un des effets suivants : 5 à 7 secondes de [[Cécité]], 7 à 10 secondes de [[Sauts améliorés]], 7 à 10 secondes de [[Nyctalopie]], 10 à 20 secondes de [[Poison]], 7 à 10 secondes de [[Saturation]] ou 6 à 8 secondes de [[Faiblesse]].",
        ["soupe-suspecte-2"] = "La soupe confère l'un des effets suivants : 5 à 7 secondes de [[Cécité]] ou 7 à 10 secondes de [[Nyctalopie]].",

	},
	
	-- <ref group='FN' name='enchant-randomly'>
	
	-- NOTE: order here doesn't matter.  
	--		 * in the table, chests are sorted in alphabetical order
	--       * in the table, items are sorted by chance, then by avg#, then alphabetically.
	--       * If poolsJavaUpcoming is omitted, poolsJava is used. To omit a pool entirely, set it to {}.
	--       * If the loot is the same on both editions, use the same loot table twice.
	
	chests = require("Module:CoffreRécompenses/coffres"),

	-- these values are used:
	-- * in place of the keys, when the key is used as a parameter
	
	-- chest-param -> internally-valid-chest-param
	
	synonyms = {
		["jungle"] = "temple-jungle",
		["pyramide"] = "temple-désert",
		["nether"] = "forteresse-nether",
		["forteresse"] = "forteresse-nether",
		
		["armurerie"] = "village-armurerie",
		["boucherie"] = "village-boucherie",
		["cartographe"] = "village-cartographe",
		["maçon"] = "village-maçon",
		["bergerie"] = "village-bergerie",
		["tannerie"] = "village-tannerie",
		["forgeron-armes"] = "village-forgeron-armes",
		["forgeron-outils"]     = "village-forgeron-outils",
		
		["désert"] = "village-désert",
		["plaine"] = "village-plaine",
		["savane"] = "village-savane",
		["toundra"] = "village-toundra",
		["taïga"] = "village-taïga",

		["autel"] = "autel-fort",
		["entrepôt"] = "entrepôt-fort",
		["bibliothèque"] = "bibliothèque-fort",
		["écuries-hoglin"] = "bastion-écuries-hoglin",
		["bastion-autre"] = "bastion",

        ["pyramide-brosse"] = "temple-désert-brosse"
		
	},

	-- these values are used:
	-- * in the header-description of a table showing only a single chest
	-- * if the key is not here, but it is a valid chest parameter,
	--   that header-description will default to use the key string from p.chests,
	--   e.g. "forteresse-nether"
	
	-- chest-param -> description-string
	
	display_names = {
		["puits-de-mine-abandonné"] = "puits de mine abandonné",
		["forteresse-nether"] = "forteresse du Nether",
		["nether"] = "forteresse du Nether",
		["forteresse"] = "forteresse du Nether",
		["armurerie"] = "armurerie de village",
		["boucherie"] = "boucherie de village",
		["cartographe"] = "cartographe de village",
		["maçon"] = "maçon de village",
		["bergerie"] = "bergerie de village",
		["tannerie"] = "tannerie de village",
		["village-temple"] = "temple de village",
		["forgeron-armes"] = "forgeron d'armes de village",
		["forgeron-outils"] = "forgeron d'outils de village",
		["désert"] = "maison de village du desert",
		["plaine"] = "maison de village des plaines",
		["savane"] = "maison de village de la savane",
		["toundra"] = "maison de village de la toundra",
		["taïga"] = "maison de village de la taïga",
		["jungle"] = "temple de la jungle",
		["temple-désert"] = "pyramide",
		["temple-jungle"] = "temple de la jungle",
		["distributeur-temple-jungle"] = "distributeur de temple de la jungle",
		["autel-fort"] = "autel",
		["bibliothèque-fort"] = "bibliothèque",
		["entrepôt-fort"] = "entrepôt",
		["cité-end"] = "cité de l\'End",
		["bastion-pont"] = "pont de vestiges de bastion",
		["bastion-écuries-hoglin"] = "écuries de Hoglin",
		["bastion-autre"] =  "bastion",
		["bastion-trésor"] = "salle au trésor de vestiges de bastion",
		["temple-désert-brosse"] = "sable suspect de pyramide",
		["ruines-sous-marines-froides-brosse"] = "gravier suspect de ruines sous-marines froides",
		["ruines-sous-marines-chaudes-brosse"] = "sable suspect de ruines sous-marines chaudes",
		["puits-du-désert-brosse"] = "sable suspect de puits du désert",
		["ruines-de-sentier-brosse"] = "gravier suspect commun de ruines de sentier",
		["ruines-de-sentier-brosse-rare"] = "gravier suspect rare de ruines de sentier"
	},
	
	-- these descriptions are used:
	-- * in column <abbr> titles,
	-- * and above the table when only a single column-type is chosen
	
	columns = {
		["taillepiles"] = "la taille des piles d&apos;objets (ou le nombre d&apos;objets pas empilables) pouvant être trouvées dans ce coffre. Une pile est un &quot;stack&quot; en anglais.",
		["poids"] = "le poids relatif de cet objet par rapport aux autres objets du groupe.",
	    ["probabilité"] = "la probabilité d&apos;obtenir l&apos;un de ces objets dans le coffre.",
		["objets"] = "le nombre d&apos;objets espérés par coffre (moyenne pour un grand nombre de coffres).",
		["coffres"] = "le nombre moyen de coffres à ouvrir pour espérer trouver l&apos;un de ces objets."
	},
	
	current_frame = nil
}

p.base = function( ... )

	p.current_frame = mw.getCurrentFrame()

	local args = { ... }
	if args[1] == p.current_frame then 
		args = require( 'Module:ProcessArgs' ).merge( true )
	else
		args = args[1]
	end
	
	-- transform args into usable list
	
	local chests, columns = q.massage_args( args )
	
	assert(#chests > 0, "pas d'arguments valides")

	q.fill_in_chest_derivative_data( chests )
	
	-- construct an ordered list dictating the order of the rows
	
	local ordered_item_rows_java = {}
	local ordered_item_rows_java_upcoming = {}
	local ordered_item_rows_bedrock = {}
	local ordered_item_rows_bedrock_upcoming = {}

	local ret = {}
	
	local java_specified             = args.java                and args.java ~= '0';
	local java_upcoming_specified    = args['java-upcoming']    and args['java-upcoming'] ~= '0';
	local bedrock_specified          = args.bedrock             and args.bedrock ~= '0';
	local bedrock_upcoming_specified = args['bedrock-upcoming'] and args['bedrock-upcoming'] ~= '0';
	
	local any_specified = java_specified or java_upcoming_specified or bedrock_specified or bedrock_upcoming_specified
	
	if any_specified then
	
		if java_specified then
			ordered_item_rows_java = q.construct_ordered_item_rows( chests, 'Java' )
		end	
		if java_upcoming_specified then
			ordered_item_rows_java_upcoming = q.construct_ordered_item_rows( chests, 'JavaUpcoming' )
		end	
		if bedrock_specified then
			ordered_item_rows_bedrock = q.construct_ordered_item_rows( chests, 'Bedrock' )
		end	
		if bedrock_upcoming_specified then
			ordered_item_rows_bedrock_upcoming = q.construct_ordered_item_rows( chests, 'BedrockUpcoming' )
		end
	
	else
	
		local java_excluded             = args.java                and args.java == '0';
		local java_upcoming_excluded    = args['java-upcoming']    and args['java-upcoming'] == '0';
		local bedrock_excluded          = args.bedrock             and args.bedrock == '0';
		local bedrock_upcoming_excluded = args['bedrock-upcoming'] and args['bedrock-upcoming'] == '0';
		
		if not java_excluded then
			ordered_item_rows_java = q.construct_ordered_item_rows( chests, 'Java' )
		end	
		if not java_upcoming_excluded then
			ordered_item_rows_java_upcoming = q.construct_ordered_item_rows( chests, 'JavaUpcoming' )
		end	
		if not bedrock_excluded then
			ordered_item_rows_bedrock = q.construct_ordered_item_rows( chests, 'Bedrock' )
		end	
		if not bedrock_upcoming_excluded then
			ordered_item_rows_bedrock_upcoming = q.construct_ordered_item_rows( chests, 'BedrockUpcoming' )
		end
	
	end
	
	if q.tablelength( ordered_item_rows_java ) > 0 then
		table.insert( ret, 'Dans la ' .. p.current_frame:preprocess( p.java ) .. ', ' .. q.lcfirst( q.print_table( chests, columns, ordered_item_rows_java, 'Java' ) ) )
	end
	if q.tablelength( ordered_item_rows_java_upcoming ) > 0 and q.compare_tables( ordered_item_rows_java, ordered_item_rows_java_upcoming ) then
		table.insert( ret, 'Dans la ' .. p.current_frame:preprocess( p['java-upcoming'] ) .. ', ' .. q.lcfirst( q.print_table( chests, columns, ordered_item_rows_java_upcoming, 'JavaUpcoming' ) ) )
	end
	if q.tablelength( ordered_item_rows_bedrock ) > 0 and q.compare_tables( ordered_item_rows_java, ordered_item_rows_bedrock ) then
		table.insert( ret, 'Dans la ' .. p.current_frame:preprocess( p.bedrock ) .. ', ' .. q.lcfirst( q.print_table( chests, columns, ordered_item_rows_bedrock, 'Bedrock' ) ) )
	end
	if q.tablelength( ordered_item_rows_bedrock_upcoming ) > 0 and q.compare_tables( ordered_item_rows_bedrock, ordered_item_rows_bedrock_upcoming ) then
		table.insert( ret, 'Dans la ' .. p.current_frame:preprocess( p['bedrock-upcoming'] ) .. ', ' .. q.lcfirst( q.print_table( chests, columns, ordered_item_rows_bedrock_upcoming, 'BedrockUpcoming' ) ) )
	end

	table.insert( ret, "<div class=mobileonly>" )
	table.insert( ret, p.current_frame:expandTemplate{ title = 'FNlist', args = {} } )
	table.insert( ret, "</div>" )

	return table.concat( ret, '\n\n' )
end

p.doc = function()

	local valid_args = {}
	for chest_name, val in pairs(p.chests) do
		local synonyms = {}
		for syn, orig in pairs(p.synonyms) do
			if orig == chest_name then
				table.insert( synonyms, syn )
			end
		end
		if #synonyms > 0 then
			chest_name = chest_name .. " ( " .. table.concat( synonyms, ", " ) .. " )"
		end
		table.insert( valid_args, chest_name )
	end
	table.sort( valid_args )
	return table.concat( valid_args, ",\n<br>" )

end

p.doc2 = function()

	local valid_args = {}
	for column_name, val in pairs(p.columns) do
		table.insert( valid_args, column_name .. ": " .. val )
	end
	table.sort( valid_args )
	return table.concat( valid_args, ",\n<br>" )

end

p.doc3 = function()

	local valid_args = {}
	for item_name, val in pairs(p.items) do
		table.insert( valid_args, item_name )
	end
	table.sort( valid_args )
	return table.concat( valid_args, ", " )

end

p.base2 = function( ... )

	p.current_frame = mw.getCurrentFrame()

	local args = { ... }
	if args[1] == p.current_frame then
		args = require( 'Module:ProcessArgs' ).merge( true )
	else
		args = args[1]
	end

	local itemname = args[1]

	if p.items[itemname] == nil then
        return '<span style="color:red;">Objet "' .. itemname .. '" inconnu</span>'
	end

	if args.java and args.java ~= '0' then
		javaChances = q.single_item_find_values( itemname, 'poolsJava' )
		javaUpcomingChances = {}
		bedrockChances = {}
		bedrockUpcomingChances = {}
	else
		if args['java-upcoming'] and args['java-upcoming'] ~= '0' then
			javaChances = q.single_item_find_values( itemname, 'poolsJavaUpcoming' )
			javaUpcomingChances = {}
			bedrockChances = {}
			bedrockUpcomingChances = {}
		else
			if args.bedrock and args.bedrock ~= '0' then
				javaChances = q.single_item_find_values( itemname, 'poolsBedrock' )
				javaUpcomingChances = {}
				bedrockChances = {}
				bedrockUpcomingChances = {}
			else
				if args['bedrock-upcoming'] and args['bedrock-upcoming'] ~= '0' then
					javaChances = q.single_item_find_values( itemname, 'poolsBedrockUpcoming' )
					javaUpcomingChances = {}
					bedrockChances = {}
					bedrockUpcomingChances = {}
				else
					javaChances = q.single_item_find_values( itemname, 'poolsJava' )
					javaUpcomingChances = q.single_item_find_values( itemname, 'poolsJavaUpcoming', javaChances )
					bedrockChances = q.single_item_find_values( itemname, 'poolsBedrock' )
					bedrockUpcomingChances = q.single_item_find_values( itemname, 'poolsBedrockUpcoming', javaChances, bedrockChances )
				end
			end
		end
	end
	
	local html = {}

	local any_current = q.tablelength( javaChances ) > 0
	local any_changes_upcoming = q.tablelength( javaUpcomingChances ) > 0 and q.compare_tables( javaChances, javaUpcomingChances )
	local any_standard = any_current or any_changes_upcoming

	local any_bedrock_current = q.tablelength( bedrockChances ) > 0
	local any_bedrock_upcoming = q.tablelength( bedrockUpcomingChances ) > 0 and q.compare_tables( bedrockChances, bedrockUpcomingChances )
	local any_bedrock = any_bedrock_current or any_bedrock_upcoming

	local change_case = p.items[itemname].preserve_case == nil or p.items[itemname].preserve_case ~= true

	if any_current then
		table.insert( html, p.base2_sub( itemname, javaChances ) )
	end
	if any_changes_upcoming then
		table.insert( html, p.current_frame:preprocess( p['java-upcoming']  ) .. ( change_case and q.lcfirst( p.base2_sub( itemname, javaUpcomingChances, any_current ) ) or p.base2_sub( itemname, javaUpcomingChances, any_current ) ) )
	end
	if any_bedrock_current then
		table.insert( html, ( any_standard and '\n\n' or '' ) .. p.current_frame:preprocess( p.bedrock ) .. ( change_case and q.lcfirst( p.base2_sub( itemname, bedrockChances, any_standard ) ) or p.base2_sub( itemname, bedrockChances, any_standard ) ) )
	end
	if any_bedrock_upcoming then
		table.insert( html, ( any_standard and not any_bedrock_current and '\n\n' or '' ) .. p.current_frame:preprocess( p['bedrock-upcoming'] ) .. ( change_case and q.lcfirst( p.base2_sub( itemname, bedrockUpcomingChances, any_bedrock_current or any_standard ) ) or p.base2_sub( itemname, bedrockUpcomingChances, any_bedrock_current or any_standard ) ) )
	end

	if args.nocat then
	else
		table.insert( html, '[[Catégorie:Pages avec des modèles de coffre à récompenses]]' )
		if p.items[itemname].category ~= nil and p.items[itemname].category ~= false then
			table.insert( html, '[[Catégorie:Pages contenant des objets spécifiques de coffre à récompenses]]' )
		end
		if any_bedrock and (mw.title.getCurrentTitle().namespace == 0) then
			table.insert( html, '[[Catégorie:Information spécifique à la version Bedrock]]' )
		end
	end

	return table.concat( html, ' ' )
end

p.base2_sub = function( itemname, chances, use_they )

	local html = {}
	local item_display_name = ''

	if use_they then
		item_display_name = 'ils'
	else
		if p.items[itemname].plural ~= nil and p.items[itemname].plural ~= false then
			item_display_name = p.items[itemname].plural
		else
			if p.items[itemname].title ~= nil then
				item_display_name = p.items[itemname].title
			else
				item_display_name = string.gsub( itemname, '-', ' ' )
			end
			if p.items[itemname].plural == nil or p.items[itemname].plural ~= false then
				item_display_name = q.single_item_plural( item_display_name )
			end
		end

		if p.items[itemname].preserve_case == nil or p.items[itemname].preserve_case ~= true then
			item_display_name = q.capitalize( item_display_name )
		end

		if p.items[itemname].note and p.notes[p.items[itemname].note] then
			item_display_name = item_display_name .. p.current_frame:extensionTag( 'ref', p.notes[p.items[itemname].note], { group='FN', name=p.items[itemname].note } )
		end

		if p.items[itemname].note1 and p.notes[p.items[itemname].note1] then
			if p.items[itemname].note == nil or p.notes[p.items[itemname].note] == nil or p.items[itemname].note ~= p.items[itemname].note1 then
				item_display_name = item_display_name .. p.current_frame:extensionTag( 'ref', p.notes[p.items[itemname].note1], { group='FN', name=p.items[itemname].note1 } )
			end
		end
	end

	table.insert( html, item_display_name )
	table.insert( html, ' peut être trouvé(e) ' )

	local html_stacks = {}
	local stack_sep = ', '
	local ns = q.tablelength( chances )
	local s = 0

	for stacksize, chest_details in pairs( chances ) do
		s = s + 1

		local html_per_stack = { 'dans ' }
		local c = 0
		local nc = q.tablelength( chest_details )
		local sep = ( nc > 2 and ', ' or ' ' )
		if nc > 2 and s ~= ns then
			stack_sep = '; '
		end
		for k, chest in pairs( chest_details ) do
			c = c + 1
			if c == nc and nc > 1 then
				table.insert( html_per_stack, 'et ' )
			end
			if chest.chance == 1 then
				table.insert( html_per_stack, " tout " )
			else
				table.insert( html_per_stack, string.format("%.1f", chest.chance*100) )
				table.insert( html_per_stack, "% de " )
			end
			if chest.chest_type == 'wagonnet de stockage' then
				table.insert( html_per_stack, ' [[wagonnet de stockage|wagonnets de stockage]] dans ' )
				table.insert( html_per_stack, p.chests[chest.chest_name].link )
			elseif chest.chest_type == 'distributeur' then
				table.insert( html_per_stack, ' [[distributeur]]s dans ' )
				table.insert( html_per_stack, p.chests[chest.chest_name].link )
			else
				table.insert( html_per_stack, p.chests[chest.chest_name].link )
				table.insert( html_per_stack, ' coffres' )
			end
			table.insert( html_per_stack, sep )
		end
		if nc > 2 then
			table.insert( html_per_stack, 'tout ' )
		end
		table.insert( html_per_stack, 'dans ' )
		if p.items[itemname].cannot_stack ~= nil then
			table.insert( html_per_stack, 'groupes de ' )
		else
			table.insert( html_per_stack, 'piles de ' )
		end
		table.insert( html_per_stack, stacksize )

		table.insert( html_stacks, table.concat( html_per_stack ) )
	end

	local stackwise_summaries = ''
	if #html_stacks == 1 then
		table.insert( html, html_stacks[1] )
	else
		for i = 1, #html_stacks - 1 do
			table.insert( html, html_stacks[ i ] )
			table.insert( html, stack_sep )
		end
		table.insert( html, 'et ' )
		table.insert( html, html_stacks[#html_stacks] )
	end

	table.insert( html, '.' )

	return table.concat( html )

end

p.base2_test = function()

	items = {}
	for item_name, v in pairs( p.items ) do
		table.insert( items, p.base2{ item_name, ["nocat"]=true } .. '\n\n' )
	end

	table.sort( items )

	return table.concat(items)
end








p.base3 = function( ... )

	p.current_frame = mw.getCurrentFrame()

	local args = { ... }
	if args[1] == p.current_frame then
		args = require( 'Module:ProcessArgs' ).merge( true )
	else
		args = args[1]
	end

	local z = args[1]

	local html_java = {}
	local html_java_u = {}
	local html_bedrock = {}
	local html_bedrock_u = {}

	local rErr = ""

	local zT = {}
	if args[1] == "!!!TOUS!!!" then
		for item_name, v in pairs( p.items ) do
			table.insert( zT, item_name )
			table.sort( zT )
		end
	else
		zT = mw.text.split( args[1], ',' )
	end

	for x, itemname in pairs( zT ) do

		if p.items[itemname] == nil then
			rErr = rErr .. "<span class='error'>Objet " .. itemname .. " inconnu.</span>\n"
		else

			local javaChances, javaUpcomingChances, bedrockChances, bedrockUpcomingChances

			if args.java and args.java ~= '0' then
				javaChances = q.single_item_find_values( itemname, 'poolsJava' )
				javaUpcomingChances = {}
				bedrockChances = {}
				bedrockUpcomingChances = {}
			else
				if args['java-upcoming'] and args['java-upcoming'] ~= '0' then
					javaChances = q.single_item_find_values( itemname, 'poolsJavaUpcoming' )
					javaUpcomingChances = {}
					bedrockChances = {}
					bedrockUpcomingChances = {}
				else
					if args.bedrock and args.bedrock ~= '0' then
						javaChances = q.single_item_find_values( itemname, 'poolsBedrock' )
						javaUpcomingChances = {}
						bedrockChances = {}
						bedrockUpcomingChances = {}
					else
						if args['bedrock-upcoming'] and args['bedrock-upcoming'] ~= '0' then
							javaChances = q.single_item_find_values( itemname, 'poolsBedrockUpcoming' )
							javaUpcomingChances = {}
							bedrockChances = {}
							bedrockUpcomingChances = {}
						else
							javaChances = q.single_item_find_values( itemname, 'poolsJava' )
							javaUpcomingChances = q.single_item_find_values( itemname, 'poolsJavaUpcoming', javaChances )
							bedrockChances = q.single_item_find_values( itemname, 'poolsBedrock' )
							bedrockUpcomingChances = q.single_item_find_values( itemname, 'poolsBedrockUpcoming', javaChances, bedrockChances )
						end
					end
				end
			end

			local any_current = q.tablelength( javaChances ) > 0
			local any_changes_upcoming = q.tablelength( javaUpcomingChances ) > 0 and q.compare_tables( javaChances, javaUpcomingChances )
			local any_standard = any_current or any_changes_upcoming

			local any_bedrock_current = q.tablelength( bedrockChances ) > 0
			local any_bedrock_upcoming = q.tablelength( bedrockUpcomingChances ) > 0 and q.compare_tables( bedrockChances, bedrockUpcomingChances )
			local any_bedrock = any_bedrock_current or any_bedrock_upcoming

			if any_current then
				table.insert( html_java, p.base3_sub( itemname, javaChances ) )
			end
			if any_changes_upcoming then
				table.insert( html_java_u, p.base3_sub( itemname, javaUpcomingChances ) )
			end
			if any_bedrock_current then
				table.insert( html_bedrock, p.base3_sub( itemname, bedrockChances ) )
			end
			if any_bedrock_upcoming then
				table.insert( html_bedrock_u, p.base3_sub( itemname, bedrockUpcomingChances ) )
			end

		end
	end

	local output = rErr .. '{| class="wikitable sortable" \n! Objet \n! Structure \n! Conteneur \n! Quantité \n! Chance \n'
	if q.tablelength( html_java ) > 0 then
		output = output .. '|-\n!colspan=5|' .. p['java'] .. ' \n' .. table.concat( html_java )
	end
	if q.tablelength( html_java_u ) > 0 then
		output = output .. '|-\n!colspan=5|' .. p['java-upcoming'] .. ' \n' .. table.concat( html_java_u )
	end
	if q.tablelength( html_bedrock ) > 0 then
		output = output .. '|-\n!colspan=5|' .. p.bedrock .. ' \n' .. table.concat( html_bedrock )
	end
	if q.tablelength( html_bedrock_u ) > 0 then
		output = output .. '|-\n!colspan=5|' .. p['bedrock-upcoming'] .. ' \n' .. table.concat( html_bedrock_u )
	end
	output = output .. '|}' .. p.current_frame:extensionTag( 'references', "", { group="FN" } )

	return output
end

p.base3_sub = function( itemname, chances )
	local html = {}
	local item_display_name = ''
	local output = ""
	lang = mw.getContentLanguage()

	if p.items[itemname].title ~= nil then
		item_display_name = p.items[itemname].title
	else
		item_display_name = q.capitalize( string.gsub( itemname, '-', ' ' ) )
	end

	local listeObjet = {}
	local ns = q.tablelength( chances )
	local s = 0
	local m = 0

	local rn = 0

	for stacksize, chest_details in pairs( chances ) do
		s = s + 1

		local nc = q.tablelength( chest_details )
		local c = 0
		for k, chest in pairs( chest_details ) do
			c = c + 1
			rn = rn + 1
            local containerText = p.chests[chest.chest_name].conteneur
            if string.len(containerText) == 0 then
                containerText = 'Coffre'
            end
			local r = ""

			r = r .. '|' .. string.gsub( containerText, ' ', '&nbsp;' ) .. '\n|' .. stacksize .. '\n|' .. lang:formatNum( math.floor( chest.chance*1000 + 0.5 ) /10 ) .. '%' .. '\n'
			if ns ~= s or nc ~= c then
				r = r
			end

			table.insert( listeObjet , { p.chests[chest.chest_name].structID , p.chests[chest.chest_name].structure, r } )

		end
		m = m + nc
	end
	table.sort( listeObjet, function(a,b) return a[1] < b[1] end )
	local struct = ""
	local t = ""
	local nt = 1
	local ntt = 0
	for v, w  in pairs( listeObjet ) do
		ntt = ntt + 1
		if w[1] ~= struct then
			if t ~= "" then
				output = output .. "|rowspan=" .. nt .. t
			end
			t = "|'''" .. p.current_frame:expandTemplate{ title = 'LienEnv', args = { w[2],  id = w[1] } } .. "'''\n" .. w[3]
			struct = w[1]
			nt = 1
		else
			t = t .. w[3]
			nt = nt + 1
		end
		if ntt == m then
			output = output .. "|rowspan=" .. nt .. t
		else
			t = t .. '|-' .. '\n'
		end
	end

	return "|-\n| rowspan=" .. m .. "|'''" .. p.getItem(itemname, item_display_name) .. "'''\n" .. output

end

p.getItem = function( itemname, item_display_name )
	local s = ""
	local k = item_display_name
	local link = item_display_name
	local m = itemname

	if p.items[itemname].title ~= nil then
		k = p.items[itemname].title
	end
	if p.items[itemname].link ~= nil then
		link = p.items[itemname].link
	end
	if p.items[itemname].id ~= nil then
		m = p.items[itemname].id
	end

	if p.items[itemname][1] == "objet" then
		s = p.current_frame:expandTemplate{ title = 'LienObjet', args = { link , k , id = m } }
	elseif p.items[itemname][1] == "bloc" then
		s = p.current_frame:expandTemplate{ title = 'LienBloc', args = { link , k , id = m } }
	end

	if p.items[itemname].note and p.notes[p.items[itemname].note] then
		s = s .. p.current_frame:extensionTag( 'ref', p.notes[p.items[itemname].note], { group='FN', name=p.items[itemname].note } )
	end

	if p.items[itemname].note1 and p.notes[p.items[itemname].note1] then
		if p.items[itemname].note == nil or p.notes[p.items[itemname].note] == nil or p.items[itemname].note ~= p.items[itemname].note1 then
			s = s .. p.current_frame:extensionTag( 'ref', p.notes[p.items[itemname].note1], { group='FN', name=p.items[itemname].note1 } )
		end
	end

	return s

end








q = {

	tablelength = function(T)
		local count = 0
		for _ in pairs(T) do count = count + 1 end
		return count
	end,

	deepcopy = function(orig)
	    local orig_type = type(orig)
	    local copy
	    if orig_type == 'table' then
	        copy = {}
	        for orig_key, orig_value in next, orig, nil do
	            copy[q.deepcopy(orig_key)] = q.deepcopy(orig_value)
	        end
	        setmetatable(copy, q.deepcopy(getmetatable(orig)))
	    else -- number, string, boolean, etc
	        copy = orig
	    end
	    return copy
	end,

	single_item_find_values = function( itemname, poolsKey, exclusions_param, other_exclusions_param )

		local chances = {}

		local exclusions = q.deepcopy(exclusions_param or {})
		local other_exclusions = q.deepcopy(other_exclusions_param or {})

		for stacksize, other_exclusion_list in pairs(other_exclusions) do
			if exclusions[stacksize] == nil then
				exclusions[stacksize] = {}
			end
			for _, other_exclusion in pairs(other_exclusion_list) do
				local already_in_here = false
				for _, exclusion in pairs(exclusions[stacksize]) do
					if exclusion["chest_name"] == other_exclusion["chest_name"] and exclusion["chance"] == other_exclusion["chance"] then
						already_in_here = true
						break
					end
				end
				if not already_in_here then
					table.insert( exclusions[stacksize], other_exclusion )
				end
			end
		end

		for chest_name, chest in pairs( p.chests ) do
			local poolchances = {}
			for k, pool in pairs( chest[poolsKey] or chest.poolsJava or {} ) do
				local poolitem = pool.items[itemname]
				if poolitem ~= nil then

					local stacksize = poolitem[1]
					if poolitem[1] ~= poolitem[2] then
						stacksize = stacksize .. "–" .. poolitem[2]
					end

					local itemweight = poolitem[3]

					local pool_total_item_weight = 0
					for itemname, item in pairs(pool.items) do
						pool_total_item_weight = pool_total_item_weight + item[3]
					end

					local chance = p.calc_chance_any_of_this_item_per_pool(
						pool.rolls[1], pool.rolls[2],
						itemweight, pool_total_item_weight )

					if poolchances[stacksize] == nil then
						poolchances[stacksize] = chance
					else
						poolchances[stacksize] = poolchances[stacksize] + (1 - poolchances[stacksize]) * chance
					end
				end
			end
			for stacksize, chance in pairs( poolchances ) do
				local excluded = false
				for _, exclusion in pairs( exclusions[stacksize] or {} ) do
					if exclusion["chest_name"] == chest_name and exclusion["chance"] == chance then
						excluded = true
						break
					end
				end
				if not excluded then
					if chances[stacksize] == nil then
						chances[stacksize] = {}
					end
					table.insert( chances[stacksize], { ["chance"]=chance, ["chest_name"]=chest_name, ["chest_type"]=( chest.chest_type or "chest" ) } )
				end
			end
		end

		return chances

	end,

	single_item_plural = function( itemname )

		if string.sub( itemname, -2 ) == 'ss'
			or string.sub( itemname, -2 ) == 'ch'
			or string.sub( itemname, -2 ) == 'sh'
			or string.sub( itemname, -1 ) == 's' then
				return itemname .. 'es'
		end

		return itemname .. 's'

	end,

	massage_args = function( args )

		-- find what columns to put

		local columns = {}

		for k, _arg in pairs(args) do
			if p.columns[_arg] ~= nil then
				columns[_arg] = true
			end
		end

		if q.tablelength(columns) == 0 then
			for column_name, v in pairs(p.columns) do
				columns[column_name] = true
			end
		end

		-- find what chests to show

		local chests = {}

		for k, _arg in pairs(args) do
			if p.chests[_arg] ~= nil then
				table.insert( chests, _arg )
			elseif p.synonyms[_arg] ~= nil then
				table.insert( chests, p.synonyms[_arg] )
			end
			if p.display_names[_arg] ~= nil then
				local chestname = _arg
				if p.chests[chestname] == nil then
					chestname = p.synonyms[_arg]
				end
				p.chests[chestname].display_name = p.display_names[_arg]
			end
		end

		table.sort( chests )

		return chests, columns

	end,

	sort_items = function( e1, e2 )

		if e1.chanceany ~= e2.chanceany then return ( e1.chanceany > e2.chanceany ) end
		if e1.avgamount ~= e2.avgamount then return ( e1.avgamount > e2.avgamount ) end

		if e1.material == nil then

			e1.material = 0
			if string.find( e1.itemname, "cuir" ) ~= nil then e1.material = 1 end
			if string.find( e1.itemname, "fer" ) ~= nil then e1.material = 2 end
			if string.find( e1.itemname, "or" ) ~= nil then e1.material = 3 end
			if string.find( e1.itemname, "diamant" ) ~= nil then e1.material = 4 end
			if string.find( e1.itemname, "netherite" ) ~= nil then e1.material = 5 end
			e1.armor = 0
			if string.find( e1.itemname, "casque" ) ~= nil or string.find( e1.itemname, "chapeau" ) ~= nil then e1.armor = 1 end
			if string.find( e1.itemname, "plastron" ) ~= nil or string.find( e1.itemname, "tunique" ) ~= nil then e1.armor = 2 end
			if string.find( e1.itemname, "jambières" ) ~= nil or string.find( e1.itemname, "pantalon" ) ~= nil then e1.armor = 3 end
			if string.find( e1.itemname, "bottes" ) ~= nil then e1.armor = 4 end

		end

		if e2.material == nil then

			e2.material = 0
			if string.find( e2.itemname, "cuir" ) ~= nil then e2.material = 1 end
			if string.find( e2.itemname, "fer" ) ~= nil then e2.material = 2 end
			if string.find( e2.itemname, "or" ) ~= nil then e2.material = 3 end
			if string.find( e2.itemname, "diamant" ) ~= nil then e2.material = 4 end
			e2.armor = 0
			if string.find( e2.itemname, "casque" ) ~= nil or string.find( e2.itemname, "chapeau" ) ~= nil then e2.armor = 1 end
			if string.find( e2.itemname, "plastron" ) ~= nil or string.find( e2.itemname, "tunique" ) ~= nil then e2.armor = 2 end
			if string.find( e2.itemname, "jambières" ) ~= nil or string.find( e2.itemname, "pantalon" ) ~= nil then e2.armor = 3 end
			if string.find( e2.itemname, "bottes" ) ~= nil then e2.armor = 4 end

		end

		if e1.material ~= e2.material then return ( e1.material < e2.material ) end
		if e1.armor ~= e2.armor then return ( e1.armor < e2.armor ) end

		return ( e1.itemname < e2.itemname )

	end,

	fill_in_chest_derivative_data = function( chest_names )

		for k, chest_name in pairs(chest_names) do
			local chest = p.chests[chest_name]
			if chest == nil then break end

			chest.allRollsJava = {}
			chest.itemDataJava = {}
			for k, pool in pairs( chest.poolsJava or {} ) do
				table.insert( chest.allRollsJava, ( pool.rolls[1] == pool.rolls[2] and pool.rolls[1] or pool.rolls[1]..'–'..pool.rolls[2] ) )

				local total_weight = 0
				for itemname, item in pairs(pool.items) do
					total_weight = total_weight + item[3]
				end
				pool.totalweight = total_weight

				q.fill_in_chest_item_details( chest.itemDataJava, pool, #chest.allRollsJava )
			end

			chest.allRollsJavaUpcoming = {}
			chest.itemDataJavaUpcoming = {}
			for k, pool in pairs( chest.poolsJavaUpcoming or chest.poolsJava or {} ) do
				table.insert( chest.allRollsJavaUpcoming, ( pool.rolls[1] == pool.rolls[2] and pool.rolls[1] or pool.rolls[1]..'–'..pool.rolls[2] ) )

				local total_weight = 0
				for itemname, item in pairs(pool.items) do
					total_weight = total_weight + item[3]
				end
				pool.totalweight = total_weight

				q.fill_in_chest_item_details( chest.itemDataJavaUpcoming, pool, #chest.allRollsJavaUpcoming )
			end

			chest.allRollsBedrock = {}
			chest.itemDataBedrock = {}
			for k, pool in pairs( chest.poolsBedrock or chest.poolsJava or {} ) do
				table.insert( chest.allRollsBedrock, ( pool.rolls[1] == pool.rolls[2] and pool.rolls[1] or pool.rolls[1]..'–'..pool.rolls[2] ) )

				local total_weight = 0
				for itemname, item in pairs(pool.items) do
					total_weight = total_weight + item[3]
				end
				pool.totalweight = total_weight

				q.fill_in_chest_item_details( chest.itemDataBedrock, pool, #chest.allRollsBedrock )
			end

			chest.allRollsBedrockUpcoming = {}
			chest.itemDataBedrockUpcoming = {}
			for k, pool in pairs( chest.poolsBedrockUpcoming or chest.poolsJava or {} ) do
				table.insert( chest.allRollsBedrockUpcoming, ( pool.rolls[1] == pool.rolls[2] and pool.rolls[1] or pool.rolls[1]..'–'..pool.rolls[2] ) )

				local total_weight = 0
				for itemname, item in pairs(pool.items) do
					total_weight = total_weight + item[3]
				end
				pool.totalweight = total_weight

				q.fill_in_chest_item_details( chest.itemDataBedrockUpcoming, pool, #chest.allRollsBedrockUpcoming )
			end
		end
	end,

	fill_in_chest_item_details = function( data, pool, ct )
		for item_name, item in pairs(pool.items) do
			if p.items[item_name] then
				local min_stacksize = item[1]
				local max_stacksize = item[2]
				local min_pool_rolls = pool.rolls[1]
				local max_pool_rolls = pool.rolls[2]
				local item_weight = item[3]

				if data[item_name] == nil then
					data[item_name] = {
						avgamount = 0,
						chanceany = 0,
						itemname = item_name,
						sortsize = {},
						sortweight = {},
						sizes = {},
						weights = {},
					}
					for i = 1, ct-1 do
						data[item_name].sortsize[i] = 0
						data[item_name].sortweight[i] = 0
						data[item_name].sizes[i] = '—'
						data[item_name].weights[i] = '—'
					end
				end

				data[item_name].avgamount = data[item_name].avgamount + p.calc_average_amount_this_item_per_pool(
					min_stacksize, max_stacksize,
					min_pool_rolls, max_pool_rolls,
					item_weight, pool.totalweight )

				data[item_name].chanceany = data[item_name].chanceany + (1 - data[item_name].chanceany) * p.calc_chance_any_of_this_item_per_pool(
					min_pool_rolls, max_pool_rolls,
					item_weight, pool.totalweight )

				data[item_name].sortsize[ct] = ( min_stacksize + max_stacksize ) / 2
				data[item_name].sortweight[ct] = item_weight;
				data[item_name].sizes[ct] = ( min_stacksize == max_stacksize and min_stacksize or min_stacksize .. '–' .. max_stacksize )
				data[item_name].weights[ct] = p.current_frame:expandTemplate{ title = 'fraction', args = { item_weight, pool.totalweight } }
			end
		end

		for item_name, d in pairs(data) do
			if not d.sizes[ct] then
				d.sortsize[ct] = 0
				d.sortweight[ct] = 0
				d.sizes[ct] = '—'
				d.weights[ct] = '—'
			end
		end
	end,

	construct_ordered_items_from_first_chest = function( chest_names, suffix )
		local items_from_first_table = {}
		local item_chests = {}
		local item_names_ordered = {}
		for item_name, item in pairs( p.chests[chest_names[1]]['itemData'..suffix] ) do
			table.insert( items_from_first_table, item )
		end

		table.sort( items_from_first_table, q.sort_items )

		for k, item in pairs( items_from_first_table ) do
			table.insert( item_names_ordered, item.itemname )
			item_chests[item.itemname] = true
		end

		return item_names_ordered, item_chests
	end,

	get_ordered_items_from_other_chests = function( chest_names, item_chests, suffix )
		local items_not_from_first_table = {}

		for chest_idx = 2, #chest_names do
			for item_name, item in pairs( p.chests[chest_names[chest_idx]]['itemData'..suffix] ) do
				if item_chests[item_name] == nil then
					p.items[item_name].itemname = item_name
					table.insert( items_not_from_first_table, p.chests[chest_names[chest_idx]]['itemData'..suffix][item_name] )
					item_chests[item_name] = true
				end
			end
		end

		table.sort( items_not_from_first_table, q.sort_items )

		return items_not_from_first_table
	end,

	add_other_items_to_first_list = function( chest_names, item_names_ordered, item_chests, items_not_from_first_table )
		for k, item in pairs( items_not_from_first_table ) do
			table.insert( item_names_ordered, item.itemname )
		end

		return item_names_ordered
	end,

	set_up_ordered_item_rows = function( chest_names, item_names_ordered, suffix )
		for k, itemname in pairs(item_names_ordered) do
			item_names_ordered[k] = {itemname}
			for chest_idx = 1, #chest_names do
				if suffix == 'JavaUpcoming' or p.chests[chest_names[chest_idx]]['pools'..suffix] ~= nil then
					local item_data = p.chests[chest_names[chest_idx]]['itemData'..suffix][itemname]
					if item_data == nil then
						table.insert( item_names_ordered[k], false )
					else
						table.insert( item_names_ordered[k], item_data )
					end
				end
			end
		end

		return item_names_ordered
	end,

	construct_ordered_item_rows = function( chest_names, suffix )
		-- for the first chest, sort its by chance desc, then by avg amount desc, then alphabetically asc
		local item_names_ordered, item_chests = q.construct_ordered_items_from_first_chest( chest_names, suffix )

		if #chest_names > 1 then
			-- after that, sort all the remaining items in list order
			local items_not_from_first_table = q.get_ordered_items_from_other_chests( chest_names, item_chests, suffix )
			item_names_ordered = q.add_other_items_to_first_list( chest_names, item_names_ordered, item_chests, items_not_from_first_table )
		end

		-- set up item_names_ordered so that each is a row, representing chest values
		item_names_ordered = q.set_up_ordered_item_rows( chest_names, item_names_ordered, suffix )

		return item_names_ordered
	end,

	print_table = function( chest_names, columns, ordered_item_rows, suffix )
		local html = {}

		local use_roll_row = false
		local use_superheader = false
		local superheader_sizes = {}
		for i = 1, #chest_names do
			sh = p.chests[chest_names[i]].superheader
			if sh ~= nil then
				if superheader_sizes[sh] == nil then
					superheader_sizes[sh] = 0
				end
				superheader_sizes[sh] = superheader_sizes[sh] + 1

				if #chest_names > 1 then
					use_superheader = true
				end
			end
			local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
			if #allRolls > 1 then
				use_roll_row = true
			end
		end
		if columns['taillepiles'] == nil and columns['poids'] == nil then
			use_roll_row = false
		end

		local rowspan = ( #chest_names > 1 and 1 or 0 ) + ( use_superheader and 1 or 0 ) + 1
		local hide_col_description = rowspan > 1 and q.tablelength(columns) == 1
		if use_roll_row then
			rowspan = rowspan + 1
		end

		if q.tablelength(columns) == 1 then
			for column_name, v in pairs(columns) do
				table.insert( html, "Les valeurs représentent " )
				table.insert( html, p.columns[column_name]:lower() )
				table.insert( html, "\n" )
			end
		end

		if #chest_names == 1 then

			if q.tablelength(columns) == 1 then
				table.insert( html, "<br>" )
			end

			local chest_name = chest_names[1]
			local allRolls = p.chests[chest_name]['allRolls'..suffix]
			local chest_type = p.chests[chest_name].chest_type or "coffre"

			local display_name = p.chests[chest_name].display_name

			chest_name = chest_name:gsub( "-", " " )

		    if chest_type ~= 'coffre' and chest_type ~= 'wagonnet de stockage' then
				table.insert( html, "Chaque " )
			else
				table.insert( html, "Chaque coffre " )
			if string.find(mw.ustring.lower(chest_name), 'bonus') == nil then -- "coffre bonus", pas "coffre de bonus"
				if string.find(mw.ustring.lower(chest_name), '^[aeiouyéÉ]') ~= nil then -- "coffre d'entrepôt", pas "coffre de entrepôt"
					table.insert( html, "d'" )
				else
					table.insert( html, "de " )
				end
			end
			end

			table.insert( html, display_name or chest_name )
			table.insert( html, " contient " )
			if #allRolls == 1 then
				table.insert( html, allRolls[1] )
			else
				table.insert( html, #allRolls )
				table.insert( html, ' groupes de ' )
				local s = ( #allRolls > 2 and ', ' or ' ' )
				for i = 1, #allRolls-1 do
					table.insert( html, allRolls[i] )
					table.insert( html, s )
				end
				table.insert( html, 'et ' )
				table.insert( html, allRolls[#allRolls] )
			end
			table.insert( html, " piles d'objets, avec la répartition suivante : \n" )
		end

		table.insert( html, '<div style="overflow:auto">\n' )
		table.insert( html, '<table class="wikitable sortable jquery-tablesorter">\n' )
		table.insert( html, "<tr>\n" )
		table.insert( html, "<th rowspan=" )
		table.insert( html, ( rowspan - ( hide_col_description and 1 or 0 ) ) )
		table.insert( html, "> Objet </th>\n" )

		local superheader_cols_used = {}

		if #chest_names > 1 then
			local row1, row2 = {}, {}

			for i = 1, #chest_names do

				if suffix == 'JavaUpcoming' or p.chests[chest_names[i]]['pools'..suffix] ~= nil then
					local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
					local colspan = q.tablelength(columns)
					local allRollsSpan = #allRolls == 0 and 1 or #allRolls
					if columns['taillepiles'] ~= nil then
						colspan = colspan - 1 + allRollsSpan
					end
					if columns['poids'] ~= nil then
						colspan = colspan - 1 + allRollsSpan
					end
					local row = row1

					rowspan = 1
					if use_superheader then
						sh = p.chests[chest_names[i]].superheader
						if sh ~= nil then
							if superheader_cols_used[sh] == nil then
								table.insert( row, "<th colspan=" )
								table.insert( row, ( colspan * superheader_sizes[sh] ) )
								table.insert( row, ">" )
								table.insert( row, sh )
								table.insert( row, "</th>\n" )
								superheader_cols_used[sh] = 0
							end
							row = row2
						else
							rowspan = rowspan + 1
						end
					end
					if use_roll_row and hide_col_description and #allRolls < 2 then
						rowspan = rowspan + 1
					end

					table.insert( row, "<th colspan=" )
					table.insert( row, colspan )
					if rowspan > 1 then
						table.insert( row, " rowspan=" )
						table.insert( row, rowspan )
					end
					table.insert( row, ">" )
					table.insert( row, p.chests[ chest_names[i] ].header )
					if #allRolls > 0 then
						table.insert( row, ' <br><span style="font-weight:normal; font-style:italic; font-size:11px;">(' )
						if #allRolls == 1 then
							table.insert( row, allRolls[1] )
						else
							local s = ( #allRolls > 2 and ', ' or ' ' )
							for i = 1, #allRolls-1 do
								table.insert( row, allRolls[i] )
								table.insert( row, s )
							end
							table.insert( row, 'et ' )
							table.insert( row, allRolls[#allRolls] )
						end
						table.insert( row, ' piles)</span>' )
					end
					table.insert( row, "</th>\n" )
				end
			end

			table.insert( html, table.concat( row1 ) )
			table.insert( html, "</tr><tr>\n" )
			if #row2 then
				table.insert( html, table.concat( row2 ) )
				table.insert( html, "</tr><tr>\n" )
			end
		end

		if not hide_col_description then
			local headersort_th_open
			if use_roll_row then
				headersort_th_open = "<th rowspan='2' class='headersort' role='columnheader button' data-sort-type='number'> <abbr title='"
			else
				headersort_th_open = "<th class='headersort' role='columnheader button' data-sort-type='number'> <abbr title='"
			end
			for i = 1, #chest_names do
				if suffix == 'JavaUpcoming' or p.chests[chest_names[i]]['pools'..suffix] ~= nil then
					local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
					local allRollsSpan = #allRolls == 0 and 1 or #allRolls
					local headersort_th_colspan_open
					if #allRolls > 1 then
						headersort_th_colspan_open = "<th colspan='" .. allRollsSpan .. "' role='columnheader'> <abbr title='"
					else
						headersort_th_colspan_open = headersort_th_open
					end

					if columns['taillepiles'] ~= nil then
						table.insert( html, headersort_th_colspan_open )
						table.insert( html, p.columns['taillepiles'] )
						table.insert( html, "'> Taille des piles </abbr> <span class=mobileonly>")
						table.insert( html, p.current_frame:extensionTag{
							name = 'ref', content = p.columns['taillepiles'], args = { name = 'taillepiles', group = 'FN' }
						} )
						table.insert( html, "</span></th>\n" )
					end
					if columns['poids'] ~= nil then
						table.insert( html, headersort_th_colspan_open )
						table.insert( html, p.columns['poids'] )
						table.insert( html, "'> Poids </abbr> <span class=mobileonly> ")
						table.insert( html, p.current_frame:extensionTag{
							name = 'ref', content = p.columns['poids'], args = { name = 'poids', group = 'FN' }
						} )
						table.insert( html, "</span></th>\n" )
					end
					if columns['probabilité'] ~= nil then
						table.insert( html, headersort_th_open )
						table.insert( html, p.columns['probabilité'] )
						table.insert( html, "'> Probabilité </abbr> <span class=mobileonly> ")
						table.insert( html, p.current_frame:extensionTag{
							name = 'ref', content = p.columns['probabilité'], args = { name = 'probabilité', group = 'FN' }
						} )
						table.insert( html, "</span></th>\n" )
					end
					if columns['objets'] ~= nil then
						table.insert( html, headersort_th_open )
						table.insert( html, p.columns['objets'] )
						table.insert( html, "'> Nb. d'objets </abbr> <span class=mobileonly> ")
						table.insert( html, p.current_frame:extensionTag{
							name = 'ref', content = p.columns['objets'], args = { name = 'objets', group = 'FN' }
						} )
						table.insert( html, "</span></th>\n" )
					end
					if columns['coffres'] ~= nil then
						table.insert( html, headersort_th_open )
						table.insert( html, p.columns['coffres'] )
						table.insert( html, "'> Nb. de coffres à ouvrir </abbr> <span class=mobileonly> ")
						table.insert( html, p.current_frame:extensionTag{
							name = 'ref', content = p.columns['coffres'], args = { name = 'coffres', group = 'FN' }
						} )
						table.insert( html, "</span></th>\n" )
					end
				end
			end
			table.insert( html, "</tr><tr>\n" )
		end

		if use_roll_row then
			local rowcols = ( columns['taillepiles'] ~= nil and 1 or 0 ) + ( columns['poids'] ~= nil and 1 or 0 )
			for i = 1, #chest_names do
				local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
				if #allRolls > 1 then
					for j = 1, rowcols do
						for k = 1, #allRolls do
							table.insert( html, "<th class='headersort' role='columnheader button' data-sort-type='number' style='font-weight:normal'><abbr title='Le coffre choisit " )
							table.insert( html, allRolls[k] )
							table.insert( html, " pile(s) aléatoirement parmi celles-ci.'>" )
							table.insert( html, allRolls[k] )
							table.insert( html, "×</abbr></th>\n" )
						end
					end
				end
			end
			table.insert( html, "</tr><tr>\n" )
		end

		for i = 1, #ordered_item_rows do
			if type( ordered_item_rows[i] ) == "table" then
				for j = 1, #ordered_item_rows[i] do

					local chest_item = ordered_item_rows[i][j]

					if type( chest_item ) == "table" then

						local avg_amount = string.format("%.3f", chest_item.avgamount)
						local chance_any = string.format("%.1f", chest_item.chanceany*100) .. "%"
						local num_chests = string.format("%.1f", 1/chest_item.chanceany)

						table.insert( html, "\n" )
						if columns['taillepiles'] ~= nil then
							for k = 1, #chest_item.sizes do
								table.insert( html, "<td style='text-align:center;' data-sort-value='" )
								table.insert( html, ( chest_item.sortsize[k] == 0 and "9e99" or chest_item.sortsize[k] ) )
								table.insert( html, "'>" )
								table.insert( html, chest_item.sizes[k] )
								table.insert( html, "</td>" )
							end
						end
						if columns['poids'] ~= nil then
							for k = 1, #chest_item.sizes do
								table.insert( html, "<td style='text-align:center;' data-sort-value='" )
								table.insert( html, ( chest_item.sortweight[k] == 0 and "9e99" or chest_item.sortweight[k] ) )
								table.insert( html, "'>" )
								table.insert( html, chest_item.weights[k] )
								table.insert( html, "</td>" )
							end
						end
						if columns['probabilité'] ~= nil then
							table.insert( html, "<td style='text-align:center;'>" )
							table.insert( html, chance_any )
							table.insert( html, "</td>" )
						end
						if columns['objets'] ~= nil then
							table.insert( html, "<td style='text-align:center;'>" )
							table.insert( html, avg_amount )
							table.insert( html, "</td>" )
						end
						if columns['coffres'] ~= nil then
							table.insert( html, "<td style='text-align:center;'>" )
							table.insert( html, num_chests )
							table.insert( html, "</td>" )
						end

					elseif type( chest_item ) == "boolean" then
						local allRolls = p.chests[chest_names[j-1]]['allRolls'..suffix]
						local allRollsSpan = #allRolls == 0 and 1 or #allRolls

						table.insert( html, "\n" )
						if columns['taillepiles'] ~= nil then
							for k = 1, allRollsSpan do
								table.insert( html, "<td data-sort-value='9e99' style='text-align:center;'>—</td>" )
							end
						end
						if columns['poids'] ~= nil then
							for k = 1, allRollsSpan do
								table.insert( html, "<td data-sort-value='9e99' style='text-align:center;'>—</td>" )
							end
						end
						if columns['probabilité'] ~= nil then
							table.insert( html, "<td data-sort-value='9e99' style='text-align:center;'>—</td>" )
						end
						if columns['objets'] ~= nil then
							table.insert( html, "<td data-sort-value='9e99' style='text-align:center;'>—</td>" )
						end
						if columns['coffres'] ~= nil then
							table.insert( html, "<td data-sort-value='9e99' style='text-align:center;'>—</td>" )
						end
					else
						if i > 1 then
							table.insert( html, "</tr><tr>" )
						end

						local item = p.items[chest_item]

						local s = require( 'Module:Sprite' )
						table.insert( html, "\n<td>" )
						local image, spriteCat = s.link {
							id = item.id or chest_item,
							link = item.link or item.title or string.gsub(chest_item,'-',' '),
							text = q.capitalize(item.title or string.gsub(chest_item,'-',' ')),
							wrap = 'true',
							data = ( item[1] == 'objet' and 'ObjetSprite' or 'BlocSprite' )
						}
						table.insert( html, image )
						table.insert( html, spriteCat )

						if item.note and p.notes[item.note] then
							table.insert( html, p.current_frame:extensionTag( 'ref', p.notes[item.note], { group='FN', name=item.note } ) )
						end

						if item.note1 and p.notes[item.note1] then
							if item.note == nil or p.notes[item.note] == nil or item.note ~= item.note1 then
								table.insert( html, p.current_frame:extensionTag( 'ref', p.notes[item.note1], { group='FN', name=item.note1 } ) )
							end
						end

						table.insert( html, "</td>" )
					end

					if j == #ordered_item_rows[i] then
						table.insert( html, "</tr>" )
					end

				end
				table.insert( html, "\n" )
			end
		end

		table.insert( html, "</table></div>")

		return table.concat( html )

	end,

	titlecase = function( str )
		local buf = {}
		for word in string.gfind(str, "%S+") do
			if word == "et" then
				table.insert( buf, word )
			else
				local first, rest = string.sub( word, 1, 1 ), string.sub( word, 2 )
				table.insert( buf, string.upper(first) .. string.lower(rest) )
			end
		end
		return table.concat( buf, " " )
	end,

	capitalize = function( str )
		return ( string.lower(str):gsub( "^%l", string.upper ):gsub( "^é", "É" ) )
	end,

	lcfirst = function( str )
		return ( string.gsub( str, "^%u", string.lower ) )
	end,

	compare_tables = function( a, b )
		local seen = {}
		for k, v in pairs( a ) do
			if type( v ) ~= type( b[k] ) then
				return true
			end
			if v ~= b[k] then
				return true
			end
			if type( v ) == 'table' and q.compare_tables( v, b[k] ) then
				return true
			end
			seen[k] = true
		end
		for k, v in pairs( b ) do
			if not seen[k] then
				return true
			end
		end
		return false
	end,
}

string.lpad = function(str, len, char)
	if char == nil then char = ' ' end
	return string.rep(char, len - #(''..str)) .. str
end

return p