packs entfernt

This commit is contained in:
alzer
2025-05-11 15:10:21 +02:00
parent 6dbb8d3ccc
commit 01b58b5c62
5 changed files with 186 additions and 134 deletions
+38 -38
View File
@@ -88,39 +88,39 @@ const _patch_up_in_arms = () => {
/************************************************************************************/
/* Manages /auberge command */
const _manage_inn_roll = async (content, msg) => {
// Split input into arguments
let command = content.split(" ").map(function (item) {
return item.trim();
})
// const _manage_inn_roll = async (content, msg) => {
// // Split input into arguments
// let command = content.split(" ").map(function (item) {
// return item.trim();
// })
console.log("COMMANDES", command);
if (command[0] == "/gasthaus" && command[1]) {
msg["type"] = 0;
msg["rollMode"] = "gmroll";
var compendium = game.packs.get('wh4-de-translation.gerichte-gasthaeuser')
const pack = game.packs.get(compendium);
let rollList = await compendium.getDocuments()
//console.log("AUBERGE", rollList)
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.getDocument(rollTab._id).then(mytab => my_rollTable = mytab);
my_rollTable.draw({ rollMode: "gmroll" });
return false;
}
}
}
if (content.includes("/gasthaus")) {
msg["type"] = 0;
msg["rollMode"] = "gmroll";
msg["content"] = "Syntax : /gasthaus KEYWORD, mit KEYWORD unter:<br> BasisGetraenke, StarkeGetraenke, Desserts, AllgemeineGerichte, ExzellenteGerichte, MaritimeGerichte, MittelmaessigeGerichte, Qualitaetsgerichte, Flussgerichte. Verknüpfungen sind mit einem Teil des Namens möglich: Basis (entspricht BasisGetraenke) oder /gasthaus Mari (entspricht MaritimeGerichte) usw."
ChatMessage.create(msg);
return false;
}
}
// console.log("COMMANDES", command);
// if (command[0] == "/gasthaus" && command[1]) {
// msg["type"] = 0;
// msg["rollMode"] = "gmroll";
// var compendium = game.packs.get('wh4-de-translation.gerichte-gasthaeuser')
// const pack = game.packs.get(compendium);
// let rollList = await compendium.getDocuments()
// //console.log("AUBERGE", rollList)
// 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.getDocument(rollTab._id).then(mytab => my_rollTable = mytab);
// my_rollTable.draw({ rollMode: "gmroll" });
// return false;
// }
// }
// }
// if (content.includes("/gasthaus")) {
// msg["type"] = 0;
// msg["rollMode"] = "gmroll";
// msg["content"] = "Syntax : /gasthaus KEYWORD, mit KEYWORD unter:<br> BasisGetraenke, StarkeGetraenke, Desserts, AllgemeineGerichte, ExzellenteGerichte, MaritimeGerichte, MittelmaessigeGerichte, Qualitaetsgerichte, Flussgerichte. Verknüpfungen sind mit einem Teil des Namens möglich: Basis (entspricht BasisGetraenke) oder /gasthaus Mari (entspricht MaritimeGerichte) usw."
// ChatMessage.create(msg);
// return false;
// }
// }
/************************************************************************************/
let __eis_tables = {
@@ -379,13 +379,13 @@ const __add_actors_translation = () => {
/************************************************************************************/
/* Hook for specific command */
Hooks.on("chatMessage", (html, content, msg) => {
// Hooks.on("chatMessage", (html, content, msg) => {
if (content.toLowerCase().includes('gasthaus')) {
_manage_inn_roll(content, msg);
return false;
}
});
// if (content.toLowerCase().includes('gasthaus')) {
// _manage_inn_roll(content, msg);
// return false;
// }
// });
/************************************************************************************/
/* Additionnal hooks ready */