• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

More Fun with Random Tables

Yep, all you had to do was fix the typo.

In included the more readable randomizer with it.

Code:
<HTML>
<HEAD>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>Crown of the World Caravan Encounters</TITLE>
</HEAD>
<BODY>

<script language="JavaScript">

// Some Arrays


rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
rnd.seed = (rnd.seed*9301+49297) % 233280;
return rnd.seed/(233280.0);
}

function rand(number) {
return Math.floor(Math.random() * number) + 1;
}

function tableResults(argument, rollModifier) {

var varisiaArray = [];

varisiaArray.push({"max": 5, "name": "Rough Terrain", "content": "a" });
varisiaArray.push({"max": 10, "name": "Cabin", "content": "b" });
varisiaArray.push({"max": 15, "name": "Erutaki Encampment", "content": "c" });
varisiaArray.push({"max": 20, "name": "Hungry Predators", "content": "d" });
varisiaArray.push({"max": 25, "name": "Horned Herd", "content": "e" });
varisiaArray.push({"max": 30, "name": "Wanderers", "content": "f" });
varisiaArray.push({"max": 35, "name": "Wrecked Caravan", "content": "g" });
varisiaArray.push({"max": 40, "name": "Dragon Sighting", "content": "h" });
varisiaArray.push({"max": 50, "name": "Blizzard", "content": "A bitter storm of driving wind and snow engulfs the caravan for 1d4 days. During this time, the caravan takes a –2 penalty to AC and on Attack and Security checks because of poor visibility and hostile weather. The caravan can make a DC 22 Security check each day to move at half speed during the blizzard. If the caravan fails the check by 4 or less, the caravan moves at one-quarter speed. If the caravan fails the check by 5 or more, it makes no progress. Casting control winds grants a +2 bonus on this check, while control weather grants a +4 bonus. When the blizzard ends, the deep drifts of snow it leaves behind are considered a Rough Terrain encounter (see page 17) for 1d4 days. XP Award: Award the PCs 3,200 XP for a blizzard encounter." });
varisiaArray.push({"max": 55, "name": "Aurora", "content": "The wondrous polar aurora ripples overhead at night for 1 week. This good omen grants the caravan a +2 bonus on Resolve checks for the duration of the aurora, and the caravan’s fortune-teller can use her reroll ability one additional time that week." });
varisiaArray.push({"max": 60, "name": "Wings of Hope", "content": "k" });
varisiaArray.push({"max": 65, "name": "Death from Below", "content": "l" });
varisiaArray.push({"max": 70, "name": "Creeping Rot", "content": "m" });
varisiaArray.push({"max": 76, "name": "Wagon Damage", "content": "n" });
varisiaArray.push({"max": 80, "name": "Ice Hunters", "content": "o" });
varisiaArray.push({"max": 85, "name": "Pleasant Weather", "content": "p" });
varisiaArray.push({"max": 90, "name": "Polar Pudding", "content": "q" });
varisiaArray.push({"max": 100, "name": "Frozen Dead", "content": "r" });
varisiaArray.push({"max": 105, "name": "Black Monolith", "content": "The caravan approaches a monolith of black stone that rises out of the ice to a height of 20 feet. This is one of the monoliths Katiyana has been placing across the Crown of the World to cement her control over the morozkos. Creatures: A Frozen Dead encounter always accompanies the discovery of a black monolith. In addition, there is a 50% chance that it is accompanied by a Blizzard encounter (see the next column)." });
varisiaArray.push({"max": 110, "name": "The Lonely Maiden", "content": "t" });
varisiaArray.push({"max": 115, "name": "Northern Lights", "content": "u" });
varisiaArray.push({"max": 120, "name": "Rough Terrain", "content": "v" });
varisiaArray.push({"max": 125, "name": "Crevasse", "content": "w" });
varisiaArray.push({"max": 130, "name": "Polar Mirage", "content": "x" });
varisiaArray.push({"max": 135, "name": "Black Slush", "content": "The caravan encounters a wide area of tainted snow and polluted eff luent. This acts as an open Crevasse encounter (see page 12), though casting water walk grants a +2 bonus on Security checks to cross the area. In addition, the caravan must make a DC 23 Security check once per hour while crossing or become poisoned by the toxic slurry, taking a cumulative –1 penalty to AC and on Attack checks for each failed check. These penalties can be removed with a successful DC 23 Security check when the caravan rests. Each healer in the caravan grants a cumulative +1 bonus on this check, and each casting of neutralize poison grants a +2 bonus on the check. Creatures: In addition, there is a 50% chance that an area of black slush is the hunting ground of a mated pair of chardas, xenophobic monstrous humanoids from the depths of the earth, who attack the caravan (AC 23; hp 115; Attack +18; Damage 8d8+4). The chardas can be avoided with two successful DC 19 Security checks. The chardas fight to the death. Treasure: The chardas maintain a lair in an ice cave below the black slush, which can be found with a DC 25 Survival check. Inside the lair are 34 uncut diamonds (worth 100 gp each), one of which is actually an air elemental gem. XP Award: Award the PCs 3,200 XP for a black slush encounter, and an additional 6,400 XP if they defeat the mated pair of chardas." });
varisiaArray.push({"max": 140, "name": "Auroral Flight", "content": "Creature: The caravan sees a strange, blue-green light on the northern horizon, sometimes streaking at high speed in straight lines, and at other times soaring in broad circles. This is a boreal yrthak, a f lying reptile that has adapted to life in the cold skies above the frozen wastes of the Crown of the World. The caravan can make a DC 24 Security check to avoid the boreal yrthak; otherwise, the creature notices the caravan and swoops in to attack, targeting individual creatures rather than the caravan itself." });
varisiaArray.push({"max": 145, "name": "Cold Gate", "content": "aa" });
varisiaArray.push({"max": 150, "name": "Hunting Party", "content": "ab" });



var allArrays = {
"varisia": varisiaArray,
};

if (!rollModifier) {
rollModifier = 0;
}
var randomNum = rand(100) + rollModifier;
var arrayOfChoices = allArrays[argument];
var error = "";
if (!arrayOfChoices) {
error = "no such set: " + argument;
}

var content = "";
var name = "";
for (var itemIndex in arrayOfChoices) {
var item = arrayOfChoices[itemIndex];
if (randomNum <= item.max) {
content = item.content;
name = item.name
break;
} 
}

var results = [];
if (error) {
results.name = "";
results.content = error;
} else { 
results.name = name;
results.content = content;
}
return results;

}

</script>

<div id="error"></div>
<form>
<input type="button" name="Button1" value="Outer Rim" onClick="var x = tableResults('varisia', 0);this.form.name.value=x.name;this.form.content.value = x.content;" size="" />
<input name="name" style="font-weight:bold;"></input>
<textarea name="content" cols="50" rows="11" wrap="soft"></textarea>

</form>

<form>
<input type="button" name="Button2" value="High Ice" onClick="var x = tableResults('varisia', 25);this.form.name.value=x.name;this.form.content.value = x.content;" size="" />
<input name="name" style="font-weight:bold;"></input>
<textarea name="content" cols="50" rows="11" wrap="soft"></textarea>

</form>

<form>
<input type="button" name="Button3" value="Boreal Expanse" onClick="var x = tableResults('varisia', 50);this.form.name.value=x.name;this.form.content.value = x.content;" size="" />
<input name="name" style="font-weight:bold;"></input>
<textarea name="content" cols="50" rows="11" wrap="soft"></textarea>

</form>

Tested on RW.
 
Here is the finished table. It is too long for one post so I will have to sllit it into 4 parts.

<HTML>
<HEAD>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>Crown of the World Caravan Encounters</TITLE>
</HEAD>
<BODY>

<script language="JavaScript">

// Some Arrays


rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
rnd.seed = (rnd.seed*9301+49297) % 233280;
return rnd.seed/(233280.0);
}

function rand(number) {
return Math.ceil(rnd()*number);
}

function tableResults(argument, rollModifier) {

var varisiaArray = [];

varisiaArray.push({"max": 5, "name": "Rough Terrain", "content": "The caravan encounters a region of unexpected difficulty, such as bogs in the lowlands, swift rapids and landslides in the highlands, or deep snow or unstable ice across the pole. This rough terrain forces the caravan to move at half speed for 1d4 days. Each day, the caravan can make a DC 21 Security check to move at three-quarters speed through the rough terrain. XP AWARD: Award the PCs 2,400 XP for a rough terrain encounter." });
varisiaArray.push({"max": 10, "name": "Cabin", "content": "The caravan encounters a single isolated cabin, built to provide shelter for trappers, prospectors, and other wanderers. Cabins may be solid lodges of fieldstone or hewn logs, sod dugouts, or clapboard shacks. Creatures: Such cabins are frequently empty, but sometimes they are occupied by any of a variety of creatures. When a cabin is found, consult the following table to determine its occupants. Development: If a cabin is unoccupied, the caravan can scavenge its contents and materials for 1 cargo unit of repair materials, stores, or trade goods (equal chance of each being present) with a special DC 20 Resolve check. If the cabin is occupied, the caravan can buy or sell 1 cargo unit of repair materials, stores, or trade goods (or trade one type of cargo for another) with a special DC 20 Resolve check. A successful check also enables the PCs to gain information about the surrounding territory—for the next 1d3 days, the caravan may roll twice for caravan encounters, choosing the less dangerous (or the more beneficial) of the two results." });
varisiaArray.push({"max": 15, "name": "Erutaki Encampment", "content": "The caravan comes across a small, semi-permanent encampment or village of nomadic Erutaki. Alternatively, this encounter could be with an isolated village of Snowcaster elves. If desired, the caravan can make a DC 22 Security check to avoid the encampment without being noticed by the inhabitants. Use of magic such as fog cloud, invisibility sphere, or sleet storm grants a +1 bonus on this check per spell or effect. If the caravan decides to visit the encampment, a successful DC 20 Diplomacy check (modified by the encampment’s Law modifier) secures permission from the encampment’s chief for the caravan to shelter inside the camp for up to 1 week. A caravan has no encounters while sheltered inside an encampment and gains a +2 bonus on any Security checks to repair wagons. The caravan can also consult with the encampment’s shaman, allowing the caravan’s fortuneteller to use her reroll ability one additional time, and the shaman can brew 1st- or 2nd-level potions for purchase. If the PCs fail the Diplomacy check by 4 or fewer, it gains no special benefits or disadvantages. If the PCs fail the check by 5 or more, there is a 50% chance that the Erutaki sell the caravan shoddy trade goods (–5 penalty on future checks to sell them in other settlements) or tainted stores (each cargo unit of stores counts as only 5 units of provisions, and there is a 10% chance of a Creeping Rot encounter—see page 12). The shoddy goods or tainted stores can be detected before purchase with a successful DC 22 Security check. DEVELOPMENT: Each time the caravan stops at an encampment, there is a 25% chance that an agent of the Five Winds stirs up trouble for the caravan—the next time they have a caravan encounter, roll twice and use the more dangerous result." });
varisiaArray.push({"max": 20, "name": "Hungry Predators", "content": "50% CHANCE OF OCCURING WHILE THE CARAVAN IS CAMPED. CREATURES: A group of hungry animals catches the caravan’s scent and begins tracking it, hoping to devour the caravan’s travelers or draft animals. The predators might be a pack of wolves or dire wolves, a family of snow leopards, or a pair of grizzly bears or dire wolverines (AC 20; hp 85; Attack +13; Damage 6d8+3). Whatever their type, the predators flee if reduced to fewer than 30 hit points. The caravan can avoid this encounter with a successful DC 22 Security check. Offering the animals 1d6 units of provisions grants a +2 bonus on this check, and each character with wild empathy or the ability to speak with animals adds an additional +1 bonus on the check. Alternatively, hungry predators can be magical beasts such as a trio of snowy owlbears, a pair of winter wolves, or a single frost drake (AC 21; hp 100; Attack +15; Damage 10d6). This encounter can be avoided with a successful DC 23 Security check, but only characters with wild empathy can modify this check. XP AWARD: Award the PCs 3,200 XP for defeating animal predators or 4,800 XP for defeating magical beast predators." });
varisiaArray.push({"max": 25, "name": "Horned Herd", "content": "50% CHANCE OF OCCURING WHILE THE CARAVAN IS CAMPED. CREATURES: The caravan encounters a herd of elk, musk oxen, or woolly rhinoceroses. The caravan can peacefully bypass the herd with a succesful DC 18 Security check. If the caravan fails the check by 4 or less, it can wait 1d4 hours for the herd to move on without incident. If the caravan fails the check by 5 or more, the herd becomes aggressive and charges it (AC 21; hp 100; Attack +11; Damage 10d6). The herd attacks for 1d3 rounds before fleeing. If the caravan succeeds at the Security check by 5 or more, it brings down part of the herd, gaining 5d6 units of provisions. If the caravan succeeds at the check by 10 or more, it can collect 10d6 units of provisions or capture animals to train as draft animals. A character with ranks in Handle Animal can attempt to train a captured herd for heavy labor with a DC 15 Handle Animal check. If the check is successful, the caravan can add a free horse train at the end of 2 weeks. XP AWARD: Award the PCs 4,800 XP for dealing with the herd." });
varisiaArray.push({"max": 30, "name": "Wanderers", "content": "50% CHANCE OF OCCURING WHILE THE CARAVAN IS CAMPED. CREATURES: The caravan encounters a lone guide or trapper, or a small group of trappers, traders, or Snowcaster elves. Roll on the following table to determine the nature of the wanderers. DEVELOPMENT: If made friendly with a successful DC 22 Diplomacy check (an offering of 1 unit of provisions per wanderer grants a +2 bonus on the check), the wanderers can give clues about the road ahead and warn the caravan of danger. For 1d6 days, the caravan may roll twice for any caravan event and choose the least dangerous event. A traveling merchant allows the caravan to buy or sell goods as if at a settlement, or to buy or sell goods up to 500 gp (GM’s discretion as to limits on what is available). The caravan can trade 1 cargo unit of stores for 1 cargo unit of trade goods with any wanderer. If the PCs fail the Diplomacy check by 4 or less, the caravan gains no benef its. If the PCs fail the check by 5 or more, there is a 50% chance that the wanderers attempt to steal 1 cargo unit of stores or trade goods, or sabotage the caravan, causing a Wagon Damage encounter (see the previous column). A successful DC 20 Security check prevents their mischief and allows the PCs to engage the wanderers in combat or allow them to f lee. A Security check result of 25 or better allows the PCs to take the wanderers prisoner without a fight." });
varisiaArray.push({"max": 35, "name": "Wrecked Caravan", "content": "The caravan finds abandoned, broken-down wagons along the path, possibly including the remains of its former drivers or passengers. The caravan can spend 1 day scavenging the wreckage for 1d6 cargo units of repair materials, or a wainwright can attempt to repair the wreckage into a functional covered wagon or supply wagon with a DC 20 Security check and 1 cargo unit of repair materials. If the caravan fails this check, the wreckage cannot be salvaged. There is a 25% chance that the wrecked caravan also contains 1d6 cargo units of trade goods. There is also a 25% chance that a wrecked caravan contains a Frozen Dead encounter." });
varisiaArray.push({"max": 40, "name": "Dragon Sighting", "content": "The caravan sees the white dragon Vegsundvaag (see page 58) flying through the sky some distance away. Fortunately, the dragon is far enough away that it poses no physical threat to the caravan at this point, but the sighting unnerves the caravan, which must succeed at a DC 17 Resolve check or it makes no progress for the rest of the day and gains 1 point of Unrest." });
varisiaArray.push({"max": 50, "name": "Blizzard", "content": "A bitter storm of driving wind and snow engulfs the caravan for 1d4 days. During this time, the caravan takes a –2 penalty to AC and on Attack and Security checks because of poor visibility and hostile weather. The caravan can make a DC 22 Security check each day to move at half speed during the blizzard. If the caravan fails the check by 4 or less, the caravan moves at one-quarter speed. If the caravan fails the check by 5 or more, it makes no progress. Casting control winds grants a +2 bonus on this check, while control weather grants a +4 bonus. When the blizzard ends, the deep drifts of snow it leaves behind are considered a Rough Terrain encounter (see page 17) for 1d4 days. XP Award: Award the PCs 3,200 XP for a blizzard encounter." });
 
Last edited:
part 2
varisiaArray.push({"max": 55, "name": "Aurora", "content": "The wondrous polar aurora ripples overhead at night for 1 week. This good omen grants the caravan a +2 bonus on Resolve checks for the duration of the aurora, and the caravan’s fortune-teller can use her reroll ability one additional time that week." });
varisiaArray.push({"max": 60, "name": "Wings of Hope", "content": "The caravan sees a beneficent creature (such as a giant eagle, giant owl, or silver dragon) flying overhead. The caravan is heartened by the sight and gains a +2 bonus on its next Resolve check. The creature also keeps a lookout for danger and warns the caravan of dangers ahead, granting the caravan a +2 bonus on Security checks for the next 1d4 days." });
varisiaArray.push({"max": 65, "name": "Death from Below", "content": "50% CHANCE OF OCCURING WHILE THE CARAVAN IS CAMPED. Creature: A burrowing beast erupts from below and attempts to devour pack or draft animals. In the Outer Rim, the creature is a bulette (AC 20; hp 85; Attack +13; Damage 6d8); in the High Ice, it is a remorhaz (AC 20; hp 85; Attack +13; Damage 6d8); and in the Boreal Expanse it is a young frost worm (AC 25; hp 145; Attack +19; Damage 10d8+5). Each time the creature makes a successful attack against the caravan, the caravan must succeed at a DC 22 Security check or lose a random wagon’s draft team (or a random horse train). Once it seizes prey in this fashion, the creature retreats. A wagon without a draft team cannot move on its own; the draft team must be replaced with a new horse train. Alternatively, the wagon can be hitched to another wagon and team, but doing so reduces the entire caravan’s speed by 25% until the wagon receives a new horse train XP Award: Award the PCs 3,200 XP for defeating a bulette or remorhaz, or 12,800 XP for defeating a frost worm." });
varisiaArray.push({"max": 70, "name": "Creeping Rot", "content": "The caravan’s provisions somehow become tainted, spreading sickness in the caravan. Each day the creeping rot spreads, 1 cargo unit of provisions is destroyed and the caravan takes a –1 penalty to AC and on Attack and Resolve checks. In addition, the caravan’s speed is reduced by 25%. These penalties are cumulative, and after 4 days, the caravan is stranded and cannot move. Each day, the caravan can make a DC 25 Security check to contain the creeping rot. A successful check halts the spread of the taint for that day. After two consecutive successful checks, the creeping rot is ended—the penalties are removed and the caravan’s speed returns to normal. Each healer in the caravan, each PC able to cast purify food and drink, and each casting of remove disease grants a +1 bonus on these checks. XP Award: Award the PCs 2,400 XP for dealing with creeping rot." });
varisiaArray.push({"max": 76, "name": "Wagon Damage", "content": "Broken axles or wheels force the caravan to halt until they can be repaired. A wainwright must succeed at a DC 21 Security check to repair the wagon. Casting make whole grants a +1 bonus on the check, minor creation or wood shape grants a +2 bonus, and fabricate or major creation grants a +3 bonus. Each Security check, whether successful or not, takes 1 day and uses 1 cargo unit of repair materials. If the caravan simply abandons the damaged wagon (determine which randomly), it can continue at normal speed. XP AWARD: Award the PCs 2,400 XP for successfully repairing the wagon damage." });
varisiaArray.push({"max": 80, "name": "Ice Hunters", "content": "CREATURES: The caravan encounters a group of ice trolls (AC 21; hp 100; Attack +15; Damage 10d6). If encountered while the caravan is active, the trolls attempt to follow the caravan and ambush it while the caravan camps. If active, the caravan can make a DC 23 Security check to detect the trolls’ presence before they attack; if camped, a DC 20 Security check is necessary to avoid being surprised. If reduced to fewer than 40 hit points, the trolls forfeit their attack and attempt to retreat on their next turn. The caravan can prevent their escape with a DC 23 Security check. DEVELOPMENT: If the trolls escape, the caravan can easily track them and engage them in combat again. However, half of the trolls’ damage has been regenerated. If the caravan chooses not to track them, the trolls escape, regenerate their full hit points, and attack 1d4 hours later, attempting to ambush the caravan again. If the trolls are reduced to fewer than 40 hit points a second time, they retreat but do not return again if they escape. The Erutaki hate ice trolls, and anyone bearing the head of an ice troll (burned with fire or acid to ensure it cannot regenerate) gains a +2 circumstance bonus on Charisma-based skill checks or on caravan Resolve checks when dealing with Erutaki. TREASURE: A band of ice hunters carries 1 cargo unit worth of treasure (typically fur pelts, gold or silver nuggets, crude bracelets, scrimshaw, or polished semiprecious stones) worth 1,200 gp. XP AWARD: Award the PCs 4,800 XP for defeating the ice trolls." });
varisiaArray.push({"max": 85, "name": "Pleasant Weather", "content": "Temperatures are one category warmer for 1d4 days. Thanks to the good visibility and milder conditions, the caravan gains a +2 bonus on Security and Resolve checks. In addition, the caravan’s speed increases by 25% for the duration of the good weather." });
varisiaArray.push({"max": 90, "name": "Polar Pudding", "content": "50% CHANCE OF OCCURING WHILE THE CARAVAN IS CAMPED. CREATURE: Amorphous scavengers of the North, white puddings look like harmless patches of snow and ice, but these variant black puddings consume organic and inorganic material alike. The caravan must make a DC 22 Security check to avoid blundering into a hidden white pudding (AC 20; hp 85; Attack +13; Damage 6d8+3). If the caravan fails the Security check, it is considered surprised, and takes a –2 penalty to its AC and on Attack checks for the first round of combat. If the pudding makes a successful attack, the caravan must succeed at a DC 22 Security check or become mired in the pudding, unable to move and taking a –2 penalty to its AC and on Attack checks. If the caravan does not become mired, it can forfeit its attack to attempt to escape the encounter with two DC 17 Security checks. XP AWARD: Award the PCs 3,200 XP for defeating the white pudding." });
varisiaArray.push({"max": 100, "name": "Frozen Dead", "content": "50% CHANCE OF OCCURING WHILE THE CARAVAN IS CAMPED. Creatures: The caravan encounters several frozen bodies—either dead corpses or undead creatures. Determine the exact type of frozen dead encountered on the following table. Dead animal or dead human remains are the heaped corpses of animals or humans, frozen solid and displaying gaping wounds—victims of Katiyana and her undead minions in their efforts to control the morozkos and restore Sithhud’s power. Most frozen dead attack the PCs and ignore the caravan. The exceptions are the gangs of frostfallen skeletons or frostfallen zombies, which attack the caravan in CR 8 armies of two dozen human walking dead with the frostfallen template (AC 21; hp 100; Attack +15; Damage 10d6). Each character with the channel energy ability grants the caravan a +1 bonus on Attack checks made against these undead foes. IN THE TUNDRA or the OUTER RIM, frozen dead, whether corpses or undead, have a 10% chance of being marked with the three-fingered icy claw symbol of Sithhud. This chance increases to 50% in the HIGH ICE and 100% in the BOREAL EXPANSE. Hoarfrost spirits are ALWAYS marked with Sithhud’s symbol. DEVELOPMENT: Anytime the caravan encounters frozen dead, the caravan must make a Resolve check (DC 15 for normal remains, DC 20 for undead). If the caravan fails this check, it takes a –2 penalty on Resolve checks for 1 week. TREASURE: Any group of humanoid corpses, whether dead or undead, has a 50% chance of having 1 cargo unit of trade goods preserved in the ice along with them. Dead animal remains or undead animals have no treasure." });
 
part 3
varisiaArray.push({"max": 105, "name": "Black Monolith", "content": "The caravan approaches a monolith of black stone that rises out of the ice to a height of 20 feet. This is one of the monoliths Katiyana has been placing across the Crown of the World to cement her control over the morozkos. Creatures: A Frozen Dead encounter always accompanies the discovery of a black monolith. In addition, there is a 50% chance that it is accompanied by a Blizzard encounter (see the next column)." });
varisiaArray.push({"max": 110, "name": "The Lonely Maiden", "content": "50% CHANCE OF OCCURING WHILE THE CARAVAN IS CAMPED. Creature: The caravan encounters a yuki-onna—the restless spirit of a woman frozen to death in the snow and never given a proper burial—known as the Lonely Maiden. Appearing as a beautiful but sad ghostly woman surrounded by swirling mists of snow and ice, the Lonely Maiden seeks to impose her own cruel fate upon the PCs, attempting to lure them away from the caravan to an icy death with her fascinating gaze. Once her victims are away from the caravan, she attacks." });
varisiaArray.push({"max": 115, "name": "Northern Lights", "content": "50% CHANCE OF OCCURING WHILE THE CARAVAN IS CAMPED. This encounter begins as an Aurora encounter (see page 9), but the caravan soon sees a pair of glowing orbs slowly descending from the aurora. CREATURES: The balls of light are actually will-o’-wisps masquerading as helpful spirits. They offer to guide the caravan safely past several local hazards, but actually attempt to lead it into danger. The caravan can make a DC 23 Resolve check to see through the will-o’-wisps’ deception. Each character able to detect evil grants a +1 bonus on this check. The Erutaki are familiar with the treacherous “spirits,” so any Erutaki with the caravan grant a +2 bonus on the check. If the Resolve check fails, the will-o’-wisps lead the caravan into a hidden Crevasse encounter (see page 12) and then attack (AC 21; hp 100; Attack +15; Damage 7d8+4). TREASURE: At the bottom of the crevasse is a broken supply wagon. The wagon can be salvaged, looted, or repaired as a Wrecked Caravan encounter (see page 17), but with no chance of a Frozen Dead encounter. In addition, among the shattered and useless junk at the bottom of the crevasse is 1 cargo unit of treasure, consisting of 1,397 cp, 3,224 sp, 697 gp, 47 pieces of unpolished amber (worth 10 gp each), and a minor ring of cold resistance. XP AWARD: Award the PCs 4,800 XP for defeating the will-o’-wisps, and an additional 4,800 XP if they encounter the crevasse." });
varisiaArray.push({"max": 120, "name": "Rough Terrain", "content": "The caravan encounters a region of unexpected difficulty, such as bogs in the lowlands, swift rapids and landslides in the highlands, or deep snow or unstable ice across the pole. This rough terrain forces the caravan to move at half speed for 1d4 days. Each day, the caravan can make a DC 21 Security check to move at three-quarters speed through the rough terrain. XP AWARD: Award the PCs 2,400 XP for a rough terrain encounter." });
varisiaArray.push({"max": 125, "name": "Crevasse", "content": "A rift in the ice blocks the caravan’s path. There is a 50% chance that the crevasse is open and obvious, and a 50% chance that a crevasse is hidden by unstable ice or snow. If the crevasse is open, a DC 21 Security check is enough to devise a means of bypassing the crevasse. Doing so requires 1d6 hours of work + 1 hour per wagon. Casting air walk, dimension door, floating disk, fly, levitate, or shrink item grants a +1 bonus on this check per spell or effect. The caravan can make this check as many times as necessary, with the same expenditure of time for each check. If the crevasse is hidden, the caravan must succeed at a DC 23 Security check to detect the hazardous terrain before the caravan blunders into it. If the check is successful, the caravan can bypass the crevasse as outlined above. On a failed check, the unstable ice collapses under part of the caravan. If the caravan fails the check by 4 or less, one random wagon falls into the crevasse, and the caravan takes 4d6 points of damage. If the caravan fails the check by 5 or more, it takes 8d6 points of damage. Extricating a wagon from the crevasse follows the same rules as bypassing an open crevasse, but uses 1 cargo unit of repair materials per check. Alternatively, the caravan can simply abandon the trapped wagon and continue on at normal speed. XP Award: Award the PCs 2,400 XP for an open crevasse, or 4,800 XP for a hidden crevasse." });
varisiaArray.push({"max": 130, "name": "Polar Mirage", "content": "The caravan drivers and guides become obsessed with a mirage of a landmark and diverge from their course. The caravan must make a DC 23 Resolve check to realize they are chasing a mirage. This check can be made multiple times, but the caravan wastes 1d6 hours of travel time going the wrong way for each failed check. On a successful check, the caravan realizes the error but must make a DC 23 Security check to find the proper course again (+2 to the DC for each failed Resolve check). On a failed Security check, the caravan becomes further lost, wasting another 1d4 hours. XP AWARD: Award the PCs 4,800 XP for encountering a polar mirage." });
varisiaArray.push({"max": 135, "name": "Black Slush", "content": "The caravan encounters a wide area of tainted snow and polluted eff luent. This acts as an open Crevasse encounter (see page 12), though casting water walk grants a +2 bonus on Security checks to cross the area. In addition, the caravan must make a DC 23 Security check once per hour while crossing or become poisoned by the toxic slurry, taking a cumulative –1 penalty to AC and on Attack checks for each failed check. These penalties can be removed with a successful DC 23 Security check when the caravan rests. Each healer in the caravan grants a cumulative +1 bonus on this check, and each casting of neutralize poison grants a +2 bonus on the check. Creatures: In addition, there is a 50% chance that an area of black slush is the hunting ground of a mated pair of chardas, xenophobic monstrous humanoids from the depths of the earth, who attack the caravan (AC 23; hp 115; Attack +18; Damage 8d8+4). The chardas can be avoided with two successful DC 19 Security checks. The chardas fight to the death. Treasure: The chardas maintain a lair in an ice cave below the black slush, which can be found with a DC 25 Survival check. Inside the lair are 34 uncut diamonds (worth 100 gp each), one of which is actually an air elemental gem. XP Award: Award the PCs 3,200 XP for a black slush encounter, and an additional 6,400 XP if they defeat the mated pair of chardas." });
varisiaArray.push({"max": 140, "name": "Auroral Flight", "content": "50% CHANCE OF OCCURING WHILE THE CARAVAN IS CAMPED. CREATURE: The caravan sees a strange, blue-green light on the northern horizon, sometimes streaking at high speed in straight lines, and at other times soaring in broad circles. This is a boreal yrthak, a f lying reptile that has adapted to life in the cold skies above the frozen wastes of the Crown of the World. The caravan can make a DC 24 Security check to avoid the boreal yrthak; otherwise, the creature notices the caravan and swoops in to attack, targeting individual creatures rather than the caravan itself." });
varisiaArray.push({"max": 145, "name": "Cold Gate", "content": "The caravan passes near an elemental gate that reduces temperatures in the surrounding region by one category (see page 63) for 1d4 days. The caravan must succeed on a DC 23 Security check every 12 hours (whether moving or resting) or take 1d6 points of damage. The caravan takes a –2 penalty to its AC and on Attack checks until these hit points are restored. Creatures: The caravan has a 25% chance of encountering a group of ice elementals each day it remains within the reduced temperature zone near a cold gate. The caravan can avoid the elementals with two successful DC 19 Security checks. The elementals are not immediately hostile, however, and have a starting attitude of indifferent. If the PCs can speak Aquan (or use tongues) and succeed at a DC 15 Diplomacy check, the ice elementals become friendly and travel with the caravan for a time, granting it a +2 bonus to AC and on Security checks for as long as the caravan remains within the cold gate’s temperature zone. If the PCs fail the Diplomacy check by 4 or less, the elementals ignore the caravan unless attacked first. If the PCs fails the check by 5 or more, the elementals become hostile and attack (AC 23; hp 115; Attack +17; Damage 8d8+4). XP Award: Award the PCs 6,400 XP for dealing with the ice elementals or defeating them in combat." });
varisiaArray.push({"max": 150, "name": "Hunting Party", "content": "50% CHANCE OF OCCURING WHILE THE CARAVAN IS CAMPED. CREATURES: Frozen undead servants of Sithhud prowl the pole, preying on whatever living creatures they can find. Eight hoarfrost spirits assault the caravan, fighting until destroyed (AC 23; hp 115; Attack +17; Damage 8d8+4). XP AWARD: Award the PCs 6,400 XP for defeating a hunting party." });
 
part 4
varisiaArray.push({"max": 250, "name": "Unoccupied", "content": "" });
varisiaArray.push({"max": 280, "name": "1d4 trappers", "content": "(also gold-panners, fur-trappers, seal-hunters, etc.) SEE DEVELOPMENT"});
varisiaArray.push({"max": 290, "name": "1 guide", "content": "SEE DEVELOPMENT"});
varisiaArray.push({"max": 295, "name": "Evidence of violent death", "content": "(broken doors or windows, corpses or bloodstains, claw marks, etc.); double the normal chance for random encounters for 1d3 days"});
varisiaArray.push({"max": 300,"name": "Monster", "content": "(the cabin contains a random encounter appropriate for the terrain; disregard any encounter too large to fit inside the cabin)"});


varisiaArray.push({"max": 425, "name": "", "content": "Dead animal remains" });
varisiaArray.push({"max": 450, "name": "", "content": "Dead human remains"});
varisiaArray.push({"max": 460, "name": "", "content": "Gang of frostfallen skeletons"});
varisiaArray.push({"max": 470, "name": "", "content": "Gang of frostfallen zombies or 2d4 hoarfrost spirits IN THE HIGH ICE, there is a 50% chance of encountering 2d4 hoarfrost spirits rather than frostfallen zombies; IN THE BOREAL EXPANSE or at a BLACK MONOLITH this chance is 100%."});
varisiaArray.push({"max": 475,"name": "", "content": "1d4 frostfallen bison"});
varisiaArray.push({"max": 480, "name": "", "content": "2d4 frost wights" });
varisiaArray.push({"max": 485, "name": "", "content": "2d4 hoarfrost spirits" });
varisiaArray.push({"max": 490, "name": "", "content": "1 frostfallen mastodon" });
varisiaArray.push({"max": 500, "name": "", "content": "1 frostfallen mastodon and 4 hoarfrost spirits" });


varisiaArray.push({"max": 650, "name": "", "content": "1 trapper SEE DEVELOPMENT" });
varisiaArray.push({"max": 660, "name": "", "content": "1d4 trappers or Snowcaster elves SEE DEVELOPMENT"});
varisiaArray.push({"max": 680, "name": "", "content": "1 guide SEE DEVELOPMENT"});
varisiaArray.push({"max": 700,"name": "", "content": "1 traveling merchant, 1 guide, and 2 trappers SEE DEVELOPMENT"});


var allArrays = {
"varisia": varisiaArray,
};

if (!rollModifier) {
rollModifier = 0;
}
var randomNum = rand(100) + rollModifier;
var arrayOfChoices = allArrays[argument];
var error = "";
if (!arrayOfChoices) {
error = "no such set: " + argument;
}

var content = "";
var name = "";
for (var itemIndex in arrayOfChoices) {
var item = arrayOfChoices[itemIndex];
if (randomNum <= item.max) {
content = item.content;
name = item.name
break;
}
}

var results = [];
if (error) {
results.name = "";
results.content = error;
} else {
results.name = name;
results.content = content;
}
return results;

}

</script>

<div id="error"></div>
<form>
<input type="button" name="Button1" value="Outer Rim" onClick="var x = tableResults('varisia', 0);this.form.name.value=x.name;this.form.content.value = x.content;" size="" />
<input name="name" style="font-weight:bold;"></input>
<textarea name="content" cols="125" rows="15" wrap="soft"></textarea>

</form>

<form>
<input type="button" name="Button2" value="High Ice" onClick="var x = tableResults('varisia', 25);this.form.name.value=x.name;this.form.content.value = x.content;" size="" />
<input name="name" style="font-weight:bold;"></input>
<textarea name="content" cols="126" rows="14" wrap="soft"></textarea>

</form>

<form>
<input type="button" name="Button3" value="Boreal Expanse" onClick="var x = tableResults('varisia', 50);this.form.name.value=x.name;this.form.content.value = x.content;" size="" />
<input name="name" style="font-weight:bold;"></input>
<textarea name="content" cols="121" rows="14" wrap="soft"></textarea>

</form>

<form>
<input type="button" name="Button4" value="Cabin Encounters" onClick="var x = tableResults('varisia', 200);this.form.name.value=x.name;this.form.content.value = x.content;" size="" />
<input name="name" style="font-weight:bold;"></input>
<textarea name="content" cols="120" rows="2" wrap="soft"></textarea>

</form>

<form>
<input type="button" name="Button5" value="Frozen Dead Encounters" onClick="var x = tableResults('varisia', 400);this.form.name.value=x.name;this.form.content.value = x.content;" size="" />
<input name="name" style="font-weight:bold;"></input>
<textarea name="content" cols="116" rows="2" wrap="soft"></textarea>

</form>


<form>
<input type="button" name="Button6" value="Wanderers Encounters" onClick="var x = tableResults('varisia', 600);this.form.name.value=x.name;this.form.content.value = x.content;" size="" />
<input name="name" style="font-weight:bold;"></input>
<textarea name="content" cols="117" rows="1" wrap="soft"></textarea>

</form>
 
for the tables that are completely seperate (300s, 400s, 500s) I would have done no modifier with a different argument... (thats what the 'argument' option was for) so you could have completely separate tables.

it looks good. you could post as a single link possibly by uploading the html as a .txt file.
 
for the tables that are completely seperate (300s, 400s, 500s) I would have done no modifier with a different argument... (thats what the 'argument' option was for) so you could have completely separate tables.

it looks good. you could post as a single link possibly by uploading the html as a .txt file.

I started to do it that way, but I thought it was cleaner this way, but as I don't write code i could be completely wrong. I like your idea of uploading it as a text file. Again that would be cleaner. Thank you for all your help.
 
Might be a nice idea to put this is some form that if you update it, you don't need to create 4 new posts every time.

Github, gist, svn, etc?

Just a suggestion.


BoomerET
 
It's a online repository for code. When we are talking abut git, svn, etc, they are different source code control systems. Each requires a little learning curve, but I think git is the best and easiest to learn. Besides, github has nicer ability to look at the code, even if you don't download git. It has nice changelog features as well.
 
It's a online repository for code. When we are talking abut git, svn, etc, they are different source code control systems. Each requires a little learning curve, but I think git is the best and easiest to learn. Besides, github has nicer ability to look at the code, even if you don't download git. It has nice changelog features as well.
I recently moved a bunch of the Pathfinder HL Community projects to GitHub and so far very happy with it. Making my life much easier! :)
 
I keep a lot of my private and public work on github. I couldn't be more happy with it. Cool to know that you're storing stuff in there, shadow.
 
Just want to say thank you very much for this code.
I used to code a long, long time ago, so I could understand
most of what you were doing here and successfully made
my own random encounter tables for Rise of the Runelords.

This has been invigorating looking at code again. :D

Again, thanks.
 
I just bought RM last night and this looks like a great idea.
Are you just putting this into a web page or is there a way to add custom code into RW?
Still making my way through the tutorials and reading all the boards, so if this is already covered, just let me know and I'll check out that thread/video.

Nevermind, I got this figured out. The tutorials/manuals had all the information once I was able to make my way through them all
 
Last edited:
Back
Top