Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Script] 5eTreasure

1525445501

Edited 1525680794
Robin
API Scripter
Just a simple script to generate a treasure (individual and hoard) in chat with the DnD 5e Dungeon Master Guide random treasure rules. Commands !treasure config - Shows the config menu. !treasure [?type] [cr] [?amount] - This will generate the treasure. See some examples below. !treasure s [?type] &nbsp;- Will create a treasure from the tokens selected.&nbsp;See some examples below. Examples !treasure 5 - Will generate a `individual` for 1 CR 5 creature. !treasure individual 5 - Same as above. !treasure 3 5 - Will generate an `individual` treasure for 5 CR 3 creatures. !treasure hoard 3 - Will generate a CR 3 `hoard` treasure. !treasure s - Will generate an individual treasure from a combination of the challenge ratings of the selected tokens. !treasure s individual - Same as above. !treasure s hoard - Will creature a treasure hoard from the average of the selected token(s) challenge ratings. Config Command - The command you want to use for this script. CR Attribute - The CR attribute in the sheet you are using, defaulted to `5e OGL`. Treasure Target - Send treasure to everyone or only GM. Magic Items Target - Send magic items to everyone or only GM. Script: <a href="https://github.com/RobinKuiper/Roll20APIScripts/tree/development/5eTreasure" rel="nofollow">https://github.com/RobinKuiper/Roll20APIScripts/tree/development/5eTreasure</a>
1525449174
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Looks cool. Does it just return to the chat log, or is the treasure sent somewhere? What is the advantage of this over a rollable table?
1525450148

Edited 1525450161
Robin
API Scripter
keithcurtis said: Looks cool. Does it just return to the chat log, or is the treasure sent somewhere? What is the advantage of this over a rollable table? It only shows it in chat at the moment. I'm going to update it later with a way to select a creature, and generate a treasure from it.&nbsp; I just don't like the way how rollable tables work, and I have much more control of this, that's why I made it.
1525452460
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I also have some issues with Rollable tables. If this script could be adaptable to writing to sheets or tokens, or pulling instructions off sheets or tokens, I think you've got a real gem here.
1525456725
Kirsty
Pro
Sheet Author
I've got a similar script that generates treasure, but I've been hesitant to share it because I'm worried about sharing Wizards' copyrighted material. Does this fall under fair use laws?
1525457074
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Highly unlikely, unless the material is pulled entirely from the SRD (including tables, algorithms and items). I have a lot of really cool macros I can't share for that reason.
1525463313
Loren the GM
Pro
Marketplace Creator
Hi, another great script! A couple of thoughts and bugs I've spotted. 1. Whenever I roll a first tier hoard (CR 0-4) it always rolls the Copper Pieces as 600. 2. It would be really helpful to see the roll numbers for reference and troubleshooting. For instance, I rolled a CR 1 Hoard and got back the following which seems . . . overpowered (I think these are all Table G items, and it should only roll once on that table): Currency cp : 600 sp : 400 gp : 40 Gems 2x Jasper (opaque blue, black, or brown) Magic Items Armor of vulnerability Bracers of defense Ring of the ram Belt of hill giant strength Gem of seeing 3. I'd love to see the gold values listed for the art and gem objects, so I don't have to look them up to find which table they are off of. If there was a way to announce the table they came off of in the chat results or amend the name with the value, that would be super helpful. 4. I'd also love a minor syntax change in the commands, because I would really like to make one macro that handles the whole thing. If the syntax could change to allow something like !treasure ?{Hoard or Individual|Hoard|Individual} ?{CR of Hoard or Creature} ?{Number of Creatures or 0 for Hoard} that would be ideal. Because of syntax, I need two macros right now (one that calls !treasure ?{CR} ?{Number of Creatures} and one that calls !treasure hoard ?{CR} Thanks again, I'm really enjoying integrating your macros into my games!
1525470800
Robin
API Scripter
Loren the GM said: Hi, another great script! A couple of thoughts and bugs I've spotted. 1. Whenever I roll a first tier hoard (CR 0-4) it always rolls the Copper Pieces as 600. I see it indeed, not sure where it goes wrong yet, will get this fixed. 2. It would be really helpful to see the roll numbers for reference and troubleshooting. For instance, I rolled a CR 1 Hoard and got back the following which seems . . . overpowered (I think these are all Table G items, and it should only roll once on that table): Currency cp : 600 sp : 400 gp : 40 Gems 2x Jasper (opaque blue, black, or brown) Magic Items Armor of vulnerability Bracers of defense Ring of the ram Belt of hill giant strength Gem of seeing There was something wrong with some tables indeed, should be fixed in next update. 3. I'd love to see the gold values listed for the art and gem objects, so I don't have to look them up to find which table they are off of. If there was a way to announce the table they came off of in the chat results or amend the name with the value, that would be super helpful. This is a good idea indeed, will add the values. 4. I'd also love a minor syntax change in the commands, because I would really like to make one macro that handles the whole thing. If the syntax could change to allow something like !treasure ?{Hoard or Individual|Hoard|Individual} ?{CR of Hoard or Creature} ?{Number of Creatures or 0 for Hoard} that would be ideal. Because of syntax, I need two macros right now (one that calls !treasure ?{CR} ?{Number of Creatures} and one that calls !treasure hoard ?{CR} You can do `!treasure individual CR` already. Your macro should work. Thanks again, I'm really enjoying integrating your macros into my games! I've answered them under your questions/problems.
1525473136
Robin
API Scripter
Update <a href="https://github.com/RobinKuiper/Roll20APIScripts/tr" rel="nofollow">https://github.com/RobinKuiper/Roll20APIScripts/tr</a>... * Fixed a bug were currency value where the same everytime. * Added values to gems and arts. * Fixed a bug where magic item tables weren't calculated correctly.
Thank you for this great script!&nbsp; I love it
1525478194

Edited 1525478371
Bast L.
API Scripter
Kirsty said: I've got a similar script that generates treasure, but I've been hesitant to share it because I'm worried about sharing Wizards' copyrighted material. Does this fall under fair use laws? I couldn't say, but a friend asked that my loot script be added to the dropdown, but was told the tables are an issue because of copyright. Maybe once the DMG is in roll20, there'll be some access allowed.&nbsp; Anyways, another nice script Robin. A lot cleaner than mine (though I have some house rule crap added, like special materials, or individual loot other than coins).&nbsp; edit: Oh, one idea for the script, which I used in my Rules Compendium loot script: I have it send all obvious treasure to the chat, and all magic items to the GM, but it has a button to also show those to chat (if they identify them, or whatnot). Cursed items are something to consider if you go that route though, like have their similar item shown, with another hidden message to the gm about what the item actually is.
1525478882

Edited 1525478916
Robin
API Scripter
Bast L. said: Kirsty said: I've got a similar script that generates treasure, but I've been hesitant to share it because I'm worried about sharing Wizards' copyrighted material. Does this fall under fair use laws? I couldn't say, but a friend asked that my loot script be added to the dropdown, but was told the tables are an issue because of copyright. Maybe once the DMG is in roll20, there'll be some access allowed.&nbsp; Anyways, another nice script Robin. A lot cleaner than mine (though I have some house rule crap added, like special materials, or individual loot other than coins).&nbsp; edit: Oh, one idea for the script, which I used in my Rules Compendium loot script: I have it send all obvious treasure to the chat, and all magic items to the GM, but it has a button to also show those to chat (if they identify them, or whatnot). Cursed items are something to consider if you go that route though, like have their similar item shown, with another hidden message to the gm about what the item actually is. That's a great idea indeed, I will look in to it. I was also thinking about making it more customizable, by adding your own items to the treasure table.
1525515889
Robin
API Scripter
Update 0.1.5 <a href="https://github.com/RobinKuiper/Roll20APIScripts/tr" rel="nofollow">https://github.com/RobinKuiper/Roll20APIScripts/tr</a>... * Show last hidden treasure in normal chat. * Change normal treasure and magic item treasure targets (to everyone or to gm).
1525680819
Robin
API Scripter
Update&nbsp; 0.1.6 Create treasure from selected tokens.