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 avg_rolls = ( min_pool_rolls + max_pool_rolls ) / 2
local relativeweight = item_weight / pool_total_item_weight
return 1 - math.pow( 1 - relativeweight, avg_rolls )
end,
java = '[[Version Java]]\n',
java_dev = '[[Version Java]]. À venir en [[1.17]]\n',
bedrock = '[[Version Bedrock]]\n',
bedrock_dev= '[[Version Bedrock]]. À venir en [[Version Bedrock 1.17|1.17]]\n',
-- these define which sprite, label and link to use, in the table,
-- and 'cannot_stack' and 'plural' dictate how to display the single-item summary
-- 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
-- NOTE: order in this list doesn't matter.
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 },
["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 },
["chaîne"] = { "bloc" },
["chair-putréfiée"] = { "objet" },
["champignon-carmin"] = { "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 },
["é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" },
["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" },
["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 },
["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-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" },
["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" },
["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.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]].",
},
-- NOTE: order here doesn't matter.
-- * in the table, chests will sort in alphabetical order
-- * in the table, items will sort 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 = {}.
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",
poolsDev = {},
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}
}
},
}
},
["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},
}
}
},
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",
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},
}
},
}
},
["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},
}
}
},
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},
}
},
},
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},
}
},
},
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},
}
},
},
poolsDev = {}
},
["village-armurerie"] = { -- village\village_armorer.json
header = "Armurerie",
superheader = "[[Village]]",
link = "Armurerie de [[village]]",
structure = "Village",
conteneur = "Coffre de l'armurerie",
structID = "village",
poolsDev = {},
pools = {
{
rolls = {1,5},
items = {
["lingot-fer"] = {1,3,2},
["pain"] = {1,4,4},
["casque-fer"] = {1,1,1},
["émeraude"] = {1,1,1}
}
},
}
},
["village-boucherie"] = { -- village\village_butcher.json
header = "Boucherie",
superheader = "[[Village]]",
link = "Boucherie de [[village]]",
structure = "Village",
conteneur = "Coffre de boucher",
structID = "village",
poolsDev = {},
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}
}
},
}
},
["village-cartographe"] = { -- village\village_cartographer.json
header = "Cartographe",
superheader = "[[Village]]",
link = "Cartographe de [[village]]",
structure = "Village",
conteneur = "Coffre de cartographe",
structID = "village",
poolsDev = {},
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}
}
},
}
},
["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",
poolsDev = {},
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}
}
},
}
},
["village-bergerie"] = { -- village\village_shepherd.json
header = "Bergerie",
superheader = "[[Village]]",
link = "Bergerie de [[village]]",
structure = "Village",
conteneur = "Coffre de bergerie",
structID = "village",
poolsDev = {},
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}
}
},
}
},
["village-tannerie"] = { -- village\village_tannery.json
header = "Tannerie",
superheader = "[[Village]]",
link = "Tannerie de [[village]]",
structure = "Village",
conteneur = "Coffre de tannerie",
structID = "village",
poolsDev = {},
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}
}
},
}
},
["village-temple"] = { -- village\village_temple.json
header = "Temple",
superheader = "[[Village]]",
link = "Temple de [[village]]",
structure = "Village",
conteneur = "Coffre de temple",
structID = "village",
poolsDev = {},
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}
}
},
}
},
["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",
poolsDev = {},
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}
}
},
}
},
["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",
poolsDev = {},
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}
}
},
}
},
["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",
poolsDev = {},
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}
}
},
}
},
["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",
poolsDev = {},
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}
}
},
}
},
["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",
poolsDev = {},
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}
}
},
}
},
["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",
poolsDev = {},
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}
}
},
}
},
["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",
poolsDev = {},
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}
}
},
}
},
["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",
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}
}
},
},
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}
}
},
},
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 = {
["poche-encre"] = {1,3,75}
}
},
},
poolsDev = {
{
rolls = {1,4},
items = {
}
},
}
},
["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},
}
},
},
poolsDev = {
{
rolls = {1,1},
items = {
["hache-pierre"] = {1,1,1},
["hache-bois"] = {1,1,3},
}
},
},
},
["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},
}
},
},
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},
}
},
},
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},
}
},
},
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},
}
},
},
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",
poolsDev = {},
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}
}
},
}
},
["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}
}
},
},
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},
}
},
},
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},
}
},
},
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",
poolsDev = {},
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},
}
}
},
},
["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",
poolsDev = {},
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},
}
}
},
},
["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",
poolsDev = {},
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},
}
}
},
},
["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",
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},
}
}
},
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},
}
},
},
poolsDev = {}
},
},
-- 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",
["2-pièces"] = "village-maison-2-pièces",
["autel"] = "autel-fort",
["entrepôt"] = "entrepôt-fort",
["bibliothèque"] = "bibliothèque-fort",
["écuries-hoglin"] = "bastion-écuries-hoglin",
["bastion-autre"] = "bastion"
},
-- 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-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",
["2-pièces"] = "maison 2 pièces de village",
["jungle"] = "temple de la jungle",
["temple-désert"] = "pyramide",
["temple-jungle"] = "temple de la jungle",
["distributeur-temple-jungle"] = "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"
},
-- 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'objets (ou le nombre d'objets pas empilables) pouvant être trouvées dans ce coffre. Une pile est un "stack" en anglais.",
["poids"] = "le poids relatif de cet objet par rapport aux autres objets du groupe.",
["probabilité"] = "la probabilité d'obtenir l'un de ces objets dans le coffre.",
["objets"] = "le nombre d'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'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 )
if #chests == 0 then
return "<span class='error'>Module:CoffreRécompenses : arguments invalides</span>"
end
q.fill_in_chest_derivative_data( chests )
-- construct an ordered list dictating the order of the rows
local ordered_item_rows, ordered_item_rows_dev
local ret = {}
if args.dev and args.dev ~= '0' then
local ordered_item_rows = q.construct_ordered_item_rows( chests, 'Dev' )
if q.tablelength( ordered_item_rows ) > 0 then
table.insert( ret, q.print_table( chests, columns, ordered_item_rows, 'Dev' ) )
end
else
local ordered_item_rows = q.construct_ordered_item_rows( chests, '' )
local ordered_item_rows_dev = q.construct_ordered_item_rows( chests, 'Dev' )
if q.tablelength( ordered_item_rows ) > 0 then
table.insert( ret, q.print_table( chests, columns, ordered_item_rows, '' ) )
end
if q.tablelength( ordered_item_rows_dev ) > 0 and q.compare_tables( ordered_item_rows, ordered_item_rows_dev ) then
table.insert( ret, p.current_frame:preprocess( p.java_dev ) .. q.lcfirst( q.print_table( chests, columns, ordered_item_rows_dev, 'Dev' ) ) )
end
end
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 z = args[1]
local rC = {}
local rDC = {}
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
local bandeau_java = ""
local bandeau_java_dev = ""
local bandeau_bedrock = ""
local bandeau_bedrock_dev = ""
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 chances, devChances
if args.dev and args.dev ~= '0' then
chances = q.single_item_find_values( itemname, 'poolsDev' )
devChances = {}
else
chances = q.single_item_find_values( itemname, 'pools' )
devChances = q.single_item_find_values( itemname, 'poolsDev' )
end
if q.tablelength( chances ) > 0 then
bandeau_java = '|-\n!colspan=5|'..p.java
table.insert( rC, p.base2_sub( itemname, chances ) )
end
if q.tablelength( devChances ) > 0 and q.compare_tables( chances, devChances ) then
bandeau_java_dev = '|-\n!colspan=5|'..p.java_dev
table.insert( rDC, p.base2_sub( itemname, devChances ) )
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 ) .. '|}' .. p.current_frame:extensionTag( 'references', "", { group="note" } )
end
p.base2_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 = string.gsub( itemname, '-', ' ' )
end
item_display_name = q.capitalize( item_display_name )
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 r = ""
r = r .. '|' .. p.chests[chest.chest_name].conteneur .. '\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 ~= 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 } )
end
return s
end
q = {
tablelength = function(T)
local count = 0
for _ in pairs(T) do count = count + 1 end
return count
end,
single_item_find_values = function( itemname, key )
local chances = {}
for chest_name, chest in pairs( p.chests ) do
local poolchances = {}
for k, pool in pairs( chest[key] or chest.pools 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
if chances[stacksize] == nil then
chances[stacksize] = {}
end
table.insert( chances[stacksize], { ["chance"]=chance, ["chest_name"]=chest_name, ["chest_type"]=( chest.chest_type or "coffre" ) } )
end
end
return chances
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
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 )
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
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.allRolls = {}
chest.itemData = {}
for k, pool in pairs( chest.pools or {} ) do
table.insert( chest.allRolls, q.tern( pool.rolls[1] == pool.rolls[2], pool.rolls[1], 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.itemData, pool, #chest.allRolls )
end
chest.allRollsDev = {}
chest.itemDataDev = {}
for k, pool in pairs( chest.poolsDev or chest.pools or {} ) do
table.insert( chest.allRollsDev, q.tern( pool.rolls[1] == pool.rolls[2], pool.rolls[1], 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.itemDataDev, pool, #chest.allRollsDev )
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] = q.tern( min_stacksize == max_stacksize, min_stacksize, 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 == 'Dev' 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
use_superheader = true
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 = ( 1 + q.tern( #chest_names > 1, 1, 0 ) + q.tern( use_superheader, 1, 0 ) )
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] )
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( "-", " " )
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
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 = q.tern( #allRolls > 2, ', ', ' ' )
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 - q.tern( hide_col_description, 1, 0 ) ) )
table.insert( html, "></th>\n" )
local superheader_cols_used = {}
if #chest_names > 1 then
local row1, row2 = {}, {}
for i = 1, #chest_names do
if suffix == 'Dev' 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 = q.tern( #allRolls > 2, ', ', ' ' )
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 == 'Dev' 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></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" )
table.insert( html, "</abbr></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></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></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></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'>" )
table.insert( html, allRolls[k] )
table.insert( html, "×</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] )
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] )
table.insert( html, "'>" )
table.insert( html, chest_item.weights[k] )
table.insert( html, "</td>" )
end
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['probabilité'] ~= nil then
table.insert( html, "<td style='text-align:right;'>" )
table.insert( html, chance_any )
table.insert( html, "</td>" )
end
if columns['coffres'] ~= nil then
table.insert( html, "<td style='text-align:right;'>" )
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='0' style='text-align:center;'>—</td>" )
end
end
if columns['poids'] ~= nil then
for k = 1, allRollsSpan do
table.insert( html, "<td data-sort-value='0' style='text-align:center;'>—</td>" )
end
end
if columns['objets'] ~= nil then
table.insert( html, "<td data-sort-value='0' style='text-align:center;'>—</td>" )
end
if columns['probabilité'] ~= nil then
table.insert( html, "<td data-sort-value='0' style='text-align:right;'>—</td>" )
end
if columns['coffres'] ~= nil then
table.insert( html, "<td data-sort-value='9e99' style='text-align:right;'>—</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,'-',' ')),
data= q.tern( item[1] == 'objet', 'ObjetSprite', '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='note', name=item.note } ) )
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, mw.ustring.upper(first) .. mw.ustring.lower(rest) )
end
end
return table.concat( buf, " " )
end,
capitalize = function( str )
return ( str:gsub( "^%l", mw.ustring.upper ):gsub( "^é", "É" ) )
end,
lcfirst = function( str )
return ( string.gsub( str, "^%u", string.lower ) )
end,
tern = function( cond , T , F )
if cond then return T else return F end
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