<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Table Results</title>
    <style>
        .result-box {
            border: 1px solid #000;
            padding: 10px;
            margin-bottom: 20px;
        }
    </style>
</head>
<body>
    <div class="result-box" id="resultBox">
        Results will be displayed here.
    </div>



    <button onclick="rollTable('CarousingOutcome')">Carousing Outcome</button>
    <button onclick="rollTable('LightMishap')">LightMishap</button> 
    <button onclick="rollTable('WizardMishap1')">Wizard Mishap Teir 1-2</button> 
    <button onclick="rollTable('WizardMishap2')">Wizard Mishap Teir 3-4</button> 
    <button onclick="rollTable('WizardMishap3')">Wizard Mishap Teir 5</button> 
   
   
    
   
   <br><br>Rewards<br>
   
    <button onclick="rollTable('treasureTable')">Roll Treasure 0-3</button>
    <button onclick="rollTable('treasureTable3')">Roll Treasure 4-6</button>
    <button onclick="rollTable('gemStones')">Roll Gem Stones</button>
   <button onclick="rollTables('LuxaryItems', 'LuxaryItems2')">LuxaryItems</button>
    <button onclick="rollTable('uniqueFeatures')">Weapon Features</button>
    
    <button onclick="rollTables('Secrets1', 'Secrets2')">Secrets</button>
    <button onclick="rollTable('Oaths')">Oaths</button>
    <button onclick="rollTable('Blessings')">Blessings</button>
    
    <br><br>Encounters & Maps<br>
   
    <button onclick="rollTable('SomethingHappens')">Something Happens</button>
    <button onclick="rollTable('Rumors')">Rumors</button>
    <button onclick="rollTablez('RanEnconterDistance', 'RanEnconterActivity', 'RanEnconterReaction', 'RanEnconterTreasure')">Random Encounter</button>
    <button onclick="rollTabl3s('Traps1', 'Traps2', 'Traps3')">Traps</button>
    <button onclick="rollTabl3s('Hazard1', 'Hazard2', 'Hazard3')">Hazard</button>
    <button onclick="rollTabl3s('AdvenGen1', 'AdvenGen2', 'AdvenGen3')">Adventure Generator</button>
    <button onclick="rollTabl3s('AdvenSite1', 'AdvenSite2', 'AdvenSite3')">Adventure Site Name</button>


    <script>
        const tables = {
           
            // Shadowdark treasure tables
            treasureTable: [
                "Bent tin fork (1 cp)",
                "Muddy torch (2 cp)",
                "Bag of smooth pebbles (2 cp)",
                "10 cp in a greasy pouch",
                "Rusty lantern with shattered glass (1 gp)",
                "Silver tooth (1 gp)",
                "Dull dagger (1 gp)",
                "Two empty glass vials (6 gp)",
                "60 sp in a rotten boot",
                "Cracked, handheld mirror (8 gp)",
                "Chipped greataxe (9 gp)",
                "10 gp in a moldy, wood box",
                "Chip of an emerald (10 gp)",
                "Longbow and bundle of 40 arrows (10 gp)",
                "Dusty, leather armor dyed black (10 gp)",
                "Scuffed, heavy shield (10 gp)",
                "Simple, well-made ***** sword (10 gp)",
                "12 gp in the pocket of a ripped cloak",
                "Wavy-bladed greatsword (12 gp)",
                "Pair of elf-forged shortswords (14 gp)",
                "Golden bowl (15 gp)",
                "Obsidian statuette of Shune the Vile (15 gp)",
                "Undersized pearl (20 gp)",
                "Jade-and-gold scarab pin (20 gp)",
                "Bag of 10 silver spikes (2 gp each)",
                "Mithral locket with a painting of a halfling (20 gp)",
                "Two finely forged dwarven shields (20 gp)",
                "Pair of silvered daggers (10 gp each)",
                "Copper-and-gold mead tankard (20 gp)",
                "Bundle of five red dragon scales (5 gp each)",
                "Light, warm cloak woven of spidersilk (25 gp)",
                "Fine set of ivory game pieces (25 gp)",
                "Half-finished suit of chainmail (30 gp)",
                "Matched trio of warhammers (10 gp each)",
                "Fragment of a sapphire (30 gp)",
                "Set of silk slippers and a robe (35 gp)",
                "Silver-and-gold circlet (40 gp)",
                "Radiant, polished pearl (40 gp)",
                "Mithral shield etched with soaring dragons (40 gp)",
                "Gold monkey idol with a ruby gripped in its teeth (60 gp)",
                "Fine suit of chainmail (60 gp)",
                "Cracked emerald (60 gp)",
                "Two lustrous pearls (40 gp each)",
                "1st-tier spell scroll (80 gp)",
                "Potion of Invisibility (80 gp)",
                "Magic wand, 2nd-tier spell (100 gp)",
                "Egg of The Cockatrice (100 gp)",
                "+1 armor (benefit, curse) (150 gp)",
                "Bag of Holding (virtue, flaw) (150 gp)",
                "+1 magic weapon (benefit) (200 gp)",
            ],
            treasureTable3: [
                   "Scattering of 3 cp",
                  "Wooden ring carved with knot pattern (5 cp)",
                  "Heavy iron key (1 sp)",
                  "Steel-banded wooden shield (10 gp)",
                  "Golden anchor necklace (10 gp)",
                  "Bag of 20 glass marbles (5 sp each)",
                  "Serrated greatsword (12 gp)",
                  "Three silver-tipped javelins (4 gp each)",
                  "Bag of rare spices (15 gp)",
                  "Mahogany pipe with ivory inlay (25 gp)",
                  "Set of polished bone dice (25 gp)",
                  "Copper flask etched with an owl (30 gp)",
                  "Eyepatch made of batwing leather (30 gp)",
                  "Leather bandoleer with 10 blue bottles (3 gp each)",
                  "Small oil painting of an elf woman (35 gp)",
                  "Opalescent pearl (40 gp)",
                  "Ceremonial, gold-capped warhammer (40 gp)",
                  "Silver ring with a miniature emerald (40 gp)",
                  "Tapestry of a unicorn in a forest glade (45 gp)",
                  "Goblin-made clockwork dragon doll (45 gp)",
                  "Half-complete suit of chainmail (50 gp)",
                  "Mace inlaid with gold holy symbols (50 gp)",
                  "Delicate, ancient vase of Myrkhosian make (50 gp)",
                  "Rare incense that is repulsive to undead (50 gp)",
                  "Minotaur hoof with a gold horseshoe (50 gp)",
                  "Longsword with a fiery pearl set in the pommel (50 gp)",
                  "Green crystal statuette of Memnon (50 gp)",
                  "Crimson holy symbol of Ramlaat with small ruby (55 gp)",
                  "Six black candles traced with gold runes (10 gp each)",
                  "Suit of dwarf-made chainmail (60 gp)",
                  "Dragonbone crossbow carved as roaring dragon (60 gp)",
                  "Half-complete suit of plate mail (65 gp)",
                  "Magnetic, iridescent chunk of meteorite (70 gp)",
                  "Full-length mirror set in gold frame (70 gp)",
                  "Large, green scarab encased in amber (75 gp)",
                  "Lute carved from ironwood with gold hardware (75 gp)",
                  "Ivory tusk carved with angels battling demons (80 gp)",
                  "Mithral shield inlaid with small, blue pearls (80 gp)",
                  "Two intact griffon eggs (40 gp each)",
                  "Suit of blackened-steel plate mail (130 gp)",
                  "2nd-tier spell scroll (140 gp)",
                  "Potion of Healing (150 gp)",
                  "3rd-tier spell scroll (200 gp)",
                  "Potion of Flying (200 gp)",
                  "Potion of Giant Strength (200 gp)",
                  "Magic wand, 3rd-tier spell (curse) (250 gp)",
                  "Ring of Feather Falling (250 gp)",
                  "+2 magic armor (benefit, curse) (300 gp)"
            ],
            // Gem Stones table
            gemStones: [
                "Pearl: 40",
                "Emerald: 120",
                "Ruby: 200",
                "Sapphire: 280",
                "Diamond: 360",
                "Giant gem: x2"
            ],
            // Unique Features table
            uniqueFeatures: [
                "Forgery",
                "Misshapen",
                "Poorly constructed",
                "Blemished",
                "Worn smooth",
                "Sparkling clean",
                "Bite marks",
                "Burned",
                "Dusty",
                "Caked with dry mud",
                "Rare artist mark",
                "Repaired",
                "Chipped",
                "Specks of dried blood",
                "Unusual material",
                "Fragile",
                "Rusted/rotted",
                "Painted upon",
                "Carved with initials",
                "Historic/famous",
            ],
              // Luxary Items
            LuxaryItems: [
              
            "Golden",
            "Etched-Copper",
            "Dragonscaled",
            "Gilded",
            "Bone-carved",
            "Amber-encased",
            "Painting",
            "Jade",
            "Silver",
            "Tapestry of",
            "White Marble",
            "Ivory",
            "Crystal",
            "Mythral",
            "Dragonbone",
            "Holy Relic",
            "Meteorite",
            "Masterwork",
            "Silkwrapped",
            "Stained glass",
            ], 
          
          LuxaryItems2: [
            "1d4:	1	tusk,	2	horn,	3	fang,	4	skull",
            "Altar,	1d4:	1	Memnon,	2	Ord,	3-4.	Madeera",
            "Statuette,	1d4:	1	fox,	2	cat,	3	dog,	4",
            "1d4:	1	chest,	2	table,	3	lockbox,	4	chair",
            "Icon,	1d4:	1	Chaos,	2	Neutrality,	3-4.	Law	",
            "of	Bust,	1d4:	1	god,	2	ruler,	3	hero,",
            "Egg,	1d4:	1	dragon,	2	basilisk,	3-4.	griffon",
            "1d4:	1	charm,	2	amulet,	3	locket,	4	signet",
            "of	Mask,	1d4:	1	crow,	2	jester,	3	thief,",
            "marble	1d4:	1	mirror,	2	vase,	3	pottery,	4",
            "1d4:	1	chalice,	2	plate,	3	cutlery,	4	mug",
            "1d4:	1	circlet,	2	ring,	3	chain,	4	torc",
            "Bottle,	1d4:	1	wine,	2	grog,	3	mead,	4",
            "1d4:	1-2.	scroll	case,	3	ink	pot,	4	quill",
            "relic	1d4:	1	shield,	2	helm,	3	bracers	4",
            "1d4:	1	lute,	2	viol,	3	harp,	4	flute",
            "1d4:	1	urn,	2	coffin,	3	bier,	4	sarcophagus",
            "1d4:	1	crown,	2	scepter,	3	orb,	4	throne",
            "glass	1d4:	1-2.	beetle,	3	butterfly,	4	spider",
            ],


          // Secrets
          Secrets1: [
              "The	TRUE	Name	of",			
              "The	one	manipulating",				
              "The	killer	of",
              "The	impersonator	of",		
              "The	horrifying	plan	of",				
              "The	secret	location	of",			
              "The	beloved	of",
              "Proof	of	the	crimes	by",	
              "The	treasure	hoard	of",		
              "The	weakness	of",
              "The	secret	identity of",				
              "The	one	blackmailing",
               ],
          Secrets2: [
            "The	king",
            "A	powerful	demon",
            "A	legendary	swordmaster",
            "The	head	of	the	church",
            "A	mighty	sorcerer",
            "A	rival	adventuring	party",
            "The	Thieves'	Guild	boss",
            "A	revered	knight	of	St.	Terragnis",
            "A	famous	dragon-slayer",
            "The	settlement's	leadership",	
            "A	fearsome	lich-queen",
            "A	cherished	NPC	",
            ],
          
          Oaths: [
            "The duke will procure you an audience with the queen", 
            "The City Watch will pardon a crime you've committed", 
            "A dryad will protect you while you're in her grove", 
            "A Thieves' Guild member will get you into the gem vault", 
            "A unicorn will heal a grave wound or affliction", 
            "A dwarven forgemaster will make you a spectacular sword", 
            "A baron will grant you the title of knight or constable", 
            "The Circle of Mages will magically teleport you anywhere", 
             ],
          
          
          Blessings:[
            
            "Wraithsight. You can see invisible and hidden creatures", 
            "Nine Lives. The next nine times you go to 0 HP, regain 1 HP", 
            "Demonskin. You are immune to damage from fire", 
            "Spiderwalk. You can crawl on walls and sheer surfaces", 
            "Merfolk's Kiss. You can breathe water as though it were air", 
            "Gede's Blessing. You can speak to and understand animals", 
            "Arcane Eye. Three times per day, advantage to cast a spell", 
            "Shune's Mark. When you kill a creature, heal 1d6 hit points", 
            "Ghostwalk. Once per day, turn incorporeal for 1d4 rounds", 
            "Death's Sting. You are immune to the effects of poison", 
            "Rite of Rage. Once per day, deal double damage", 
            "Divine Halo. Hostile spells that target you are DC 15 to cast", 
            ],
    
   
            RanEnconterDistance:[
              "Distance: Close",
              "Distance:Near","Distance:Near","Distance:Near",
              "Distance:Far","Distance:Far",
            ],
            
            RanEnconterActivity:[
              "Activity: Hunting","Activity: Hunting","Activity: Hunting",
              "Activity: Eating","Activity: Eating",
              "Activity: Building/Nesting","Activity: Building/Nesting",
              "Activity: Socializing/playing","Activity: Socializing/playing",
              "Activity: Guarding","Activity: Sleeping",
            ],
              
            RanEnconterReaction:[
              "Reaction:Hostile","Reaction:Hostile","Reaction:Hostile","Reaction:Hostile","Reaction:Hostile","Reaction:Hostile",
              "Reaction:Suspicious","Reaction:Suspicious",
              "Reaction:Neutral","Reaction:Neutral",
              "Reaction:Friendly",
              "Reaction: Curious","Reaction: Curious",
            ],
            
            RanEnconterTreasure:[
            "Treasure: Yes!","Treasure: No"
            ],
            
            
            Traps1:[
                  "Trap: Crossbow", 
                  "Trap: Hail of needles", 
                  "Trap: Toxic gas", 
                  "Trap: Barbed net", 
                  "Trap: Rolling boulder", 
                  "Trap: Slicing blade", 
                  "Trap: Spiked pit", 
                  "Trap: Javelin", 
                  "Trap: Magical glyph", 
                  "Trap: Blast of fire", 
                  "Trap: Falling block", 
                  "Trap: Cursed statue", 
            ],
            Traps2:[
                  "Trigger: Opening a door", 
                  "Trigger: Pressure plate", 
                  "Trigger: Switch or button", 
                  "Trigger: False step on stairs", 
                  "Trigger: Closing a door", 
                  "Trigger: Breaking a light beam", 
                  "Trigger: Pulling a lever", 
                  "Trigger: A word is spoken", 
                  "Trigger: Hook on a thread", 
                  "Trigger: TripWire", 
                  "Trigger: Removing an object", 
                  "Trigger: Casting a spell", 
            ],
            Traps3:[
                    "Dmg/Effect: 1d6", 
                    "Dmg/Effect: 1d6/sleep", 
                    "Dmg/Effect: 1d6/paralyze", 
                    "Dmg/Effect: 1d6/blind", 
                    "Dmg/Effect: 2d8", 
                    "Dmg/Effect: 2d8/sleep", 
                    "Dmg/Effect: 2d8/paralyze", 
                    "Dmg/Effect: 2d8/confuse", 
                    "Dmg/Effect: 3d10", 
                    "Dmg/Effect: 3d10/paralyze", 
                    "Dmg/Effect: 3d10/unconscious", 
                    "Dmg/Effect: 3d10/petrify", 
            ],
                  Hazard1:[
                    "Movement: Quicksand", 
                    "Movement: Caltrops", 
                    "Movement: Loose debris", 
                    "Movement: Tar field", 
                    "Movement: Grasping vines", 
                    "Movement: Steep incline", 
                    "Movement: Slippery ice", 
                    "Movement: Rushing water", 
                    "Movement: Sticky webs", 
                    "Movement: Gale force wind", 
                    "Movement: Greased floor", 
                    "Movement: Illusory terrain", 
                 ],
                    
                  Hazard2:[
                                
                    "Dmg Type: Acid pools", 
                    "Dmg Type: Exploding rocks", 
                    "Dmg Type: Icy water", 
                    "Dmg Type: Lava", 
                    "Dmg Type: Pummeling hail", 
                    "Dmg Type: Steam vents", 
                    "Dmg Type: Toxic mold", 
                    "Dmg Type: Falling debris", 
                    "Dmg Type: Acid rain", 
                    "Dmg Type: Curtain of fire", 
                    "Dmg Type: Electrified field", 
                    "Dmg Type: Gravity flux", 
                 ],
                 Hazard3:[
                                "Weaken: Blinding smoke", 
                    "Weaken: Magnetic field", 
                    "Weaken: Exhausting runes", 
                    "Weaken: Antimagic zone", 
                    "Weaken: Snuffs light sources", 
                    "Weaken: Disorienting sound", 
                    "Weaken: Magical silence", 
                    "Weaken: Numbing cold", 
                    "Weaken: Sickening smell", 
                    "Weaken: Sleep-inducing spores", 
                    "Weaken: Confusing reflections", 
                    "Weaken: Memory-stealing", 
                 ],
                WizardMishap1:[
                  "Devastation! Roll twice and combine both effects (reroll any further 1s)", 
                  "Explosion! You take 1d8 damage", 
                  "Refraction! You target yourself with the spell", 
                  "Your hand slipped! You target a random ally with the spell", 
                  "Mind wound! You can't cast this spell again for a week", 
                  "Discorporation! One random piece of your gear disappears forever", 
                  "Spell worm! You lose the ability to cast a random spell on each of your turns until you pass a DC 12 Constitution check. You regain the ability to cast those spells after completing a rest", 
                  "Harmonic failure! You lose the ability to cast a random spell until you complete a rest", 
                  "Poof! You suppress all light within a near distance from you, including sunlight and magical light, for 10 rounds", 
                  "The horror! You scream uncontrollably for 3 rounds in Primordial, drawing lots of attention", 
                  "Energy surge! You glow bright purple for 10 rounds, granting enemies advantage on attacks against you", 
                  "Unstable conduit! You have disadvantage on casting spells of the same tier for 10 rounds", 
                ],
                 WizardMishap2:[
                  "Devastation! Roll twice and combine both effects (reroll any further 1s)", 
                  "Blast radius! You and all near creatures take 2d6 damage", 
                  "Duplicate refraction! You target yourself and the nearest ally with two identical copies of the spell", 
                  "You flubbed the incantation! You cast a random spell from your known spells at the same targets, even if it would not normally be possible", 
                  "Ethereal bandersnatch! Two random pieces of your gear disappear forever", 
                  "Arcano-mutagenesis! You must pass a DC 12 Constitution check or a random stat drops to 3 (-4) until you successfully complete a rest", 
                  "Boom! You open a 30-foot deep sinkhole in the ground with you at the center. You and all near creatures must pass a DC 15 Dexterity check or fall in", 
                  "Petrification! 1d4 of your limbs petrify for the next 24 hours", 
                  "Stupefaction! You lose the ability to cast all spells of the same tier until you complete a rest", 
                  "It cannot be unseen! You must pass a DC 12 Wisdom check or descend into mad raving for 1d10 rounds", 
                  "Radioactive energies! You whirl with repulsive energies, drawing the hostility and attacks of all enemies who can see you for the next 1d4 rounds", 
                  "Uncontained channeling! You have disadvantage on casting spells of the same tier and lower for 10 rounds", 

                ],
                
                 WizardMishap3:[
                  "Devastation! Roll twice and combine both effects (reroll any further 1s)", 
                  "Pyroclastic extrusion! You deal 3d8 damage to yourself and all creatures within near", 
                  "Astral incision! An otherworldly blade cuts into your memory. You permanently forget one random spell", 
                  "The grimlow! You accidentally summon a hostile grimlow in a space near to you. It persists for 2d4 rounds before disappearing whence it came", 
                  "Dark plasma aura! Attacks against you pass through a vile aura, dealing double damage for the next 2d6 rounds", 
                  "Gate! You open a magic portal to another location, whether on this plane or another. Something dreadful will come through in 1d4 rounds unless you close it with a DC 18 Intelligence check on your turn", 
                  "Runaway arcana loop! Your spell targets a random creature you can see, even if it would not normally be possible. Each subsequent turn, you must pass a spellcasting check for that spell or you cast it on another random creature in the same way (effect ends on success)", 
                  "Arcane obstruction! You lose the ability to cast all spells of a random tier until you complete a rest", 
                  "What lurks beyond the veil! You must pass a DC 15 Wisdom check or fall into mad raving for 1d4 hours", 
                  "Ord's balance! You must either permanently sacrifice a magic item or the ability to cast a tier 3+ spell you know", 
                  "Unmitigated chain reaction! You have disadvantage on casting all spells for the next 10 rounds", 
                  "Shred! You tear a large hole in the fabric of the universe close to you; the lightless tear grows larger every round", 
                ],
                
              CarousingOutcome:[
               "1. You wake up blearily in your bed. Gain 2 XP.", 
                "2. You're locked in the stocks for 1d4 days and fined 20% of your total wealth for setting a building on fire. Gain 2 XP.", 
                "3. You wake up in a gutter with 15% of your total wealth spent. Gain 3 XP.", 
                "4. You hazily remember donating 10% of your total wealth to a glib priest. Gain 3 XP and a priest ally.", 
                "5. You're fined 10% of your total wealth for starting a full-tavern brawl. Gain 3 XP and be barred from a tavern.", 
                "6. The Thieves' Guild bilked you for 5% of your total wealth. Gain 4 XP.", 
                "7. You led an entire tavern in a wildly insulting song about a disliked noble. Gain 4 XP and a famous bard ally.", 
                "8. You survived a blindfolded knife-throwing demonstration unscathed. Gain 4 XP and a luck token.", 
                "9. By talent (50%) or trickery (50%), you beat a rival crawler in a test of skill. Gain 5 XP and an NPC ally or enemy.", 
                "10. An angry wizard cast a deadly spell at you, but you reflected it off your cup. Gain 5 XP and a luck token.", 
                "11. You performed a humiliating prank on a despised and corrupt merchant. Gain 5 XP and an ally in the City Watch.", 
                "12. You defeated a noble in a highly wagered drinking contest. Gain 5 XP and a debt owed by the noble.", 
                "13. You pulled off an ill-advised heist inside a feared sorcerer's tower. Gain 6 XP and an 80-100 item from your treasure table. 14+. You wake up deep inside the local ruler's stronghold holding one of their priceless family heirlooms. Footsteps approach. Gain 6 XP and a 90-100 item from your treasure table, if you escape.", 
                "Gain 6 XP and a 90-100 item from your treasure table, if you escape", 
 
              ],
                
              LightMishap:[
                "Dud. The light source (even a magical one) goes out and needs to be replaced or recast.", 
                "Fire. The light source (even a magical one) flares and burns your hand. Take 1 damage. DC 18 DEX or drop it.", 
                "Air. A rogue wind or pocket of thin air blows through. DC 15 DEX or the flames go out.", 
                "Water. A sudden rain shower or dripping ceiling hits the light source. DC 15 DEX or the flames go out.", 
                "Earth. Falling rocks, mud, leaves, or ash cover the light source. DC 12 DEX to protect it.", 
                "Spark. If the light source is open flame, it sparks and catches on 1d4 flammable objects within close. DC 12 DEX to extinguish each one.", 
              ],
               
             SomethingHappens:[
                 "The ground shakes violently and a massive fissure opens.", 
                  "An unseen foe leaps out of hiding at close range.", 
                  "A horrible buzzing fills the air, growing louder and louder.", 
                  "You catch the acrid smell of smoke and flame.", 
                  "A bright star appears in the sky, visible even at midday.", 
                  "You spot a half-open bag with gold coins glinting inside.", 
                  "A man slips a note and an odd potion into your hand.", 
                  "Someone observing you from afar steps out of sight.", 
                  "A dwarf in a red hat hands you a rose, bows, and leaves.", 
                  "A cowled stranger in a black cloak approaches you.", 
                  "Someone tries to pick your pocket.", 
                  "A strange ticking sound comes from inside your bag.", 
                  "A frothing, frantic horse with a saddle but no rider appears.", 
                  "A mound in the earth quickly burrows toward you.", 
                  "You sense you are being magically scryed upon.", 
                  "Someone tries to plant an object on your person.", 
                  "You are filled with a strong sense of dread and danger.", 
                  "A woman hands you a black cat and then runs away.", 
                  "A small, woodland creature jumps out of a backpack.", 
                  "You smell lilacs and hear faint, ghostly laughter.", 
                  "A note wrapped around a thin dagger lands next to you.", 
                  "A green-glowing meteor streaks through the sky.", 
                  "Someone nearby is staring at you and mouthing words.", 
                  "A pair of yellow eyes watches you from the darkness.", 
                  "An orc with an arrow in her back crashes through a door.", 
                  "You hear a beast cry out in pain just up ahead.", 
                  "A huge swarm of bats crashes over you and swirls away.", 
                  "A frail beggar whispers that he has a secret to tell you.", 
                  "An object falls from above and barely misses your head.", 
                  "A seagull lands on your head and coughs up an odd bottle.", 
                  "The smell of ozone rises and electricity crackles in the air.", 
                  "You spot a trail of tiny silver coins leading around a bend.", 
                  "A wild-eyed man approaches with a holy book held high.", 
                  "Every light source suddenly extinguishes.", 
                  "A stampede of wild animals bursts into view.", 
                  "An old woman points at you and yells, 'There they are!'", 
                  "A passing stranger presses an ancient coin into your hand.", 
                  "A chorus of howls echo in the distance.", 
                  "Two pinching and slapping goblins tumble into sight.", 
                  "You realize you are not alone; something is behind you.", 
                  "The sudden sound of rushing water crashes toward you.", 
                  "You hear an ear-splitting scream that nobody else hears.", 
                  "A man slaps you with a glove and throws it at your feet.", 
                  "A violent, windy storm kicks up without warning.", 
                  "Lightning strikes close and leaves a glowing object behind.", 
                  "A multicolored orb drifts up to you and then zips away.", 
                  "A runaway wagon crashes toward you.", 
                  "An NPC throws off their disguise, revealing an enemy.", 
                  "A demon appears to you and presents a tempting offer.", 
                  "A radiant being appears to you with a message of warning.",
            ],
            
            
            Rumors:[
                "An armored beast the size of a ship is rampaging nearby.", 
              "A team of assassins is on its way to kill your group.", 
              "The local ruler has placed a 2,000 gp bounty on your heads.", 
              "The cult of Shune is planning a fiery coup at midnight.", 
              "An ancient, stone door has been found in the castle cellar.", 
              "Lizardfolk have been raiding caravans near the swamp.", 
              "Armored skeletons are roaming the misty graveyard.", 
              "An earthquake uncovered a ruin inside a deep rift.", 
              "A warband of orcs has taken over an abandoned keep.", 
              "There is a hall of golden statues underneath the well.", 
              "Those who survive the Trial of the Lotus gain a strange gift.", 
              "A Captain of the Guard has been taken hostage by thugs.", 
              "The Crystal Caves are home to a cult of psychic sorcerers.", 
              "A crocodile dragged a richly-laden mule into the sewers.", 
              "A fortune-telling witch speaks true omens and portents.", 
              "Every full moon, the Prancing Unicorn's larder is robbed.", 
              "A famous group of crawlers hasn't returned from a delve.", 
              "A glowing meteor crashed deep inside the marshlands.", 
              "Fire will not light or burn within sight of the Lion Fountain.", 
              "The lost Jewel of Barbalt is hidden in the Howling Caves.", 
              "A dwarven mining team has uncovered a tentacled statue.", 
              "The Red Owl tavern has a trapdoor to the Shadowdark.", 
              "2d12 viperians guard a shrine to a medusa in the jungle.", 
              "Three thieves just pulled off a gemstone heist nearby.", 
              "Harpies keep watch from the cliffs around Diridia's Tomb.", 
              "A gorgon stalks the ruins of the Underhill Halls.", 
              "Beneath the Red Abbey is the forgotten Barrow of Ur-Din.", 
              "A dying sage is calling for a mighty group of heroes.", 
              "A wizard accidentally let his trio of cockatrices escape.", 
              "A local lord has somehow been stranded atop a high roof.", 
              "Bartomeu the Pirate Prince will be hanged at noon.", 
              "Goblin spelunkers found an underground cathedral.", 
              "The Kytherian Mechanism sank into the sea near Myrkhos.", 
              "Rare and valuable mushrooms grow inside an old crypt.", 
              "The Church of St. Terragnis will pay for the return of a relic.", 
              "A volcanic eruption revealed tunnels in the caldera's walls.", 
              "The cyclopean ruins of Tal-Yool lie deep within the forest.", 
              "A famous gambler will bet a ruby on a Wizard Thief game.", 
              "The Moon Druids will bless a sword used to slay a werewolf.", 
              "Gravediggers found a chained coffin in an unmarked plot.", 
              "An abandoned wizard's tower is full of clockwork creatures.", 
              "The Thieves' Guild is about to attack a rival merchant lord.", 
              "Windstorms uncovered a stone monolith in the desert.", 
              "A rival group of crawlers found the map to Jiraal's Hoard.", 
              "A monstrosity called The Carver lurks below the university.", 
              "The Onyx Destrier is in Ekmara's Keep in the wasteland.", 
              "The princess has been kidnapped by a group of sorcerers.", 
              "A Chaos Knight's tomb has been found beneath a temple.", 
              "The fabled Library of Gehemna appeared outside the city.", 
              "The dragon Ixamir has awoken from her 200-year slumber.", 

            ],

            AdvenGen1:[
                  "Rescue the", 
                  "Find the", 
                  "Destroy the", 
                  "Infiltrate the ", 
                  "Bypass the ", 
                  "Return the ", 
                  "Defeat the ", 
                  "Spy on the ", 
                  "Bribe the ", 
                  "Deliver the ", 
                  "Escape the ", 
                  "Imprison the ", 
                  "Stop the ", 
                  "Befriend the ", 
                  "Pacify the ", 
                  "Persuade the ", 
                  "Steal the ", 
                  "Escort the ", 
                  "Banish the ", 
                  "Free the ", 
            ],
           
            AdvenGen2:[
                "Goblet", 
                "Prisoner", 
                "Sword", 
                "Vault", 
                "Cult", 
                "Spirit", 
                "Killer", 
                "Demon", 
                "Noble", 
                "Hunter", 
                "Hostage", 
                "Thief", 
                "Spy", 
                "Werewolf", 
                "Relic", 
                "High priest", 
                "Merchant", 
                "Witch", 
                "Ritual", 
                "Vampire", 

            ],
            
            AdvenGen3:[
                  "Of the evil wizard", 
                  "Stalking the wastes", 
                  "At the bottom of the river", 
                  "In the city sewers", 
                  "Under the barrow mounds", 
                  "Of the fallen hero", 
                  "In the magical library", 
                  "In the king's court", 
                  "Of the ancient lineage", 
                  "In the sorcerer's tower", 
                  "In the Murkwood", 
                  "Hiding in the slums", 
                  "Of the Dwarven lord", 
                  "In the musty tomb", 
                  "Of the royal knights", 
                  "Sacrificing innocents", 
                  "In the catacombs", 
                  "Blackmailing the baron", 
                  "In the Thieves' Guild", 
                  "Murdering townsfolk", 

            ],
            
            AdvenSite1:[
                "Mines of the", 
                "Abbey of the", 
                "Tower of the", 
                "Caves of the", 
                "Barrow of the", 
                "Warrens of the", 
                "Crypt of the", 
                "Monastery of the", 
                "Ruin of the", 
                "Tunnels of the", 
                "Citadel of the", 
                "Tomb of the", 
                "Castle of the", 
                "Temple of the", 
                "Fortress of the", 
                "Isle of the", 
                "Keep of the", 
                "Dungeon of the", 
                "Necropolis of the", 
                "Shrine of the", 

            ],
            
            AdvenSite2:[
                "Cursed", 
                "Whispering", 
                "Bleeding", 
                "Shrouded", 
                "Lost", 
                "Dead", 
                "Deepwood", 
                "Fallen", 
                "Revenant", 
                "Frozen", 
                "Shimmering", 
                "Chaos", 
                "Abandoned", 
                "Blighted", 
                "Forgotten", 
                "Slumbering", 
                "Savage", 
                "Unholy", 
                "Enchanted", 
                "Immortal", 

            ],
            
            AdvenSite3:[
                "Flame", 
                "Ghost", 
                "Darkness", 
                "Peak", 
                "Borderlands", 
                "King", 
                "Twilight", 
                "Depths", 
                "Jewel", 
                "God", 
                "Lands", 
                "Storm", 
                "Swamp", 
                "Ravine", 
                "Valley", 
                "Horde", 
                "Skull", 
                "Queen", 
                "Wastes", 
                "Hero", 
            ],
            
            NPCAncestry:[
                
            ],
            
            NPCAge:[
                
            ],
            
            NPCAlignment:[
                
            ],
            
            NPSWealth:[
                
            ],
            
             NPCQualities1:[
                
            ],
            
             NPCQualities2:[
                
            ],
             NPCQualities3:[
                
            ],
             NPCQualitiesOccupation:[
                
            ],
             RivalRenown:[
                
            ],
            RivalSecert:[
                
            ],
            RivalPartyName1:[
                
            ],
            RivalPartyName2:[
                
            ],
            RivalPartyName3:[
                
            ],
                
        };


    function rollTable(tableName) {
        const outcomes = tables[tableName];
        if (outcomes) {
            const randomIndex = Math.floor(Math.random() * outcomes.length);
            const result = outcomes[randomIndex];
            document.getElementById("resultBox").innerText = `Result: ${result}`;
        } else {
            document.getElementById("resultBox").innerText = "Table not found!";
        }
    }

    function rollTables(table1Name, table2Name) {
        const outcomes1 = tables[table1Name];
        const outcomes2 = tables[table2Name];
        if (outcomes1 && outcomes2) {
            const randomIndex1 = Math.floor(Math.random() * outcomes1.length);
            const randomIndex2 = Math.floor(Math.random() * outcomes2.length);
            const result1 = outcomes1[randomIndex1];
            const result2 = outcomes2[randomIndex2];
            document.getElementById("resultBox").innerText = `Result 1: ${result1}\nResult 2: ${result2}`;
        } else {
            document.getElementById("resultBox").innerText = "Table not found!";
        }
    }
   function rollTabl3s(table1Name, table2Name, table3Name) {
        const outcomes1 = tables[table1Name];
        const outcomes2 = tables[table2Name];
        const outcomes3 = tables[table3Name];
        if (outcomes1 && outcomes2 && outcomes3) {
            const randomIndex1 = Math.floor(Math.random() * outcomes1.length);
            const randomIndex2 = Math.floor(Math.random() * outcomes2.length);
            const randomIndex3 = Math.floor(Math.random() * outcomes3.length);
            const result1 = outcomes1[randomIndex1];
            const result2 = outcomes2[randomIndex2];
            const result3 = outcomes3[randomIndex3];
            document.getElementById("resultBox").innerText = `Result 1: ${result1}\nResult 2: ${result2}\nResult 3: ${result3}`;
        } else {
            document.getElementById("resultBox").innerText = "Table not found!";
        }
   }
        
    function rollTablez(table1Name, table2Name, table3Name, table4Name) {
        const outcomes1 = tables[table1Name];
        const outcomes2 = tables[table2Name];
        const outcomes3 = tables[table3Name];
        const outcomes4 = tables[table4Name];
        if (outcomes1 && outcomes2 && outcomes3 && outcomes4) {
            const randomIndex1 = Math.floor(Math.random() * outcomes1.length);
            const randomIndex2 = Math.floor(Math.random() * outcomes2.length);
            const randomIndex3 = Math.floor(Math.random() * outcomes3.length);
            const randomIndex4 = Math.floor(Math.random() * outcomes4.length);
            const result1 = outcomes1[randomIndex1];
            const result2 = outcomes2[randomIndex2];
            const result3 = outcomes3[randomIndex3];
            const result4 = outcomes4[randomIndex4];
            document.getElementById("resultBox").innerText = `Result 1: ${result1}\nResult 2: ${result2}\nResult 3: ${result3}\nResult 4: ${result4}`;
        } else {
            document.getElementById("resultBox").innerText = "Table not found!";
        }
    }


    </script>
</body>
</html>
 
by

HTML Online Editor & Compiler

Write, Run & Share HTML code online using OneCompiler's HTML online Code editor for free. It's one of the robust, feature-rich online Code editor for HTML language, running on the latest version HTML5. Getting started with the OneCompiler's HTML compiler is simple and pretty fast. The editor shows sample boilerplate code when you choose language as HTML. You can also specify the stylesheet information in styles.css tab and scripts information in scripts.js tab and start coding.

About HTML

HTML(Hyper Text Markup language) is the standard markup language for Web pages, was created by Berners-Lee in the year 1991. Almost every web page over internet might be using HTML.

Syntax help

Fundamentals

  • Any HTML document must start with document declaration <!DOCTYPE html>
  • HTML documents begin with <html> and ends with </html>
  • Headings are defined with <h1> to <h6> where <h1> is the highest important heading and <h6> is the least important sub-heading.
  • Paragrahs are defined in <p>..</p> tag.
  • Links are defined in <a> tag.

    Example:

    <a href="https://onecompiler.com/html">HTML online compiler</a>
    
  • Images are defined in <img> tag, where src attribute consists of image name.
  • Buttons are defined in <button>..</button> tag
  • Lists are defined in <ul> for unordered/bullet list and <ol> for ordered/number list, and the list items are defined in <li>.

HTML Elements and Attributes

  • HTML element is everything present from start tag to end tag.
  • The text present between start and end tag is called HTML element content.
  • Anything can be a tagname but it's preferred to put the meaningful title to the content present as tag name.
  • Do not forget the end tag.
  • Elements with no content are called empty elements.
  • Elements can have attributes which provides additional information about the element.
  • In the below example, href is an attribute and a is the tag name.

    Example:

    <a href="https://onecompiler.com/html">HTML online compiler</a>
    

CSS

CSS(cascading style sheets) describes how HTML elements will look on the web page like color, font-style, font-size, background color etc.

Example:

Below is a sample style sheet which displays heading in green and in Candara font with padding space of 25px.

body{
  padding: 25px;
}
.title {
	color: #228B22;
	font-family: Candara;
}

HTML Tables

  • HTML Tables are defined in <table> tag.
  • Table row should be defined in <tr> tag
  • Table header should be defined in <th> tag
  • Table data should be defined in <td> tag
  • Table caption should be defined in <caption> tag

HTML-Javascript

  • Javascript is used in HTML pages to make them more interactive.
  • <script> is the tag used to write scripts in HTML
  • You can either reference a external script or write script code in this tag.

Example

<script src="script.js"></script>