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

Help with % macros, "if then" & target numbers!

Hello! I'm building random treasure generators for BFRPG and I need help building a macro - The short of it is, every creature is attached to a random treasure generator, but only certain treasures have a chance of being found. For example: The ghoul has a 75% chance of dropping 5d10 pieces of copper, 50% chance of dropping 5d6 silver and 50% chance of dropping 5d4 electrum.  My macros for saves and treasure are based on the following: #&{template:default} {{name= The creature resists!!}} {{Death Ray or Poison= [[1d20>11]]}}{{Magic Wands= [[1d20>12]]}} {{Paralysis or Petrify= [[1d20>14]]}} {{Dragon Breath= [[1d20>15]]}} {{Spells= [[1d20>16]]}} Is there a way I can make this happen? Thanks! 
Here's a quick way this should work: [[ [[1d100<75]] * 5d10]] pieces of copper [[ [[1d100<50]] * 5d6]] pieces of silver [[ [[1d100<50]] * 5d4]] pieces of electrum
Quatar said: Here's a quick way this should work: [[ [[1d100<75]] * 5d10]] pieces of copper [[ [[1d100<50]] * 5d6]] pieces of silver [[ [[1d100<50]] * 5d4]] pieces of electrum Thanks so much! Took some finesse but works like a charm! This is what I ended up with if you're interested: p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545} #&{template:default} {{name= The creature is defeated!}} {{Pieces of Copper= [[ [[1d100<75]] * 5d10]] }} {{Pieces of Silver= [[ [[1d100<50]] * 5d6]]}} {{Pieces of Electrum= [[ [[1d100<50]] * 5d4]]}} {{Pieces of Gold= [[ [[1d100<50]] * 3d6]]}} {{Magic Weapon/Armor= [[ [[1d100<10]] ]]}}
Glad I could help
1506469473
Andrew C
Marketplace Creator
Kenny S. said: Quatar said: Here's a quick way this should work: [[ [[1d100<75]] * 5d10]] pieces of copper [[ [[1d100<50]] * 5d6]] pieces of silver [[ [[1d100<50]] * 5d4]] pieces of electrum Thanks so much! Took some finesse but works like a charm! This is what I ended up with if you're interested: p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545} #&{template:default} {{name= The creature is defeated!}} {{Pieces of Copper= [[ [[1d100<75]] * 5d10]] }} {{Pieces of Silver= [[ [[1d100<50]] * 5d6]]}} {{Pieces of Electrum= [[ [[1d100<50]] * 5d4]]}} {{Pieces of Gold= [[ [[1d100<50]] * 3d6]]}} {{Magic Weapon/Armor= [[ [[1d100<10]] ]]}} If you have a rollable table for the Weapons/Armour, then you could use [[ [[1d100<10]]t[LootTable] ]]
Andrew, I haven't gotten as far as rollable tables yet, but I'm intrigued! 
1506573010

Edited 1506573641
Andrew C
Marketplace Creator
Well, you could list all the things you want in your rollable table. There is ONE catch... you need whole numbers for the Weight. So say your Loot Table has... d% 1-10: Sword 11-15: Sword +1 16-25: Longbow 26-30: Longbow +1 etc... 96-100: Greatsword +3 Then you start making a rollable table. You call one thing in the table "Sword" and because there are 10 chances in 100, you give it Weight 10. You call the next "Sword +1" and because there are 5 chances in 100, you give it Weight 5. You call the next "Longbow" and because there are 10 chances in 100, you give it Weight 10. etc, etc, etc... Then if you want to roll once on the table, you use [[1t[LootTable] ]] If you wanted them to have a 50-50 chance, then you need to replace the 1 with a 50-50 chance. So something like... [[ [[1d2-1]]t[LootTable] ]] But you have a 10% chance of loot drops, so [[1d100<10]] gives you a 10% chance of giving the result "1" and otherwise 0.  So [[ [[1d100<10]]t[LootTable] ]] is a 10% chance of drawing one thing from the loot table. If you wanted to do more than that... you could make it say [[ ([[1d100<10]]*2)t[LootTable] ]] if you wanted a 10% chance for 2 draws from the table. If there are basically two tables, and there's a chance of things from either table, then you just make your LootTable contain BOTH tables... unless you need each one to check.
Andrew (Halfling Gypsy) said: Well, you could list all the things you want in your rollable table. There is ONE catch... you need whole numbers for the Weight. So say your Loot Table has... d% 1-10: Sword 11-15: Sword +1 16-25: Longbow 26-30: Longbow +1 etc... 96-100: Greatsword +3 Then you start making a rollable table. You call one thing in the table "Sword" and because there are 10 chances in 100, you give it Weight 10. You call the next "Sword +1" and because there are 5 chances in 100, you give it Weight 5. You call the next "Longbow" and because there are 10 chances in 100, you give it Weight 10. etc, etc, etc... Then if you want to roll once on the table, you use [[1t[LootTable] ]] If you wanted them to have a 50-50 chance, then you need to replace the 1 with a 50-50 chance. So something like... [[ [[1d2-1]]t[LootTable] ]] But you have a 10% chance of loot drops, so [[1d100<10]] gives you a 10% chance of giving the result "1" and otherwise 0.  So [[ [[1d100<10]]t[LootTable] ]] is a 10% chance of drawing one thing from the loot table. If you wanted to do more than that... you could make it say [[ ([[1d100<10]]*2)t[LootTable] ]] if you wanted a 10% chance for 2 draws from the table. If there are basically two tables, and there's a chance of things from either table, then you just make your LootTable contain BOTH tables... unless you need each one to check. So I'm definitely interested in a table like this, especially for random treasure. Is there anywhere I could go to see how this would all be set up? It seems more in-depth than the wiki is letting on...