;First of all, mine is going to be based on the spell Wizard's Harvest spell from Elona or Eternal League of Nefia In it, each casting of the spell can roll several times in once instance, and each time it is rolled is considered an item. The number of rolls is determined as follows: {4 +{1d{SpellPower/50}+1}} The spell power only affects how much actual money is produced per item rolled, and in my game 100 is roughly equal to a Unites States Dollar, the formula is {400 + {1d{SpellPower}. ;ROLLS BY PERCENTAGE CHANCE ;Rule: For every item, a set of rolls is made to determine what is generated. ;100% - Gold ;1.1% - Platinum Coin ;2% - Ancient Book ;.5% - Small Medal ;.067% - Treasure Map ;I have no idea how to roll from the prompt in this case considering I need to roll based on the spell level to determine spell power. ;WHAT I HAVE SO FAR ; Wizard's Harvest.ipt ; created 5/11/2020 12:25:43 AM MaxReps:1//fixed my syntax of maxreps in this version... had an = sign in last version. Did this to cut down on output display. Prompt: Spell level {1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30} 1 ;The following series of variable sets is to keep a running count of the total qty of items generators, so it can be output as a total at the end. Set: Gold=0 Set: addgold=0 Set: Plat=0 Set: addplat=0 Set: book=0 Set: addbook=0 Set: map=0 Set: addmap=0 Table: Main {@Rolls=(50+(10*{$prompt1}))} Rolls\n&//The & sign at the end of each line means that all the code is consider one line of code... use the & to seperate parts of the table call that seem like seperate operations - just for easy viewing and editing. ;Really don't know why I can just somehow use value of ROLLS in the line below... keeps throwing errors. Anyway, copy & paste is quick and easy, even if it looks a bit messy below (only works becuase the value of rolls is static once the user inputs a level). [@{50+(10*{$prompt1})} item]\n&//just a slight syntax change: @ gives you multiple rolls on a table, prompt is $ as in {$prompt1} and used regular () around 10* operator; I dropped the implode and in instead used a \n in Table:item Total Gold = [@CNum with {$Gold}] gp\n& Total Platinum = [@CNum with {$Plat}] pp\n& Total Ancient Books = [@CNum with {$book}] books\n& Total Treasure Maps = [@CNum with {$map}] maps ;Remember: the roll condition for BOOKS in Table:item below is still set to 20,000 or 20% chance, just to debug and verify the generator. you can set it 2,000 once you're satisfied that everything is working. Table:item Define:dice={1d100000} // used d100000 so I could evaluate 0.067%... that's a 67 or less on a d100,000. for define, everytime it sees {dice} it rolls a new 1d10000. Otherwise you could use SET: and it would just roll once and apply that value to everything - with set a roll of 65 would give you one of each item. [@gcoin][when]{dice}<1100[do][@pcoin][end][when]{dice}<20000[do][@book][end][when]{dice}<67[do][@treasureMap][end].\n// added /n to insert a line return after each roll.... used book < 200 or 20% instead of 2% so that I could see if book was coming up about 1 out of 5 rolls. Change it back to <20 once youre satisfied its working. ;[@money], not sure what money is or does, so I left it out of Table:items Table: money {1d100} money Table: gcoin {addgold={1d100}} {Gold=={{$Gold}+{$addgold}}} gold//each of these tables sets the value of the new quantity (and displays the new value), then adds the new value to the running total to get the up-to-date running total. Table: pcoin , {addplat={1d100}} {Plat=={{$Plat}+{$addplat}}} platinum//leading commas and such, along with the period at the end of Table:item, makes the output pretty. Table: book , {addbook=1} {book=={{$book}+{$addbook}}} book Table: treasureMap , {addmap=1} {map=={{$map}+{$addmap}}} map ; below are two tables that I use in many generators to set commas in large numbers for output. The Cnum table is the call above ;in Table: main to send numerical value into a text string with commas. This is for final output only, and computations cannot be executed ;on the resulting text string. The syntax to call the routine is [@CNum with {$numerical_value}]. I really haven't tried to see if it works ;for values over 999,999 (I doubt that it does), and I'm pretty sure that decimals will cause trouble. Table: CNum Set: number={$1} Set: count=0 Set: MyValue=[[{number} >> reverse >> eachchar AddComma] >> reverse] [when][{MyValue} >> Left]=,[do][{MyValue} >> SubStr 2 0][else]{MyValue}[end] EndTable: Table: AddComma Set: MyChar={$1} Set: count={!{$count}+1} [when]{count}=3 [do][@count==0][{MyChar},][else][{MyChar}][end] EndTable: