Last active
July 23, 2017 20:54
-
-
Save victusfate/95b6079ceb124d7c0869e77b9d573c25 to your computer and use it in GitHub Desktop.
monty haul D&D 5e loot.js (for use with roll20)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on("ready", function() { | |
on("chat:message", function (msg) { | |
if (msg.type === "api" && msg.content === "!MontyHaulLoot") { | |
Loot('montyHaul',msg); | |
} | |
if (msg.type === "api" && msg.content === "!MinorLoot") { | |
Loot('minor',msg); | |
} | |
}); | |
}); | |
function ppm(msg,title,treasure) { | |
sendChat(msg.who,"&{template:default} {{name=" + title + "}} {{Treasure:=" + treasure + "}}"); | |
} | |
function IntendedUse() { | |
let d20 = Math.floor((Math.random() * 20) + 1); | |
switch (true) { | |
case (1 == d20): | |
return "Aberration: The item was created by aberrations in ancient times, possibly for the use of favored humanoid thralls . When seen from the corner of the eye, the item seems to be moving."; | |
case (2 <= d20 && d20 <= 4): | |
return "Human. The item was created during the heyday of a fallen human kingdom, or it is tied to a human of legend. It might hold writing in a forgotten tongue or symbols whose significance is lost to the ages."; | |
case (5 == d20): | |
return "Celestial. The weapon is half the normal weight and inscribed with feathered wings, suns, and other symbols of good. Fiends find the item's presence repulsive."; | |
case (6 == d20): | |
return "Dragon. This item is made from scales and talons shed by a dragon . Perhaps it incorporates precious metals and gems from the dragon 's hoard. It grows slightly warm when within 120 feet of a dragon."; | |
case (7 == d20): | |
return "Drow. The item is half the normal weig ht . It is black and inscribed with spiders and webs in honor of Lolth . It might function poorly, or disintegrate, if exposed to sunlight for 1 minute or more"; | |
case (8 <= d20 && d20 <= 9): | |
return "Dwarf. The item is durable and has Dwarven runes worked into its design. It might be associated with a clan that would like to see it returned to their ancestral halls."; | |
case (10 == d20): | |
return "Elemental Air. The ite m is half the no rmal weight and feels hollow. If it 's made of fabric, it is diaphanous."; | |
case (11 == d20): | |
return "Elemental Earth. This item might be crafted from stone. Any cloth or leather elements are studded with finely polished rock."; | |
case (12 == d20): | |
return "Elemental Fire. This item is warm to the touch, and any metal parts are crafted from black iron. Sigils of flames cover its surface. Shades of red and orange are the prominent colors"; | |
case (13 == d20): | |
return "Elemental Water. Lustrous fish scales replace leather or cloth on this item, and metal portiors are instead crafted from seashells and worked coral as hard as any metal."; | |
case (14 <= d20 && d20 <= 15): | |
return "Elf. The item is half the normal we ight. It is adorned with symbols of nature: leaves, vines, stars, and the like."; | |
case (16 == d20): | |
return "Fey. The item is exquisitely crafted from the finest materials and glows with a pale radiance - moonlight, shedding dim light in a 5-foot radius Any metal in the item is silver or mithral, rathe· than iron or steel."; | |
case (17 == d20): | |
return "Fiend. The item is made of black iron or horn inscribed with runes, and any cloth or leather components are crafted from the hide of fiends is warm to the touch and features leering faces or vile runes engraved on its surface. Celestials find the item's presence repulsive."; | |
case (18 == d20): | |
return "Giant. The item is larger than normal and was crafted by giants for use by their smaller allies"; | |
case (19 == d20): | |
return "Gnome. The item is crafted to appear ordinary and it might look worn. It could also incorporate gears and mechanical components, even if these aren't essential to the item's function."; | |
case (20 == d20): | |
return "Undead. The item incorporates imagery of dead such as bones and skulls, and it might be crafted from parts of corpses. It feels cold to the touc-"; | |
default: | |
} | |
} | |
function History() { | |
let d8 = Math.floor((Math.random() * 8) + 1); | |
switch (true) { | |
case (1 == d8): | |
return "Arcane. This item was created for an ancient order of spellcasters and bears the order's symbol."; | |
case (2 == d8): | |
return "Bane. This item was created by the foes of a particular culture or kind of creature. If the culture or creatures are still around, they might recognize the item and single out the bearer as an enemy"; | |
case (3 == d8): | |
return "Heroic. A great hero once wielded this item. Anyone who's familiar with the item's history expects great deeds from the new owner."; | |
case (4 == d8): | |
return "Ornament. The item was created to honor a special occasion . Inset gemstones , gold or platinum inlays, and gold or silver filigree adorn its surface."; | |
case (5 == d8): | |
return "Prophecy. The item features in a prophecy: its bearer is destined to play a key role in future events. Someone else who wants to play that role might try to steal the item, or someone who wants to prevent the prophecy from being fulfilled mi ght tryto kill the item's bearer."; | |
case (6 == d8): | |
return "Religious. This item was used in religious ceremonies dedicated to a particular deity. It has holy symbols worked into it. The god's followers might try to persuade its owner to donate it to a temple , steal the item for themselves, or celebrate its use by a cleric or paladin ofthe same deity."; | |
case (7 == d8): | |
return "Sinister. This item is linked to a deed of great e such as a massacre or an assassination. It might have a name or be closely associated with a villain who used it. Anyone familiar with the item's history is likely to treat it and its owner with suspicior "; | |
case (8 == d8): | |
return "Symbol of Power. This item was once used as part of royal regalia or as a badge of high office. Its former owner or that person's descendants might desire it, or someone might mistakenly assume a new owner is the item's legitimate inheritor"; | |
default: | |
} | |
} | |
function MinorPropertyLookup(d20) { | |
switch (true) { | |
case (1 == d20): | |
return "Beacon. The bearer can use a bonus action to cause the item to shed bright light in a 10-foot radius and dim light for an additional 10 feet, or to extinguish the light."; | |
case (2 == d20): | |
return "Compass. The wielder can use an action to learn which way is north."; | |
case (3 == d20): | |
return "Conscientious. When the bearer of this item contemplates or undertakes a malevolent act, the item enhances pangs of conscience."; | |
case (4 == d20): | |
return "Delver. While underground, the bearer of this item always knows the item's depth below the surface and the direction to the nearest staircase, ramp, or other path leading upward."; | |
case (5 == d20): | |
return "Gleaming. This item never gets dirty."; | |
case (6 == d20): | |
return "Guardian. The item whispers warnings to its bearer, granting a +2 bonus to initiative if the bearer isn't incapacitated."; | |
case (7 == d20): | |
return "Harmonious. Attuning to this item takes only 1 or minute."; | |
case (8 == d20): | |
return "Hidden Message. A message is hidden somewhere on the item. It might be visible only at a certain time of the year, under the light of one phase of the moon, or in a specific location."; | |
case (9 == d20): | |
return "Key. The item is used to unlock a container, chamber, vault, or other entryway."; | |
case (10 == d20): | |
return "Language. The bearer can speak and understand a language of the DM's choice while the item is on the bearer's person."; | |
case (11 == d20): | |
return "Sentinel. Choose a kind of creature that is an enemy of the item's creator. This item glows faintly when such creatures are within 120 feet of it."; | |
case (12 == d20): | |
return "Song Craft. Whenever this item is struck or is used to strike a foe , its bearer hears a fragment of an ancient song."; | |
case (13 == d20): | |
return "Strange Material. The item was created from a material that is bizarre given its purpose. Its durability is unaffected."; | |
case (14 == d20): | |
return "Temperate. The bearer suffers no harm in temperatures as cold as -20 degrees Fahrenheit or as warm as 120 degrees Fahrenheit."; | |
case (15 == d20): | |
return "Unbreakable. The item can't be broken. Special means must be used to destroy it."; | |
case (16 == d20): | |
return "War Leader. The bearer can use an action to cause his or her voice to carry clearly for up to 300 feet until the end of the bearer's next turn."; | |
case (17 == d20): | |
return "Waterborne. This item floats on water and other liquids. Its bearer has advantage on Strength (Athletics) checks to swim."; | |
case (18 == d20): | |
return "Wicked. When the bearer is presented with an opportunity to act in a selfish or malevolent way, the item heightens the bearer's urge to do so."; | |
case (19 == d20): | |
return "Illusion. The item is imbued with illusion magic, allowing its bearer to alter the item 's appearance in minor ways. Such alterations don't change how the item is worn, carried, or wielded, and they have no effect on its other magical properties. For example, the wearer could make a red robe appear blue, or make a gold ring look like it 's made of ivory. The item reverts to its true appearance when no one is carrying or wearing it."; | |
default: | |
} | |
} | |
function MinorProperties() { | |
let d20 = Math.floor((Math.random() * 20) + 1); | |
if (d20 == 20) { | |
let d19a = Math.floor((Math.random() * 19) + 1); | |
let d19b = Math.floor((Math.random() * 19) + 1); | |
while (d19a == d19b) { | |
d19b = Math.floor((Math.random() * 19) + 1); | |
} | |
return MinorPropertyLookup(d19a) + ',' + MinorPropertyLookup(d19b) | |
} | |
else { | |
return MinorPropertyLookup(d20) | |
} | |
} | |
function Quirk() { | |
let d12 = Math.floor((Math.random() * 12) + 1); | |
switch (true) { | |
case (1 == d12): | |
return "Blissful. While in possession of the item , the bearer feels fortunate and optimistic about what the future holds. Butterflies and other harmless creatures might frolic in the item's presence."; | |
case (2 == d12): | |
return "Confident. The item helps its bearer feel self- assured."; | |
case (3 == d12): | |
return "Covetous. The item 's bearer becomes obsessed with material wealth."; | |
case (4 == d12): | |
return "Frail. The item crumbles, frays , chips , or cracks slightly when wielded, worn, or activated. This quirk has no effect on its properties, but if the item has seen much use, it looks decrepit."; | |
case (5 == d12): | |
return "Hungry. This item's magical properties function only if fresh blood from a humanoid has been applied to it within the past 24 hours. It needs only a drop to activate."; | |
case (6 == d12): | |
return "Loud. The item makes a loud noise-such as a clang, a shout, or a resonating gong-when used."; | |
case (7 == d12): | |
return "Metamorphic. The item periodically and randomly alters its appearance in slight ways. The bearer has no control over these minor alterations, which have no effect on the item's use."; | |
case (8 == d12): | |
return "Muttering. The item grumbles and mutters . A creature who listens carefully to the item might learn something useful."; | |
case (9 == d12): | |
return "Painful. The bearer experiences a harmless flash of pain when using the item."; | |
case (10 == d12): | |
return "Possessive. The item demands attunement when first wielded or worn, and it doesn't allow its bearer to attune to other items. (Other items already attuned to the bearer remain so until their attunement ends.)"; | |
case (11 == d12): | |
return "Repulsive. The bearer feels a sense of distaste when in contact with the item, and continues to sense discomfort while bearing it."; | |
case (12 == d12): | |
return "Slothful. The bearer ofthis item feels slothful and lethargic. While attuned to the item, the bearer requires 10 hours to finish a long rest."; | |
default: | |
} | |
} | |
function Materials() { | |
let d100 = Math.floor((Math.random() * 100) + 1); | |
switch (true) { | |
case (0 <= d100 && d100 <= 86): | |
return "Standard"; | |
case (87 <= d100 && d100 <= 88): | |
return "Darkwood: half normal weight. If ranged weapon, 50% bonus to range categories, if a melee weapon +d8 vs item damage"; | |
case (89 <= d100 && d100 <= 90): | |
return "Deepwood: glows as torch for 1 hour after being struck"; | |
case (91 <= d100 && d100 <= 92): | |
return "Mithral: half normal weight. Weapons also count as silver for bypassing resistances. Armor functions as per the DMG. Also, as a house rule, a mithral chain shirt counts as light armor, and has no maximum dex bonus to AC."; | |
case (93 <= d100 && d100 <= 94): | |
return "Adamantine: Weapons, as per MM, and 50% chance to avoid damage to the item. Armor as per DMG."; | |
case (95 <= d100 && d100 <= 96): | |
return "Cold Iron: Armor gains +1 AC vs Demons/Fey, Weapons bypass damage resistance of demons/fey"; | |
case (97 <= d100 && d100 <= 98): | |
return "Silver: Armor gains +1 AC vs Lycanthropes/Vampires, Weapons bypass Vampire and Lycanthrope Damage Resistance"; | |
case (99 <= d100 && d100 <= 100): | |
return "Dragonscale: Armor: counts as non-metallic, grants resistance based on dragon type, Weapons are Dragonbane and add 2d6 damage vs dragons"; | |
default: | |
} | |
} | |
function Magic() { | |
let d100 = Math.floor((Math.random() * 100) + 1); | |
switch (true) { | |
case (0 <= d100 && d100 <= 29): | |
return "Standard"; | |
case (30 <= d100 && d100 <= 34): | |
return "Finely Crafted can take 2 points before suffering penalties"; | |
case (35 <= d100 && d100 <= 40): | |
return "Bejeweled - Finely Crafted, Gems worth " + 50 * Math.floor((Math.random() * 100) + 1) + 'gp'; | |
case (41 <= d100 && d100 <= 52): | |
return "Magic +1, " + MinorProperties() + '\n' + Quirk() + '\n' + IntendedUse() + '\n' + History(); | |
case (53 <= d100 && d100 <= 64): | |
return "Magic +2, " + MinorProperties() + '\n' + Quirk() + '\n' + IntendedUse() + '\n' + History(); | |
case (65 <= d100 && d100 <= 76): | |
return "Magic +2, Lucky +2 to all saves. Requires attunement, " + MinorProperties() + '\n' + Quirk() + '\n' + IntendedUse() + '\n' + History(); | |
case (77 <= d100 && d100 <= 88): | |
return "Summoning +2, and the attuned character can use a bonus action to summon it if it's within 60 feet. Requires attunement, " + MinorProperties() + '\n' + Quirk() + '\n' + IntendedUse() + '\n' + History(); | |
case (89 <= d100 && d100 <= 100): | |
return "Magic +2, Protecting +2, grants a +2 AC bonus. Requires attunement, " + MinorProperties() + '\n' + Quirk() + '\n' + IntendedUse() + '\n' + History(); | |
default: | |
} | |
} | |
function Loot(lootlevel,msg){ | |
let d100 = Math.floor((Math.random() * 100) + 1); | |
let treasure = ""; | |
if (lootlevel === "minor"){ | |
switch (true) { | |
case (0<=d100 && d100<=34): | |
treasure = "coinsMinor"; | |
break; | |
case (35<=d100 && d100<=59): | |
treasure = "advGear"; | |
break; | |
case (60<=d100 && d100<=76): | |
treasure = "weapon"; | |
break; | |
case (77<=d100 && d100<=90): | |
treasure = "armor"; | |
break; | |
case (91<=d100 && d100<=97): | |
treasure = "magItemA"; | |
break | |
case (98<=d100 && d100<=100): | |
treasure = "magItemB"; | |
break; | |
default: | |
break; | |
} | |
} | |
if (lootlevel === "montyHaul"){ | |
switch (true) { | |
case (0<=d100 && d100<=15): | |
treasure = "coinsMontyHaul"; | |
break; | |
case (16<=d100 && d100<=25): | |
treasure = "weapon"; | |
break; | |
case (26<=d100 && d100<=35): | |
treasure = "armor"; | |
break; | |
case (36<=d100 && d100<=40): | |
treasure = "magItemA"; | |
break | |
case (41<=d100 && d100<=45): | |
treasure = "magItemB"; | |
break; | |
case (46<=d100 && d100<=50): | |
treasure = "magItemC"; | |
break; | |
case (51<=d100 && d100<=55): | |
treasure = "magItemD"; | |
break; | |
case (56<=d100 && d100<=60): | |
treasure = "magItemE"; | |
break; | |
case (61<=d100 && d100<=70): | |
treasure = "magItemF"; | |
break; | |
case (71<=d100 && d100<=80): | |
treasure = "magItemG"; | |
break; | |
case (81<=d100 && d100<=90): | |
treasure = "magItemH"; | |
break; | |
case (91<=d100 && d100<=100): | |
treasure = "magItemI"; | |
break; | |
default: | |
break; | |
} | |
} | |
if (treasure === "coinsMinor"){ | |
Coins('minor',msg); | |
} | |
if (treasure === "coinsMontyHaul"){ | |
Coins('montyHaul',msg); | |
} | |
if (treasure === "advGear"){ | |
advGear(msg); | |
} | |
if (treasure === "weapon"){ | |
Weapon(msg); | |
} | |
if (treasure === "armor"){ | |
Armor(msg); | |
} | |
if (treasure === "magItemA"){ | |
MagItemA(msg); | |
} | |
if (treasure === "magItemB"){ | |
MagItemB(msg); | |
} | |
if (treasure === "magItemC"){ | |
MagItemC(msg); | |
} | |
if (treasure === "magItemD"){ | |
MagItemD(msg); | |
} | |
if (treasure === "magItemE"){ | |
MagItemE(msg); | |
} | |
if (treasure === "magItemF"){ | |
MagItemF(msg); | |
} | |
if (treasure === "magItemG"){ | |
MagItemG(msg); | |
} | |
if (treasure === "magItemH"){ | |
MagItemH(msg); | |
} | |
} | |
function Coins(lootlevel,msg){ | |
let coinMag; | |
let CP = 0; | |
let SP = 0; | |
let EP = 0; | |
let GP = 0; | |
let PP = 0; | |
let Gems = 0; | |
if (lootlevel === "minor"){ | |
coinMag = 1; | |
} | |
else if (lootlevel === "montyHaul"){ | |
coinMag = 10; | |
} | |
let noCoins = true; | |
let noGems = true; | |
let d100; //= Math.floor((Math.random() * 100) + 1); | |
let d6; //= Math.floor((Math.random() * 6) + 1); | |
do { | |
d100 = Math.floor((Math.random() * 100) + 1); | |
if (d100 > 70){ | |
for (i = 0; i < 5*coinMag; i++) { | |
d6 = Math.floor((Math.random() * 6) + 1); | |
CP += d6; | |
} | |
noCoins = false; | |
} | |
d100 = Math.floor((Math.random() * 100) + 1); | |
if (d100 > 70){ | |
for (i = 0; i < 4*coinMag; i++) { | |
d6 = Math.floor((Math.random() * 6) + 1); | |
SP += d6; | |
} | |
noCoins = false; | |
} | |
d100 = Math.floor((Math.random() * 100) + 1); | |
if (d100 > 94){ | |
for (i = 0; i < 3*coinMag; i++) { | |
d6 = Math.floor((Math.random() * 6) + 1); | |
EP += d6; | |
} | |
noCoins = false; | |
} | |
d100 = Math.floor((Math.random() * 100) + 1); | |
if (d100 > 80){ | |
for (i = 0; i < 3*coinMag; i++) { | |
d6 = Math.floor((Math.random() * 6) + 1); | |
GP += d6; | |
} | |
noCoins = false; | |
} | |
d100 = Math.floor((Math.random() * 100) + 1); | |
if (d100 > 96){ | |
for (i = 0; i < 1*coinMag; i++) { | |
d6 = Math.floor((Math.random() * 6) + 1); | |
PP += d6; | |
} | |
noCoins = false; | |
} | |
d100 = Math.floor((Math.random() * 100) + 1); | |
if (d100 > 90){ | |
d3 = Math.floor((Math.random() * 3) + 1); | |
Gems = 1*d3 | |
noCoins = false; | |
noGems = false; | |
} | |
} | |
while (noCoins === true); | |
// sendChat(msg.who, "/em You found some coins!"); | |
// sendChat(msg.who, "/em CP: " + CP); | |
// sendChat(msg.who, "/em SP: " + SP); | |
// sendChat(msg.who, "/em EP: " + EP); | |
// sendChat(msg.who, "/em GP: " + GP); | |
// sendChat(msg.who, "/em PP: " + PP); | |
let aCoins = []; | |
if (CP > 0) { | |
aCoins.push('CP: ' + CP); | |
} | |
if (SP > 0) { | |
aCoins.push('SP: ' + SP); | |
} | |
if (EP > 0) { | |
aCoins.push('EP: ' + EP); | |
} | |
if (GP > 0) { | |
aCoins.push('GP: ' + GP); | |
} | |
if (PP > 0) { | |
aCoins.push('PP: ' + PP); | |
} | |
ppm(msg,"You found some coins!","" + aCoins.join(", ")); | |
if (lootlevel === "minor"){ | |
ppm(msg,"10 GP Gems",Gems); | |
//10 gp gemtype | |
} | |
else if (lootlevel === "montyHaul"){ | |
ppm(msg, "50 GP Gems",Gems); | |
//50 gp gemtype | |
} | |
} | |
function advGear(msg){ | |
let aGear = ["Abacus", "Acid Vial", "Alchimists Fire Flask", "Ammunition", "20 Arrows", "50 Blowgun Needles", "20 Crossbow Bolts", "20 Sling Bullets", | |
"Antitoxin Vial", "Arcane Focus Crystal", "Arcane Focus Orb", "Arcane Focus Rod", "Arcane Focus Staff", "Arcane Focus Wand", "Backpack", | |
"Ball Bearings (1000)", "Barrel", "Basket", "Bedroll", "Bell", "Blanket", "Block and tackle", "Book", "Glass Bottle", "Bucket", "Caltrops (20)", | |
"Candle", "Case (crossbow bolt)", "Case (map or scroll)", "Chaint (10 feet)", "Chalk (1 piece)", "Chest", "Climber's Kit", "Common Clothes", | |
"Costume Clothes", "Fine Clothes", "Traveler's Clothes", "Component pouch", "Crowbar", "Druidic Focus Sprig of Mistletoe", | |
"Druidic Focus Totem", "Druidic Focus Wooden Staff", "Druidic Focus Yew Wand", "Fishing Tackle", "Flask or tankard", "Grappling hook", | |
"Hammer", "Hammer (sledge)", "Healer's Kit", "Holy Symbol Amulet", "Holy Symbol Emblem", "Holy Symbol Reliquary", "Holy Water Flask", | |
"Hourglass", "Hunting trap", "Ink (1 ounce bottle)", "Ink pen", "Jug or pitcher", "Ladder (10 foot)", "Lamp", "Lantern Bullseye", | |
"Lantern Hooded", "Lock", "Magnifying Glass", "Manacles", "Mess Kit", "Steel Mirror", "Oil Flask", "Paper Sheet", "Parchment Sheet", | |
"Perfume Vial", "10 foot Pole", "Miner's Pick", "Piton", "Basic poison vial", "Iron pot", "Potion of healing", "Pouch", "Quiver", "Portable Ram", | |
"1 day's rations", "Robes", "Hempen Rope (50 ft)", "Silk Rope (50 ft)", "Sack", "Merchant's Scale", "Sealing Wax", "Shovel", "Signal Whistle", | |
"Signet ring", "Soap", "Spellbook", "Iron Spikes (10)", "Spyglass", "Two person tent", "Tinderbox", "Torch", "Vial", "Waterskin", "Whetstone"]; | |
//let aGearLength = 100; | |
let aGearLength = aGear.length; | |
let Gear = aGear[Math.floor((Math.random() * aGearLength))]; | |
ppm(msg,"You found some adventuring gear!",Gear); | |
} | |
function Weapon(msg){ | |
let aWeapons = ["Club", "Dagger", "Greatclub", "Handaxe", "Javelin", "Light Hammer", "Mace", "Quarterstaff", "Sickle", "Spear", "Light Crossbow", | |
"Dart", "Shortbow", "Sling", "Battleaxe", "Flail", "Glaive", "Greataxe", "Greatsword", "Halberd", "Lance", "Longsword", "Maul", "Morningstar", | |
"Pike", "Rapier", "Scimitar", "Shortsword", "Trident", "War Pick", "Warhammer", "Whip", "Blowgun", "Hand Crossbow", "Heavy Crossbow", "Longbow", | |
"Net"]; | |
let aWeaponsLength = aWeapons.length; | |
let weapon = aWeapons[Math.floor((Math.random() * aWeaponsLength))]; | |
ppm(msg,"You found a weapon!",weapon + ' material: ' + Materials() + ' mundane/magic: ' + Magic()) | |
} | |
function Armor(msg){ | |
let aArmors = ["Padded Armor", "Padded Armor", "Padded Armor", "Leather Armor","Leather Armor","Leather Armor","Leather Armor", | |
"Leather Armor","Studded Leather Armor","Studded Leather Armor","Studded Leather Armor","Studded Leather Armor","Hide Armor", "Hide Armor", | |
"Hide Armor", "Chain Shirt","Chain Shirt", "Scale Mail","Scale Mail","Scale Mail","Breastplate", "Breastplate", "Half Plate", "Ring Mail", | |
"Ring Mail","Ring Mail", "Chain Mail","Chain Mail","Splint Armor", "Plate Armor", "Shield","Shield","Shield","Shield",]; | |
let aArmorsLength = aArmors.length; | |
let armor = aArmors[Math.floor((Math.random() * aArmorsLength))]; | |
ppm(msg,"You found armor!",armor + ' material: ' + Materials() + ' mundane/magic: ' + Magic()) | |
} | |
function MagItemA(msg){ | |
let d100 = Math.floor((Math.random() * 100) + 1); | |
let treasure = ""; | |
if (d100 <= 50){ | |
treasure = "Potion of healing"; | |
} | |
else if (51<= d100 && d100 <= 60){ | |
treasure = "Spell Scroll Cantrip"; | |
} | |
else if (61 <= d100 && d100 <= 70){ | |
treasure = "Potion of climbing"; | |
} | |
else if (71 <= d100 && d100 <= 90){ | |
treasure = "Spell Scroll Level 1"; | |
} | |
else if (91 <= d100 && d100 <= 94){ | |
treasure = "Spell Scroll Level 2"; | |
} | |
else if (95 <= d100 && d100 <= 98){ | |
treasure = "Potion of greater healing"; | |
} | |
else if (d100 === 99){ | |
treasure = "Bag of Holding"; | |
} | |
else if (d100 === 100){ | |
treasure = "Driftglobe"; | |
} | |
ppm(msg,"You found a magic item!",treasure); | |
} | |
function MagItemB(msg){ | |
let d100 = Math.floor((Math.random() * 100) + 1); | |
let treasure = ""; | |
if (d100 <= 15){ | |
treasure = "Potion of greater healing"; | |
} | |
else if (16 <= d100 && d100 <= 22){ | |
treasure = "Potion of Fire Breath"; | |
} | |
else if (23 <= d100 && d100 <= 29){ | |
treasure = "Potion of resistance"; | |
} | |
else if (30 <= d100 && d100 <= 34){ | |
treasure = "Ammunition +1"; | |
} | |
else if (35 <= d100 && d100 <= 39){ | |
treasure = "Potion of Animal Friendship"; | |
} | |
else if (40 <= d100 && d100 <= 44){ | |
treasure = "Potion of hill giant strength"; | |
} | |
else if (45 <= d100 && d100 <= 49){ | |
treasure = "Potion of growth"; | |
} | |
else if (50 <= d100 && d100 <= 54){ | |
treasure = "Potion of water breathing"; | |
} | |
else if (55 <= d100 && d100 <= 59){ | |
treasure = "Spell Scroll Level 2"; | |
} | |
else if (60 <= d100 && d100 <= 64){ | |
treasure = "Spell Scroll Level 3"; | |
} | |
else if (65 <= d100 && d100 <= 67){ | |
treasure = "Bag of Holding"; | |
} | |
else if (68 <= d100 && d100 <= 70){ | |
treasure = "Keoghtom's ointment"; | |
} | |
else if (71 <= d100 && d100 <= 73){ | |
treasure = "Oil of slipperiness"; | |
} | |
else if (74 <= d100 && d100 <= 75){ | |
treasure = "Dust of disappearance"; | |
} | |
else if (76 <= d100 && d100 <= 77){ | |
treasure = "Dust of dryness"; | |
} | |
else if (78 <= d100 && d100 <= 79){ | |
treasure = "Dust of sneazing and choking"; | |
} | |
else if (80 <= d100 && d100 <= 81){ | |
treasure = "Elemental gem"; | |
} | |
else if (82 <= d100 && d100 <= 83){ | |
treasure = "Philter of love"; | |
} | |
else if (d100 === 84){ | |
treasure = "Alchemy Jug"; | |
} | |
else if (d100 === 85){ | |
treasure = "Cap of water breathing"; | |
} | |
else if (d100 === 86){ | |
treasure = "Cloak of the manta ray"; | |
} | |
else if (d100 === 87){ | |
treasure = "Driftglobe"; | |
} | |
else if (d100 === 88){ | |
treasure = "Goggles of night"; | |
} | |
else if (d100 === 89){ | |
treasure = "Helm of comprehend languages"; | |
} | |
else if (d100 === 90){ | |
treasure = "Immovable rod"; | |
} | |
else if (d100 === 91){ | |
treasure = "Lantern of revealing"; | |
} | |
else if (d100 === 92){ | |
treasure = "Mariner's Armor"; | |
} | |
else if (d100 === 93){ | |
treasure = "Mithral armor"; | |
} | |
else if (d100 === 94){ | |
treasure = "Potion of healing"; | |
sendChat("", "/w gm actually potion of poison"); | |
} | |
else if (d100 === 95){ | |
treasure = "Ring of swimming"; | |
} | |
else if (d100 === 96){ | |
treasure = "Robe of useful items"; | |
} | |
else if (d100 === 97){ | |
treasure = "Rope of climbing"; | |
} | |
else if (d100 === 98){ | |
treasure = "Saddle of the cavalier"; | |
} | |
else if (d100 === 99){ | |
treasure = "Wand of magic detection"; | |
} | |
else if (d100 === 100){ | |
treasure = "Wand of secrets"; | |
} | |
ppm(msg,"You found a magic item!",treasure); | |
} | |
function MagItemC(msg){ | |
let d100 = Math.floor((Math.random() * 100) + 1); | |
let treasure = ""; | |
if (d100 <= 15){ | |
treasure = "Potion of superior healing"; | |
} | |
else if (16 <= d100 && d100 <= 22){ | |
treasure = "Spell Scroll Level 4"; | |
} | |
else if (23<= d100 && d100 <=27){ | |
treasure = "Ammunition +2"; | |
} | |
else if (28<= d100 && d100 <=32){ | |
treasure = "Potion of clairvoyance"; | |
} | |
else if (33<= d100 && d100 <=37){ | |
treasure = "Potion of diminution"; | |
} | |
else if (38<= d100 && d100 <=42){ | |
treasure = "Potion of gaseous form"; | |
} | |
else if (43<= d100 && d100 <=47){ | |
treasure = "Potion of frost giant strength"; | |
} | |
else if (48<= d100 && d100 <=52){ | |
treasure = "Potion of stone giant strength"; | |
} | |
else if (53<= d100 && d100 <=57){ | |
treasure = "Potion of heroism"; | |
} | |
else if (58<= d100 && d100 <=62){ | |
treasure = "Potion of invulnerability"; | |
} | |
else if (63<= d100 && d100 <=67){ | |
treasure = "Potion of mind reading"; | |
} | |
else if (68<= d100 && d100 <=72){ | |
treasure = "Spell Scroll Level 5"; | |
} | |
else if (73<= d100 && d100 <=75){ | |
treasure = "Elixir of health"; | |
} | |
else if (76<= d100 && d100 <=78){ | |
treasure = "Oil of etherealness"; | |
} | |
else if (79<= d100 && d100 <=81){ | |
treasure = "Potion of fire giant strength"; | |
} | |
else if (82<= d100 && d100 <=84){ | |
treasure = "Quall's feather token"; | |
} | |
else if (85<= d100 && d100 <=87){ | |
treasure = "Scroll of protection"; | |
} | |
else if (88<= d100 && d100 <=89){ | |
treasure = "Bag of beans"; | |
} | |
else if (90<= d100 && d100 <=91){ | |
treasure = "Bead of force"; | |
} | |
else if (d100 ===92){ | |
treasure = "Chime of opening"; | |
} | |
else if (d100 === 93){ | |
treasure = "Decanter of endless water"; | |
} | |
else if (d100 === 94){ | |
treasure = "Eyes of minute seeing"; | |
} | |
else if (d100 === 95){ | |
treasure = "Folding boat"; | |
} | |
else if (d100 ===96 ){ | |
treasure = "Heward's handy haversack"; | |
} | |
else if (d100 ===97 ){ | |
treasure = "Horseshoes of speed"; | |
} | |
else if (d100 ===98 ){ | |
treasure = "Necklace of fireballs"; | |
} | |
else if (d100 ===99 ){ | |
treasure = "Periapt of health"; | |
} | |
else if (d100 ===100 ){ | |
treasure = "Sending stones"; | |
} | |
ppm(msg,"You found a magic item!",treasure); | |
} | |
function MagItemD(msg){ | |
let d100 = Math.floor((Math.random() * 100) + 1); | |
let treasure = ""; | |
if (d100 <=20){ | |
treasure = "Potion of supreme healing"; | |
} | |
else if (21<= d100 && d100 <=30){ | |
treasure = "Potion of invisibility"; | |
} | |
else if (31<= d100 && d100 <=40){ | |
treasure = "Potion of speed"; | |
} | |
else if (41<= d100 && d100 <=50){ | |
treasure = "Spell Scroll Level 6"; | |
} | |
else if (51<= d100 && d100 <=57){ | |
treasure = "Spell Scroll Level 7"; | |
} | |
else if (58<= d100 && d100 <=62){ | |
treasure = "Ammunition + 3"; | |
} | |
else if (63<= d100 && d100 <=67){ | |
treasure = "Oil of Sharpness"; | |
} | |
else if (68<= d100 && d100 <=72){ | |
treasure = "Potion of Flying"; | |
} | |
else if (73<= d100 && d100 <=77){ | |
treasure = "Potion of Cloud Giant Strength"; | |
} | |
else if (78<= d100 && d100 <=82){ | |
treasure = "Potion of Longevity"; | |
} | |
else if (83<= d100 && d100 <=87){ | |
treasure = "Potion of vitality"; | |
} | |
else if (88<= d100 && d100 <=92){ | |
treasure = "Spell Scroll Level 8"; | |
} | |
else if (93<= d100 && d100 <=95){ | |
treasure = "Horseshoes of the zephyr"; | |
} | |
else if (96<= d100 && d100 <=98){ | |
treasure = "Nolzur's Marvelous Pigments"; | |
} | |
else if (d100 ===99){ | |
treasure = "Bag of holding"; | |
sendChat(msg.who, "/w gm actually bag of devouring"); | |
} | |
else if (d100 ===100){ | |
treasure = "Portable hole"; | |
} | |
ppm(msg,"You found a magic item!",treasure); | |
} | |
function MagItemE(msg){ | |
let d100 = Math.floor((Math.random() * 100) + 1); | |
let treasure = ""; | |
if (d100 <=30){ | |
treasure = "Spell Scroll Level 8"; | |
} | |
else if (31<= d100 && d100 <=55){ | |
treasure = "Potion of storm giant strength"; | |
} | |
else if (56<= d100 && d100 <=70){ | |
treasure = "Potion of supreme healing"; | |
} | |
else if (71<= d100 && d100 <=85){ | |
treasure = "Spell Scroll Level 9"; | |
} | |
else if (86<= d100 && d100 <=93){ | |
treasure = "Universal solvent"; | |
} | |
else if (94<= d100 && d100 <=98){ | |
treasure = "Arrow of slaying"; | |
} | |
else if (99<= d100 && d100 <=100){ | |
treasure = "Sovereign glue"; | |
} | |
ppm(msg,"You found a magic item!",treasure); | |
} | |
function MagItemF(msg){ | |
let d100 = Math.floor((Math.random() * 100) + 1); | |
let treasure = ""; | |
if (d100 <=15){ | |
treasure = "Weapon +1 " + ' material: ' + Materials() + ' additional magic: ' + Magic(); | |
} | |
else if (16<= d100 && d100 <=18){ | |
treasure = "Shield +1 " + ' material: ' + Materials() + ' additional magic: ' + Magic(); | |
} | |
else if (19<= d100 && d100 <=21){ | |
treasure = "Sentinel Shield"; | |
} | |
else if (22<= d100 && d100 <=23){ | |
treasure = "Amulet of proof against detection and location"; | |
} | |
else if (24<= d100 && d100 <=25){ | |
treasure = "Boots of elvenkind"; | |
} | |
else if (26<= d100 && d100 <=27){ | |
treasure = "Boots of striding and springing"; | |
} | |
else if (28<= d100 && d100 <=29){ | |
treasure = "Bracers of archery"; | |
} | |
else if (30<= d100 && d100 <=31){ | |
treasure = "Brooch of shielding"; | |
} | |
else if (32<= d100 && d100 <=33){ | |
treasure = "Broom of flying"; | |
} | |
else if (34<= d100 && d100 <=35){ | |
treasure = "Cloak of elvenkind"; | |
} | |
else if (36<= d100 && d100 <=37){ | |
treasure = "Cloak of protection"; | |
} | |
else if (38<= d100 && d100 <=39){ | |
treasure = "Gauntlets of ogre power"; | |
} | |
else if (40<= d100 && d100 <=41){ | |
treasure = "Hat of disguise"; | |
} | |
else if (42<= d100 && d100 <=43){ | |
treasure = "Javelin of lightning"; | |
} | |
else if (44<= d100 && d100 <=45){ | |
treasure = "Pearl of power"; | |
} | |
else if (46<= d100 && d100 <=47){ | |
treasure = "Rod of the pact keeper + 1"; | |
} | |
else if (48<= d100 && d100 <=49){ | |
treasure = "Slippers of spider climbing"; | |
} | |
else if (50<= d100 && d100 <=51){ | |
treasure = "Staff of the adder"; | |
} | |
else if (52<= d100 && d100 <=53){ | |
treasure = "Staff of the python"; | |
} | |
else if (54<= d100 && d100 <=55){ | |
treasure = "Sword of wounding"; | |
sendChat(msg.who, "/w gm actually a sword of vengeance"); | |
} | |
else if (56<= d100 && d100 <=57){ | |
treasure = "Trident of fish command"; | |
} | |
else if (58<= d100 && d100 <=59){ | |
treasure = "Wand of magic missiles"; | |
} | |
else if (60<= d100 && d100 <=61){ | |
treasure = "Wand of the war mage +1"; | |
} | |
else if (62<= d100 && d100 <=63){ | |
treasure = "Wand of Web"; | |
} | |
else if (64<= d100 && d100 <=65){ | |
treasure = "Weapon of warning"; | |
} | |
else if (d100 ===66){ | |
treasure = "Adamantine Chain Mail"; | |
} | |
else if (d100 ===67){ | |
treasure = "Adamantine Chain Shirt"; | |
} | |
else if (d100 ===68){ | |
treasure = "Adamantine Scale Mail"; | |
} | |
else if (d100 ===69){ | |
treasure = "Bag of Tricks (Gray)"; | |
} | |
else if (d100 ===70){ | |
treasure = "Bag of tricks (Rust)"; | |
} | |
else if (d100 ===71){ | |
treasure = "Bag of Tricks (Tan)"; | |
} | |
else if (d100 ===72){ | |
treasure = "Boots of the Winterlands"; | |
} | |
else if (d100 ===73){ | |
treasure = "Circlet of blasting"; | |
} | |
else if (d100 ===74){ | |
treasure = "Deck of illusions"; | |
} | |
else if (d100 ===75){ | |
treasure = "Eversmoking bottle"; | |
} | |
else if (d100 ===76){ | |
treasure = "Eyes of charming"; | |
} | |
else if (d100 ===77){ | |
treasure = "Eyes of the eagle"; | |
} | |
else if (d100 ===78){ | |
treasure = "Figuring of wonderous power (silver raven)"; | |
} | |
else if (d100 ===79){ | |
treasure = "Gem of brightness"; | |
} | |
else if (d100 ===80){ | |
treasure = "Gloves of missile snaring"; | |
} | |
else if (d100 ===81){ | |
treasure = "Gloves of swimming and climbing"; | |
} | |
else if (d100 ===82){ | |
treasure = "Gloves of thievery"; | |
} | |
else if (d100 ===83){ | |
treasure = "Headband of intellect"; | |
} | |
else if (d100 ===84){ | |
treasure = "Helm of telepathy"; | |
} | |
else if (d100 ===85){ | |
treasure = "Instument of the bards (Doss Lute)"; | |
} | |
else if (d100 ===86){ | |
treasure = "Instument of the bards (Fochlucan bandore)"; | |
} | |
else if (d100 ===87){ | |
treasure = "Instument of the bards (Mac-Fuimidh cittern)"; | |
} | |
else if (d100 ===88){ | |
treasure = "Medallion of thoughts"; | |
} | |
else if (d100 ===89){ | |
treasure = "Necklace of adaptation"; | |
} | |
else if (d100 ===90){ | |
treasure = "Periapt of wound closure"; | |
} | |
else if (d100 ===91){ | |
treasure = "Pipes of haunting"; | |
} | |
else if (d100 ===92){ | |
treasure = "Pipes of the sewers"; | |
} | |
else if (d100 ===93){ | |
treasure = "Ring of jumping"; | |
} | |
else if (d100 ===94){ | |
treasure = "Ring of mind shielding"; | |
} | |
else if (d100 ===95){ | |
treasure = "Ring of warmth"; | |
} | |
else if (d100 ===96){ | |
treasure = "Ring of water walking"; | |
} | |
else if (d100 ===97){ | |
treasure = "Quiver of Ehlonna"; | |
} | |
else if (d100 ===98){ | |
treasure = "Stone of good luck"; | |
} | |
else if (d100 ===99){ | |
treasure = "Wind fan"; | |
} | |
else if (d100 ===100){ | |
treasure = "Winged boots"; | |
} | |
ppm(msg,"You found a magic item!",treasure); | |
} | |
function MagItemG(msg){ | |
const Figurine = [ | |
'Bronze griffon', | |
'Ebony fly', | |
'Golden lions', | |
'Ivory goats', | |
'Marble elephant', | |
'Onyx dog', | |
'Onyx dog', | |
'Serpentine Owl' | |
] | |
const TableG = [ | |
'Weapon +2, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +2, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +2, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +2, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +2, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +2, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +2, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +2, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +2, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +2, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +2, material: ' + Materials() + ' additional magic: ' + Magic(), | |
Figurine[Math.floor((Math.random() * 8))], | |
Figurine[Math.floor((Math.random() * 8))], | |
Figurine[Math.floor((Math.random() * 8))], | |
'Adamantine armor (breastplate), additional magic: ' + Magic(), | |
'Adamantine armor (splint), additional magic: ' + Magic(), | |
'Amulet of health', | |
'Armor of Invulnerability', // lies | |
'Arrow-catching shield', | |
'Belt of dwarvenkind', | |
'Belt of hill giant strength', | |
'Berserker axe', | |
'Boots of levitation', | |
'Boots of speed', | |
'Bowl of commanding water elementals', | |
'Bracers of defense', | |
'Brazier of commanding fire elementals', | |
'Cape of mountebank', | |
'Censer of controlling air elementals', | |
'Armor, +1 chain mail, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor of resistance (chain mail), material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor, +1 chain shirt, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor of resistance (chain shirt), material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Cloak of displacement', | |
'Cloak of the bat', | |
'Cube of force', | |
"Daern's instant fortress", | |
'Dagger of venom', | |
'Dimensional shackles', | |
'Dragon slayer material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Elven chain, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Flame tongue, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Gem of seeing', | |
'Giant slayer, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Glamoured studded leather', | |
'Helm of teleportation', | |
'Horn of blasting', | |
'Horn of Valhalla (silver or brass)', | |
'Instrument of the bards (Canaith Mandolin)', | |
'Instrument of the bards (Cli lyre)', | |
'Ioun stone (awareness)', | |
'Ioun stone (protection)', | |
'Ioun stone (reserve)', | |
'Ioun stone (sustenance)', | |
'Iron bands of Bilarro', | |
'Armor, +1 leather, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor of resistance (leather), material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Mace of disruption, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Mace of smiting, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Mace of terror, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Mante of spell resistance', | |
'Necklace of prayer beads', | |
'Periapt of proof against poison', | |
'Ring of animal influence', | |
'Ring of evasion', | |
'Ring of feather falling', | |
'Ring of free action', | |
'Ring of protection', | |
'Ring of resistance', | |
'Ring of spell storing', | |
'Ring of the ram', | |
'Ring of X-ray vision', | |
'Robe of eyes', | |
'Rod of rulership', | |
'Rod of the pact keeper +2, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Rope of entanglement', | |
'Armor, +1 scale mail, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor of resistance (scale mail), material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Shield +2, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Arrow-catching shield', // hehe | |
'Staff of charming', | |
'Staff of healing', | |
'Staff of swarming insects', | |
'Staff of the woodlands', | |
'Staff of withering', | |
'Stone of controlling earth elementals', | |
'Sun blade', | |
'Sword of life stealing, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Sword of wounding, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Tentacle rod, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Vicious weapon, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Wand of blinding', | |
'Wand of enemy detection', | |
'Wand of fear', | |
'Wand of fireballs', | |
'Wand of lightning bolts', | |
'Wand of paralysis', | |
'Wand of the war mage +2, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Wand of wonder', | |
'Wings of flying' | |
] | |
let d100 = Math.floor((Math.random() * 100)); | |
if (d100 == 17) { | |
sendChat(msg.who, "/w gm actually armor of vulnerability"); | |
} | |
else if (d100 == 79) { | |
sendChat(msg.who, "/w gm actually shield of missile attraction"); | |
} | |
let treasure = TableG[d100]; | |
ppm(msg,"You found a magic item!",treasure); | |
} | |
function MagItemH(msg){ | |
const TableH = [ | |
'Weapon +3, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +3, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +3, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +3, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +3, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +3, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +3, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +3, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +3, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Weapon +3, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Amulet of the planes', | |
'Amulet of the planes', | |
'Carpet of flying', | |
'Carpet of flying', | |
'Crystal ball (very rare version)', | |
'Crystal ball (very rare version)', | |
'Ring of rengeneration, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Ring of rengeneration, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Ring of shooting stars, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Ring of shooting stars, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Ring of telekinesis, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Ring of telekinesis, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Robe of scintillating colors', | |
'Robe of scintillating colors', | |
'Robe of stars', | |
'Robe of stars', | |
'Rod of absorption', | |
'Rod of absorption', | |
'Rod of alertness', | |
'Rod of alertness', | |
'Rod of security', | |
'Rod of security', | |
'Rod of the pact keeper +3, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Rod of the pact keeper +3, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Scimitar of speed', | |
'Scimitar of speed', | |
'Shield +3, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Shield +3, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Staff of fire', | |
'Staff of fire', | |
'Staff of frost', | |
'Staff of frost', | |
'Staff of power', | |
'Staff of power', | |
'Staff of striking, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Staff of striking, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Staff of thunder and lightning', | |
'Staff of thunder and lightning', | |
'Sword of sharpness, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Sword of sharpness, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Wand of polymorph', | |
'Wand of polymorph', | |
'Wand of the war mage +3, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Wand of the war mage +3, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Adamantine armor (half plate), material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Adamantine armor (plate), material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Animated shield, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Belt of fire giant strength', | |
'Belt of frost giant strength', | |
'Armor +1 breastplate, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor of resistance (breastplate), material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Candle of invocation', | |
'Armor +2 chain mail, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +2 chain shirt, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Cloak of arachnida', | |
'Dancing sword, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Demon armor, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Dragon scale mail, additional magic: ' + Magic(), | |
'Dwarven plate, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Dwarven thrower, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Efreeti bottle', | |
'Figurine of wondrous power (obsidian steed)', | |
'Frost brand, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Helm of brilliance', | |
'Horn of Valhalla (bronze)', | |
'Instrument of the bards (Anstruth harp)', | |
'Ioun stone (absorption)', | |
'Ioun stone (agility)', | |
'Ioun stone (fortitude)', | |
'Ioun stone (insight)', | |
'Ioun stone (intellect)', | |
'Ioun stone (leadership)', | |
'Ioun stone (strength)', | |
'Armor +2 leather, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Manual of bodily health', | |
'Manual of gainful exercise', | |
'Manual of golems', | |
'Manual of quickness of action', | |
'Well of Many Worlds', | |
'Nine lives stealer, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Oathbow, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +2 scale mail, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Spellguard shield, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor, +1 splint, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor of resistance (splint), material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +1 studded leather, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor of resistance (studded leather), material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Tome of clear thought', | |
'Tome of leadership and influence', | |
'Tome of understanding' | |
] | |
let d100 = Math.floor((Math.random() * 100)); | |
if (d100 == 88) { | |
sendChat(msg.who, "/w gm Mirror of life trapping"); | |
} | |
let treasure = TableH[d100]; | |
ppm(msg,"You found a magic item!",treasure); | |
} | |
function MagItemI(msg){ | |
const MagicArmor = [ | |
'Armor +2 half plate, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +2 half plate, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +2 plate, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +2 plate, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +3 studded leather, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +3 studded leather, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +3 breastplate, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +3 breastplate, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +3 splint, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +3 splint, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +3 half plate, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +3 plate, material: ' + Materials() + ' additional magic: ' + Magic() | |
] | |
const TableI = [ | |
'Defender, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Defender, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Defender, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Defender, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Defender, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Hammer of thunderbolts, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Hammer of thunderbolts, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Hammer of thunderbolts, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Hammer of thunderbolts, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Hammer of thunderbolts, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Luck blade, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Luck blade, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Luck blade, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Luck blade, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Luck blade, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Sword of answering, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Sword of answering, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Sword of answering, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Sword of answering, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Sword of answering, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Holy avenger, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Holy avenger, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Holy avenger, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Ring of djinni summoning', | |
'Ring of djinni summoning', | |
'Ring of djinni summoning', | |
'Ring of invisibility', | |
'Ring of invisibility', | |
'Ring of invisibility', | |
'Ring of spell turning', | |
'Ring of spell turning', | |
'Ring of spell turning', | |
'Rod of lordly might', | |
'Rod of lordly might', | |
'Rod of lordly might', | |
'Staff of the magi', | |
'Staff of the magi', | |
'Staff of the magi', | |
'Vorpal sword, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Vorpal sword, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Vorpal sword, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Belt of cloud giant strength', | |
'Belt of cloud giant strength', | |
'Armor +2 breastplate, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +2 breastplate, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +3 chain mail, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +3 chain mail, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +3 chain shirt, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +3 chain shirt, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Cloak of invisibilty', | |
'Cloak of invisibilty', | |
'Crystal ball (legendary version)', | |
'Crystal ball (legendary version)', | |
'Armor +1 half plate, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +1 half plate, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Iron flask', | |
'Iron flask', | |
'Armor +3 leather, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +3 leather, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +1 plate, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +1 plate, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Robe of the archmagi', | |
'Robe of the archmagi', | |
'Rod of resurrection', | |
'Rod of resurrection', | |
'Armor +1 scale mail, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +1 scale mail, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Scarab of protection', | |
'Scarab of protection', | |
'Armor +2 splint, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +2 splint, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +2 studded leather, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Armor +2 studded leather, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Well of many worlds', | |
'Well of many worlds', | |
MagicArmor[Math.floor((Math.random() * 12))], | |
'Apparatus of Kwalish', | |
'Armor of invulnerability, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Belt of storm giant strength', | |
'Cubic gate', | |
'Deck of many things', | |
'Efreeti chain', | |
'Armor of resistance (half plate), material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Horn of Valhalla (iron)', | |
'Instrument of the bards (Ollamh harp)', | |
'Ioun stone (greater absorption)', | |
'Ioun stone (mastery)', | |
'Ioun stone (regeneration)', | |
'Plate armor of etherealness, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Plate armor of resistance, material: ' + Materials() + ' additional magic: ' + Magic(), | |
'Ring of air elemental command', | |
'Ring of earth elemental command', | |
'Ring of fire elemental command', | |
'Ring of three wishes', | |
'Ring of water elemental command', | |
'Sphere of annhilation', | |
'Talisman of pure good', | |
'Talisman of the sphere', | |
'Talisman of ultimate evil', | |
'Tome of the stilled tongue' | |
] | |
let d100 = Math.floor((Math.random() * 100)); | |
let treasure = TableI[d100]; | |
ppm(msg,"You found a magic item!",treasure); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment