Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] - universal spell points formula #117

Open
alkalow opened this issue Nov 29, 2024 · 3 comments
Open

[Question] - universal spell points formula #117

alkalow opened this issue Nov 29, 2024 · 3 comments

Comments

@alkalow
Copy link

alkalow commented Nov 29, 2024

Hi, I apologize in advance if the question has been asked before, but I still couldn't figure it out. I have a monk's tokenbar module in which I want to put a line to track characters' spell points. And I want to make an item (mana potion) that would also automatically restore spell points when used. All I understood is that I need a formula through items somehow, but I don't have enough knowledge in the field of formulas to compose the right one.
I have dnd version 4.1.2, could you please tell me a specific formula for my tasks? Thanks in advance for your answer.

@misthero
Copy link
Owner

misthero commented Dec 3, 2024

sorry for the delay don't know monk tokenbar so well, but spellpoints is a regular item with "uses" like any other.

this macro will show in the browser console (F12) the spellpoints data of the selected token (select a token and run the macro)

const spellPointsItemID = actor.flags.dnd5espellpoints.item;

console.log('spellPointsItemID', spellPointsItemID);

let spellPointItem = actor.items.filter(i => i.id == spellPointsItemID)[0];

console.log('spellPointItem', spellPointItem);
console.log('Item max uses:', spellPointItem.system.uses.max);
console.log('Item current uses:', spellPointItem.system.uses.value);
console.log('Item uses spent:', spellPointItem.system.uses.spent);

@alkalow
Copy link
Author

alkalow commented Dec 3, 2024

I think that in monks tokenbar the formula will be the same as for the item, that is, for the mana potion. In the potion, I tried to set up the item consumption in the consumption tab, and entered these formulas there that you suggested to me, but each time the foundry gave the line "item not found". Please tell me what I'm doing wrong? :(

@misthero
Copy link
Owner

misthero commented Dec 3, 2024

I don't know, can you show the formula? also when you say the mana potion is it from this module or a random item?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants