TOR 2e Macros for Foundry v12

 avatar9littlebees
Publica year ago5 Snippets
Search
Language
Sort by
📅 Created Date
Order
Tables are from Strider Mode
// MACRO NAME: LORE TABLE
// MACRO TYPE: script

// REQUIRED TABLES: Lore-Action, Lore-Aspect, Lore-Aspect

// copy and paste from below this line:

const table1 = await game.tables.getName("Lore-Action").roll();
const table2 = await game.tables.getName("Lore-Aspect").roll();
const table3 = await game.tables.getName("Lore-Focus").roll();

const result1 = table1.results[0].text;
const result2 = table2.results[0].text;
const result3 = table3.results[0].text;

const content = `<div style="text-align:center">
      <h2 style="font-size:22px;">Lore Table<\h2>
      <p style="color:#941b0c;font-size:14px;">Action: ${result1}<\p>
      <p style="color:#941b0c;font-size:14px;">Aspect: ${result2}<\p>
      <p style="color:#941b0c;font-size:14px;">Focus: ${result3}<\p>
      </div>`;
ChatMessage.create({content});
Tables are from Strider Mode
// MACRO NAME: FORTUNE TABLE
// MACRO TYPE: script

// REQUIRED TABLES: Fortune, Ill-Fortune

// copy and paste from below this line:

let message;
async function printMessage(table) {
    let roll = await table.roll()
    let result = roll.results[0];
    let chatData = {
        content: `<div style="text-align:center">
        <h2>Fortune / Ill-Fortune Table</h2>
        <p>The result of your <i>${message}</i> is:</p>
        <p style="color:#941b0c;font-size:18px;">${result.text}</p>       
        </div>`,
        whisper: [game.user],
    };
    ChatMessage.create(chatData, {});
}

let dType = new Dialog({
    title: "Favour",
    content: `<div style="text-align:center"><h3>What special icon did you roll?<\h3><h2><\h2><\div>`,
    buttons: {
        button1: {
            label: "Gandalf Rune",
            callback: () => {
                message = "Gandalf Rune";
                printMessage(
                    game.tables.contents
                        .find((t) => t.name === "Fortune")
                );
            },
        },
        button2: {
            label: "Eye of Sauron",
            callback: () => {
                message = "Eye of Sauron";
                printMessage(
                    game.tables.contents
                        .find((t) => t.name === "Ill-Fortune")
                );
            },
        },
    },
}).render(true);
Tables are from Strider Mode
// MACRO NAME: REVELATION EPISODE
// MACRO TYPE: script

// REQUIRED TABLES: Revelation-Episode

// copy and paste from below this line:

const table1 = await game.tables.getName("Revelation-Episode").roll();
const result1 = table1.results[0].text;

const content = `<div style="text-align:center">
      <h2 style="font-size:22px;">Revelation Episode<\h2>
      <p style="color:#941b0c;font-size:14px;">${result1}
      </div>`;
ChatMessage.create({content});
Tables are from Strider Mode
// MACRO NAME: JOURNEY EVENTS
// MACRO TYPE: script

// REQUIRED TABLES: Journey-Events (itself a nested table containing these tables: Event-Misfortune, Event-Despair, Event-Ill-Choices, Event-Mishap, Event-Shortcut, Event-Meeting, Event-Joyful)

// copy and paste from below this line:

const table1 = await game.tables.getName("Journey-Events").roll();
const result1 = table1.results[0].text;

const content = `<div style="text-align:center">
      ${result1}
      </div>`;
ChatMessage.create({content});
Tables are from Strider Mode
// MACRO NAME: TELLING TABLE
// MACRO TYPE: script

// REQUIRED TABLES: Telling-Certain, Telling-Likely, Telling-Middling, Telling-Doubtful, Telling-Unthinkable

// copy and paste from below this line:

let message;
async function printMessage(table) {
    let roll = await table.roll()
    let result = roll.results[0];
    let chatData = {
        content: `<div style="text-align:center">
        <h2>Telling Table</h2>
        <p>Your answer with <i>${message}</i> odds is:</p>
        <p style="color:#941b0c;font-size:20px;">${result.text}</p>       
        </div>`,
        whisper: [game.user],
    };
    ChatMessage.create(chatData, {});
}

let dType = new Dialog({
    title: "Telling",
    content: `<div style="text-align:center;font-size:24px;"><h3>What are the chances?<\h3><h2><\h2><\div>`,
    buttons: {
        button1: { 
            label: "Certain",
            callback: () => {
                message = "certain";
                printMessage(
                    game.tables.contents
                        .find((t) => t.name === "Telling-Certain")
                );
            },
        },
        button2: { 
            label: "Likely",
            callback: () => {
                message = "likely";
                printMessage(
                    game.tables.contents
                        .find((t) => t.name === "Telling-Likely")
                );
            },
        },
        button3: {
            label: "Middling",
            callback: () => {
                message = "middling";
                printMessage(
                    game.tables.contents
                        .find((t) => t.name === "Telling-Middling")
                );
            },
        },
        button4: {
            label: "Doubtful",
            callback: () => {
                message = "doubtful";
                printMessage(
                    game.tables.contents
                        .find((t) => t.name === "Telling-Doubtful")
                );
            },
        },
        button5: {
            label: "Unthinkable",
            callback: () => {
                message = "unthinkable";
                printMessage(
                    game.tables.contents
                        .find((t) => t.name === "Telling-Unthinkable")
                );
            },
        },
    },
}).render(true);
  • Total 5 snippets
  • 1