Fix commande /auberge

This commit is contained in:
sladecraven 2021-07-20 15:15:13 +02:00
parent 769ac9b6d2
commit 8e80c7a005
3 changed files with 11 additions and 15 deletions

View File

@ -37,8 +37,8 @@ const _manage_inn_roll = async (content, msg) => {
let command = content.split(" ").map(function(item) {
return item.trim();
})
//console.log(game.wfrp4e.tables["talents"]);
console.log("COMMANDES", command);
if (command[0] == "/auberge" && command[1] )
{
msg["type"] = 0;
@ -46,17 +46,14 @@ const _manage_inn_roll = async (content, msg) => {
var compendium = game.packs.get('WH4-fr-translation.plats-dauberges');
let rollList = [];
await compendium.getIndex().then(index => rollList = index);
//console.log("Got compendium...", rollList.length);
rollList = rollList.contents;
for (var i=0; i< rollList.length; i++) {
var rollTab = rollList[i];
console.log("Got compendium...", rollList, rollTab.name);
if ( rollTab.name.toLowerCase().includes(command[1].toLowerCase()) ) {
let my_rollTable;
await compendium.getEntity(rollTab._id).then(mytab => my_rollTable = mytab);
let myroll = my_rollTable.roll();
//console.log("RES: ", myroll );
msg.content = my_rollTable.name + " : " + myroll.results[0].text;
//my_rollTable.draw();
ChatMessage.create(msg);
await compendium.getDocument(rollTab._id).then(mytab => my_rollTable = mytab);
my_rollTable.draw( { rollMode : "gmroll"} );
return false;
}
}
@ -243,7 +240,7 @@ const __add_actors_translation = ( ) => {
//newpack = new TranslatedCompendium(pack, translations);
//console.log("Actor compendium has been replaced !!!!", pack.metadata.name);
}
console.log("Parsing pack", metadata);
//console.log("Parsing pack", metadata);
if (!game.babele.isTranslated(metadata) && metadata.name == "forien-armoury" ) {
/** TODO !!!/
metadata.mapping.mapping["qualities"] = {
@ -265,12 +262,11 @@ const __add_actors_translation = ( ) => {
/************************************************************************************/
/* Hook for specific command */
Hooks.on("chatMessage", (html, content, msg) => {
if ( content.includes("/auberge") ) {
if ( content.toLowerCase().includes('auberge') ) {
_manage_inn_roll( content, msg );
return false;
}
}
} );
/************************************************************************************/

View File

@ -2,7 +2,7 @@
"name": "WH4-fr-translation",
"title": "WFRP4e - Core Module en français.",
"description": "Traduction Française pour Warhammer v4.",
"version": "4.0.7",
"version": "4.0.8",
"minimumCoreVersion" : "0.8.0",
"compatibleCoreVersion": "0.8.8",
"author": "LeRatierBretonnien",

View File

@ -20,4 +20,4 @@
{"_id":"klCBzk4hwQoPx0KA","name":"Poudre d'Emeraude","permission":{"default":0,"BnP1htmXWwH7JbHW":3},"type":"trapping","data":{"description":{"type":"String","label":"Description","value":"<p><em>Les apothicaires ont longtemps soutenu que les pierres précieuses en poudre ont des propriétés efficaces. Si l'Emeraude en poudre est mélangée à du vin ou à un autre alcool, elle a une chance de neutraliser tout poison contaminant cette boisson.&nbsp;</em></p>\n<hr>\n<p>Après avoir mis en contact la poudre avec l'alcool suspect</p>\n<ul>\n<li>Le Mj effectue un <strong>Test de Pari(+10)</strong>&nbsp;caché.</li>\n<li>Le poison est \"supposé\" neutralisé.</li>\n<li>Obtenez +10 en <strong>Guérison</strong> pour soigner un personnage qui a pris le risque de boire la boisson infusée à la poudre d'émeraude.</li>\n<li>Le Mj peut révèler (ou non) son jet selon les circonstances</li>\n<li><strong>Dose</strong>: 1 par boisson</li>\n</ul>\n<hr>\n<div><strong>Forme</strong>: Poudre</div>\n<div><strong>Type</strong>: Décoction</div>\n<div><strong>Artisanat</strong>: Métier (Apothicaire)</div>\n<div><strong>Principe actif</strong>: Emeraude</div>\n<div><strong>Excipient</strong>: Écorce, Farine d'Os, Citron Vert, Potasse</div>"},"gmdescription":{"type":"String","label":"Description","value":""},"quantity":{"type":"Number","label":"Quantity","value":1},"encumbrance":{"type":"Number","label":"Encumbrance","value":0},"price":{"type":"String","label":"Price","gc":"15","ss":"0","bp":"0"},"availability":{"type":"String","label":"Availability","value":"rare"},"location":{"type":"Number","label":"Location","value":0},"trappingType":{"type":"String","label":"Trapping Type","value":"drugsPoisonsHerbsDraughts"},"worn":false,"spellIngredient":{"type":"String","value":""}},"flags":{},"img":"modules/WH4-fr-translation/icons/apothicarium/Poudre%20d%27Emeuraude.png"}
{"_id":"nwSu59iDUP6m8UHa","name":"Racine Sobre","permission":{"default":0,"BnP1htmXWwH7JbHW":3},"type":"trapping","data":{"description":{"type":"String","label":"Description","value":"<p><em>Selon la tradition Halfeling, la connaissance de cette plante nous fut donnée par Esmeralda elle-même, après que son premier mari Bibogenitus amena la connaissance du brassage et de la vinification au Moot. On l'appelle Racine Sobre, bien que les Elfes l'appellent Corrylliamid. On la trouve dans les forêts les plus profondes, souvent entre les racines d'un arbre lornalim, ou à côté d'un vieux chêne. Le bulbe est pelé et rôti dans un four jusqu'à ce qu'il soit aussi mou qu'une pomme bien cuite, et ensuite est mangé.</em></p>\n<p><em>La Racine Sobre</em><em>&nbsp;est une plante amère ressemblant à un oignon, ayant l'étrange propriété d'annuler les effets de l'alcool.</em></p>\n<hr>\n<p>Après ingurgitation</p>\n<ul>\n<li>Obtenez +20 en <strong>Ethylisme</strong></li>\n<li><strong>Durée</strong>: 24 heures</li>\n</ul>\n<hr>\n<div><strong>Forme</strong>: Gruau</div>\n<div><strong>Type</strong>: Préparation</div>\n<div><strong>Artisanat</strong>: Métier (Apothicaire) et Métier (Herboriste)</div>\n<div><strong>Principe actif</strong>:&nbsp;Racine Sobre</div>\n<div><strong>Excipient</strong>: Eau, Sel, Herbes</div>"},"gmdescription":{"type":"String","label":"Description","value":""},"quantity":{"type":"Number","label":"Quantity","value":1},"encumbrance":{"type":"Number","label":"Encumbrance","value":0},"price":{"type":"String","label":"Price","gc":"1","ss":"0","bp":"0"},"availability":{"type":"String","label":"Availability","value":"exotic"},"location":{"type":"Number","label":"Location","value":0},"trappingType":{"type":"String","label":"Trapping Type","value":"drugsPoisonsHerbsDraughts"},"worn":false,"spellIngredient":{"type":"String","value":""}},"flags":{},"img":"modules/WH4-fr-translation/icons/apothicarium/Racine%20Sobre.png"}
{"_id":"pUNBdpLe44MEO8v5","name":"Aconit Anti-toxine","permission":{"default":0,"BnP1htmXWwH7JbHW":3},"type":"trapping","data":{"description":{"type":"String","label":"Description","value":"<p><em>Fabriquée à partir du sang d'un petit mammifère mort d'un empoisonnement à l'Aconit Napel, cette potion est le seul remède connu contre l'empoisonnement à cette substance ... à part peut être la prière.</em></p>\n<hr>\n<p>Après absorption</p>\n<ul>\n<li>Traite les effets de l'Aconit Napel</li>\n<li><strong>Dose</strong>: 1 par personne</li>\n</ul>\n<hr>\n<div><strong>Forme</strong>: Potion</div>\n<div><strong>Type</strong>: Concoction</div>\n<div><strong>Artisanat</strong>: Métier (Apothicaire)</div>\n<div><strong>Principe actif</strong>: Sang de mammifère empoissonné à l'Aconit Napel</div>\n<div><strong>Excipient</strong>: Écorce, Feuilles, Potasse, Spiritueux</div>"},"gmdescription":{"type":"String","label":"Description","value":""},"quantity":{"type":"Number","label":"Quantity","value":1},"encumbrance":{"type":"Number","label":"Encumbrance","value":0},"price":{"type":"String","label":"Price","gc":"3","ss":"0","bp":"0"},"availability":{"type":"String","label":"Availability","value":"scarce"},"location":{"type":"Number","label":"Location","value":0},"trappingType":{"type":"String","label":"Trapping Type","value":"drugsPoisonsHerbsDraughts"},"worn":false,"spellIngredient":{"type":"String","value":""}},"flags":{},"img":"modules/WH4-fr-translation/icons/apothicarium/Aconit%20AntiTox.png"}
{"_id":"tNcsMSh8VwCG4caU","name":"Racine de Réglisse","permission":{"default":0,"BnP1htmXWwH7JbHW":3},"type":"trapping","data":{"description":{"type":"String","label":"Description","value":"<p><em>Cette plante constitue un traitement efficace contre la Peste Noire. Durant le période active de le maladie, le patient doit recevoir une dose chaque jour.</em></p>\n<hr>\n<p>Après ingurgitation</p>\n<ul>\n<li>Traite les effets des <strong>bubons </strong>de la <strong>Peste Noire</strong></li>\n<li>Obtenez +10 à tous les Tests concernant cette maladie</li>\n<li><strong>Dose</strong>: 1 par jour</li>\n</ul>\n<hr>\n<div><strong>Forme</strong>: Gruau</div>\n<div><strong>Type</strong>: Préparation</div>\n<div><strong>Artisanat</strong>: Métier (Herboriste)</div>\n<div><strong>Principe actif</strong>: Racine de Réglisse</div>\n<div><strong>Excipient</strong>: Cendre, Charbon de Bois, Farine, Eau</div>"},"gmdescription":{"type":"String","label":"Description","value":""},"quantity":{"type":"Number","label":"Quantity","value":1},"encumbrance":{"type":"Number","label":"Encumbrance","value":0},"price":{"type":"String","label":"Price","gc":"5","ss":"0","bp":"0"},"availability":{"type":"String","label":"Availability","value":"scarce"},"location":{"type":"Number","label":"Location","value":0},"trappingType":{"type":"String","label":"Trapping Type","value":"drugsPoisonsHerbsDraughts"},"worn":false,"spellIngredient":{"type":"String","value":""},"source":{"type":"String","label":"Source"}},"flags":{"_sheetTab":"description"},"img":"modules/WH4-fr-translation/icons/apothicarium/Racine%20de%20Reglisse.png"}
{"_id":"tNcsMSh8VwCG4caU","name":"Racine de Réglisse","permission":{"default":0,"BnP1htmXWwH7JbHW":3},"type":"trapping","data":{"description":{"type":"String","label":"Description","value":"<p><em>Cette plante constitue un traitement efficace contre la Peste Noire. Durant le période active de le maladie, le patient doit recevoir une dose chaque jour.</em></p>\n<hr>\n<p>Après ingurgitation</p>\n<ul>\n<li>Traite les effets des <strong>bubons </strong>de la <strong>Peste Noire</strong></li>\n<li>Obtenez +10 à tous les Tests concernant cette maladie</li>\n<li><strong>Dose</strong>: 1 par jour</li>\n</ul>\n<hr>\n<div><strong>Forme</strong>: Gruau</div>\n<div><strong>Type</strong>: Préparation</div>\n<div><strong>Artisanat</strong>: Métier (Herboriste)</div>\n<div><strong>Principe actif</strong>: Racine de Réglisse</div>\n<div><strong>Excipient</strong>: Cendre, Charbon de Bois, Farine, Eau</div>"},"gmdescription":{"type":"String","label":"Description","value":""},"quantity":{"type":"Number","label":"Quantity","value":1},"encumbrance":{"type":"Number","label":"Encumbrance","value":0},"price":{"type":"String","label":"Price","gc":"5","ss":"0","bp":"0"},"availability":{"type":"String","label":"Availability","value":"scarce"},"location":{"type":"Number","label":"Location","value":0},"trappingType":{"type":"String","label":"Trapping Type","value":"drugsPoisonsHerbsDraughts"},"worn":false,"spellIngredient":{"type":"String","value":""},"source":{"type":"String","label":"Source"}},"flags":{"_sheetTab":"description"},"img":"modules/WH4-fr-translation/icons/apothicarium/Racine%20de%20Reglisse.png"}