diff --git a/RPGMlibrary AD+D2e/4.0.4/libRPGMaster2e.js b/RPGMlibrary AD+D2e/4.0.4/libRPGMaster2e.js index d34caa18a..fa256cd0d 100644 --- a/RPGMlibrary AD+D2e/4.0.4/libRPGMaster2e.js +++ b/RPGMlibrary AD+D2e/4.0.4/libRPGMaster2e.js @@ -100,7 +100,7 @@ API_Meta.libRPGMaster={offset:Number.MAX_SAFE_INTEGER,lineCount:-1}; * handleGetBaseThac0() is called. API buttons with empty button name strings will be * trapped by the output parser and a dash inserted to ensure the button is displayed, * rather than code. Made parseData() robust to non-string Attribute parameters. - * v4.04 10/04/2025 Additional creatures and changes to functions to support them. + * v4.0.4 10/04/2025 Additional creatures and changes to functions to support them. **/ const libRPGMaster = (() => { // eslint-disable-line no-unused-vars @@ -2642,14 +2642,14 @@ const libRPGMaster = (() => { // eslint-disable-line no-unused-vars {name:'Fire-Giant-Sword',type:'melee',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.weaponTemplate+'}{{name=+1}}Specs=[Fire-Giant-Sword,Melee,2H,Long-blade|Great-blade,Two-Handed-Sword]{{}}WeapData=[st:Great Blade]{{}}ToHitData=[w:Fire Giant Sword,+:0]{{}}DmgData=[w:Fire Giant Sword,+:0,sm:2d10,L:2d10]{{}}%{MI-DB|Two-Handed-Sword}{{subtitle=Magic Sword}}{{To-hit=+0 + Str bonus}}{{Damage=+0, vs SM:2d10, L:2d10, + Str bonus}}{{desc=This is a really well balanced, but enormous sword, for use with Fire Giant strength. The blade is sharp, but nothing special}}'}, {name:'Tentacle-Rod',type:'rod|innate-melee',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.weaponTemplate+'}{{name=Tentacle Rod}}{{subtitle=Rod}}{{Speed=[[5]]}}{{Size=Small}}{{Weapon=1-handed melee rod}}Specs=[Tentacle Rod,Rod|Innate-Melee,1H,Rod]{{Range=[[15]] ft}}WandData=[query:attackBonus=What plus does each tentacle attack with? |+3%%+3 |+4%%+4 |+5%%+5 |+6%%+6 |+7%%+7 |+8%%+8 |+9%%+9 ]{{Attacks=^^attackBonus#1^^ magical weapon, 3 per round vs. up to 3 creatures}}ToHitData=[w:Tentacle Rod,sb:0,+:^^attackBonus#1^^,n:3,ch:20,cm:1,sz:M,ty:B,r:15,sp:5,rc:uncharged]{{Damage=SM:1d6, L:1d6 per tentacle hit (bonus does not apply to damage). All tentacles successfully hit 1 creature save vs. Rod or *Slowed*. Save again each round to negate}}DmgData=[w:Tentacle Rod,sb:0,+:0,SM:1d6,L:1d6,msg:If all 3 tentacles hit the same creature in 1 round click \\lbrak;Slow\\rbrak;(!rounds --target-save single|@{selected|token_id}|\\amp#64;{target|Which creature has been struck 3 times?|token_id}|Slow|99|0|You are slowed until you save vs. rod|snail|svrod\\clon;0) ***then*** ask creature to make save vs. rod or the creature will be slowed]{{Use=Take rod in-hand, then attack as a melee weapon up to three times per round. If all 3 attacks hit the same creature successfully then click the [Slow] button in the Damage dialog message which will prompt for a Save vs. Rod to be done which, if failed, will automatically slow the creature. Creature tries to save again each round and, once successful Use Item to display Tentacle Rod and click [Remove Slow](!rounds --removetargetstatus \\amp#64;{target|Remove slow from which creature?|token_id}|Slow) }}{{desc=Made by the drow, this rod is a magic weapon that ends in three rubbery tentacles. While holding the rod, you can use an action to direct each tentacle to attack a creature you can see within 15 feet of you.}}{{hide1= Each tentacle makes a melee attack roll with a ^^attackBonus#1^^ bonus. On a hit, the tentacle deals 1d6 bludgeoning damage. If you hit a target with all three tentacles, it must make a saving throw vs. rod. On a failure, the creature is *Slowed*. At the end of each of its turns, it can repeat the saving throw, ending the effect on itself on a success.}}'}, ]}, - MI_DB_Ammo: {bio:'

Weapons Database

v7.01 26/01/2025

This sheet holds definitions of weapons that can be used in the RPGMaster API system. They are defined in such a way as to be lootable and usable magic items for MagicMaster and also usable weapons in attackMaster.', - gmnotes:'
Change Log:
v7.01 26/01/2025 Updated with multiple changes for v4 RoundMaster APIs
v6.07 22/12/2024 Corrected speed and charge type of several entries
v6.05 30/01/2024 Added more magical ammo options
v6.04 23/01/2024 Compressed database items and added standard magical versions
v6.03 16/10/2023 Added Ballista Javelin
v6.02 10/12/2022 Added quarrels for crossbows used underwater
v6.01 25/09/2022 Moved to RPGM Library and updated templates
v5.8 14/07/2022 Removed hard-coded whisper commands on database entries as now directed to correct player(s) programmatically
v5.7 06/04/2022 Force update to RPGMaster templates
v5.6 01/01/2022 Added summoned Rainbow Sheaf Arrows for Rainbow spell
v5.5 05/11/2021 Split the Weapon and Ammo databases
v5.4 31/10/2021 Further encoded using machine readable data to support API databases
v5.3.4 21/08/2021 Fixed incorrect damage for all types of Two-handed Sword
v5.3.3 07/06/2021 Added the missing Scimitar macro
v5.3.2 31/05/2021 Cleaned ranged weapon ranges, as specifying a range for the weapon in the {{To-Hit=...}} section will now adjust the range of the ammo by that amount (for extended range weapons). Self-ammoed weapons (like thrown daggers) should specify their range in the {{Range=...}} section.
v5.3.1 19/05/2021 Fixed a couple of bugs, missing weapons in the transfer from MI-DB
v5.3 14/05/2021 All standard weapons from the PHB now encoded.
v5.2 12/05/2021 Added support for weapon types (S,P,B), and more standard weapons
v5.1 06/05/2021 Added a number of standard and magical weapons
v5.0 28/04/2021 Initial separation of weapons listings from the main MI-DB', + MI_DB_Ammo: {bio:'

Weapons Database

v7.03 18/04/2025

This sheet holds definitions of weapons that can be used in the RPGMaster API system. They are defined in such a way as to be lootable and usable magic items for MagicMaster and also usable weapons in attackMaster.', + gmnotes:'
Change Log:
v7.03 18/04/2025 Fixed magical flight arrows for shortbows
v7.02 10/04/2025 Fixed hidden arrow infinate loop error
v7.01 26/01/2025 Updated with multiple changes for v4 RoundMaster APIs
v6.07 22/12/2024 Corrected speed and charge type of several entries
v6.05 30/01/2024 Added more magical ammo options
v6.04 23/01/2024 Compressed database items and added standard magical versions
v6.03 16/10/2023 Added Ballista Javelin
v6.02 10/12/2022 Added quarrels for crossbows used underwater
v6.01 25/09/2022 Moved to RPGM Library and updated templates
v5.8 14/07/2022 Removed hard-coded whisper commands on database entries as now directed to correct player(s) programmatically
v5.7 06/04/2022 Force update to RPGMaster templates
v5.6 01/01/2022 Added summoned Rainbow Sheaf Arrows for Rainbow spell
v5.5 05/11/2021 Split the Weapon and Ammo databases
v5.4 31/10/2021 Further encoded using machine readable data to support API databases
v5.3.4 21/08/2021 Fixed incorrect damage for all types of Two-handed Sword
v5.3.3 07/06/2021 Added the missing Scimitar macro
v5.3.2 31/05/2021 Cleaned ranged weapon ranges, as specifying a range for the weapon in the {{To-Hit=...}} section will now adjust the range of the ammo by that amount (for extended range weapons). Self-ammoed weapons (like thrown daggers) should specify their range in the {{Range=...}} section.
v5.3.1 19/05/2021 Fixed a couple of bugs, missing weapons in the transfer from MI-DB
v5.3 14/05/2021 All standard weapons from the PHB now encoded.
v5.2 12/05/2021 Added support for weapon types (S,P,B), and more standard weapons
v5.1 06/05/2021 Added a number of standard and magical weapons
v5.0 28/04/2021 Initial separation of weapons listings from the main MI-DB', root:'MI-DB', api:'attk,magic', type:'mi', controlledby:'all', avatar:'https://files.d20.io/images/52530/max.png?1340359343', - version:7.02, + version:7.03, db:[{name:'-',type:'',ct:'0',charge:'uncharged',cost:'0',body:'This is a blank slot in your Magic Item bag. Go search out some new Magic Items to fill it up!'}, {name:'Ammo-Info',type:'format',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.armourTemplate+'}{{}}Specs=[Weapon-Info,Format,0H,Format]{{}}WeapData=[a:Weapon Info]{{Speed=}}{{Size=Small}}{{Ammo=}}{{Range=}}{{Immunity=None}}{{Saves=No effect}}{{GM Info=If Auto-Hide config is set, this weapon will automatically hide as a standard weapon of its type when added to a container and by default will reveal manually (see Magic Help Handout about hiding and revealing items).}}{{Use=Ammunition will automatically be transferred to the quiver or pouch when the appropriate ranged weapon is taken in-hand using the *Attk Menu \\gt Change Weapon* dialog.)}}'}, {name:'Arrow-of-Direction',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}WeapData=[ns:1],[cl:PW,w:MU-Locate-Object,sp:2,pd:1]{{}}AmmoData=[w:Arrow of Direction]{{}}%{MI-DB|Flight-Arrow}{{Power=Limited [Locate Object](!magic --mi-power @{selected|token_id}|MU-Locate-Object|Flight-Arrow-of-Direction) capability}}{{Use=To indicate use of the Power, select the *Locate Object* button on the displayed information. Ammunition will automatically be transferred to the quiver or pouch when the appropriate ranged weapon is taken in-hand using the *Attk Menu \\gt Change Weapon* dialog.}}{{desc=This typically appears to be a normal arrow. However, its magical properties make it function like a locate object spell, empowering the arrow to show the direction to the nearest stairway, passage, cave, etc.\nOnce per day the device can be tossed into the air; it will fall and point in the requested direction. This process can be repeated seven times during the next seven turns. The request must be for one of the following:\n• Stairway (up or down)\n• Sloping passage (up or down)\n• Dungeon exit or entrance\n• Cave or cavern\nRequests must be phrased by distance (nearest, farthest, highest, lowest) or by direction (north, south, east, west, etc.).}}'}, @@ -2672,13 +2672,13 @@ const libRPGMaster = (() => { // eslint-disable-line no-unused-vars {name:'Cursed-Sheaf-Arrow',type:'ammo',ct:'0',charge:'Cursed',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{prefix=Cursed }}{{name= ^^weaponCurse#0^^}}Specs=[Sheaf-Arrow,Ammo,1H,Arrow,Sheaf-Arrow]{{}}WeapData=[query:weaponCurse,+:^^weaponCurse#1^^,rc:Cursed]{{}}AmmoData=[w:Sheaf Arrow^^weaponCurse#0^^,+:^^weaponCurse#1^^],[w:Warbow Sheaf Arrow^^weaponCurse#0^^,+:^^weaponCurse#1^^]{{}}RangeData=[t:longbow,+:^^weaponCurse#1^^],[t:warbow,+:^^weaponCurse#1^^],[t:compositelongbow,+:^^weaponCurse#1^^]{{}}%{MI-DB|Sheaf-Arrow}{{}}%{MI-DB|Magical-Weapon-Info}{{Ammo=^^weaponCurse#0^^,\n**Warbow** vs. SM:1d10, L:1d10,\n**Other Bows** vs. SM:1d8, L:1d8, Piercing}}{{desc=A Sheaf Arrow of questionable quality with odd markings on the shaft and etched into the head}}'}, {name:'Daikyu-Arrow',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{title=Daikyu Arrow}}specs=[Daikyu-arrow,Ammo,1H,Arrow]{{}}WeapData=[qty:10+1d10]{{}}AmmoData=[w:Daikyu Arrow,t:Daikyu,+:0,sm:1d8,l:1d6,rc:uncharged]{{}}RangeData=[t:Daikyu,sb:1,+:0,r:3/7/14/21]{{subtitle=Ammo}}{{Speed=As per bow}}{{Size=small}}{{Ammo=+0,\n**Daikyu** vs. sm:1d8, l:1d6,\n**Other bows** does not work, Piercing}}{{Range=PB:30, S:70, M:140, L:210}}{{desc=An arrow that, due to the nock and the shape of the flights, can only be used with a Daikyu bow.}}'}, {name:'Flight-Arrow',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{title=Flight Arrow}}Specs=[Flight-Arrow,Ammo,1H,Arrow],[Flight-Arrow,Ammo,1H,Arrow],[Flight-Arrow,Ammo,1H,Arrow]{{}}WeapData=[qty:10+1d20]{{}}AmmoData=[w:Flight Arrow,st:Bow,+:0,SM:1d6,L:1d6,rc:uncharged],[w:Warbow Flight Arrow,t:warbow,+:0,SM:1d8,L:1d8,rc:uncharged],[w:Flight Arrow,t:shortbow,+:0,SM:1d6,L:1d6,rc:uncharged]{{}}RangeData=[t:longbow,sb:1,+:0,r:3/6/12/21],[t:shortbow,+:0,r:3/5/10/15],[t:warbow,sb:1,+:0,r:3/9/16/25],[t:compositelongbow,sb:1,+:0,r:3/7/14/21],[t:compositeshortbow,sb:1,+:0,r:3/5/10/18]{{}}%{MI-DB|Ammo-Info}{{subtitle=Ammo}}{{Speed=As per bow}}{{Size=Small}}{{Ammo=+0,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{Range=PB:30, others vary by bow\n**Shortbow:**\nS:50, M:100, L150,\n**Longbow:**\nS:60, M:120, L:210,\n**Warbow:**\nS90, M:160, L:250,\n**Composite Sbow:**\nS:50, M:100, L:180,\n**Composite Lbow:**\nS:70, M:140, L:210}}{{Looks Like=An arrow of 30 to 40 ins.}}{{Hide1=In general, arrows range in length from 20 to 40 inches. The feathers, or fletching, of the arrow consist of two or more feathers set coaxially to the shaft. The flight arrow is built for distance. These are lightweight arrows and are often used for hunting. Most of these arrows are made of ash or birch and are 30 to 40 inches long.}}{{desc=A Flight Arrow of good quality but otherwise ordinary}}'}, - {name:'Flight-Arrow+1',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=+1}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}AmmoData=[w:Flight Arrow+1,+:1],[w:Warbow Flight Arrow+1,+:1],[w:Shortbow Flight Arrow+1,+:1]{{}}RangeData=[t:longbow,+:1],[t:shortbow,+:1],[t:warbow,+:1],[t:compositelongbow,+:1],[t:compositeshortbow,+:1]{{}}%{MI-DB|Flight-Arrow}{{subtitle=Magic Weapon}}{{Ammo=+1,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{desc=A magical Flight Arrow of fine quality}}'}, - {name:'Flight-Arrow+2',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=+2}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}AmmoData=[w:Flight Arrow+2,+:2],[w:Warbow Flight Arrow+2,+:2],[w:Shortbow Flight Arrow+2,+:2]{{}}RangeData=[t:longbow,+:2],[t:shortbow,+:2],[t:warbow,+:2],[t:compositelongbow,+:2],[t:compositeshortbow,+:2]{{}}%{MI-DB|Flight-Arrow}{{subtitle=Magic Weapon}}{{Ammo=+2,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{desc=A magical Flight Arrow of fine quality}}'}, - {name:'Flight-Arrow+3',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=+3}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}AmmoData=[w:Flight Arrow+3,+:3],[w:Warbow Flight Arrow+3,+:3],[w:Shortbow Flight Arrow+3,+:3]{{}}RangeData=[t:longbow,+:3],[t:shortbow,+:3],[t:warbow,+:3],[t:compositelongbow,+:3],[t:compositeshortbow,+:3]{{}}%{MI-DB|Flight-Arrow}{{subtitle=Magic Weapon}}{{Ammo=+3,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{desc=A magical Flight Arrow of fine quality}}'}, - {name:'Flight-Arrow+4',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=+4}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}AmmoData=[w:Flight Arrow+4,+:4],[w:Warbow Flight Arrow+4,+:4],[w:Shortbow Flight Arrow+4,+:4]{{}}RangeData=[t:longbow,+:4],[t:shortbow,+:4],[t:warbow,+:4],[t:compositelongbow,+:4],[t:compositeshortbow,+:4]{{}}%{MI-DB|Flight-Arrow}{{subtitle=Magic Weapon}}{{Ammo=+4,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{desc=A magical Flight Arrow of fine quality}}'}, + {name:'Flight-Arrow+1',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=+1}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}AmmoData=[w:Flight Arrow+1,+:1],[w:Warbow Flight Arrow+1,+:1],[w:Shortbow Flight Arrow+1,+:1]{{}}RangeData=[t:longbow,+:1],[t:shortbow,+:1],[t:warbow,+:1],[t:compositelongbow,+:1],[t:compositeshortbow,+:1]{{}}%{MI-DB|Flight-Arrow}{{subtitle=Magic Weapon}}{{Ammo=+1,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{desc=A magical Flight Arrow of fine quality}}'}, + {name:'Flight-Arrow+2',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=+2}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}AmmoData=[w:Flight Arrow+2,+:2],[w:Warbow Flight Arrow+2,+:2],[w:Shortbow Flight Arrow+2,+:2]{{}}RangeData=[t:longbow,+:2],[t:shortbow,+:2],[t:warbow,+:2],[t:compositelongbow,+:2],[t:compositeshortbow,+:2]{{}}%{MI-DB|Flight-Arrow}{{subtitle=Magic Weapon}}{{Ammo=+2,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{desc=A magical Flight Arrow of fine quality}}'}, + {name:'Flight-Arrow+3',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=+3}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}AmmoData=[w:Flight Arrow+3,+:3],[w:Warbow Flight Arrow+3,+:3],[w:Shortbow Flight Arrow+3,+:3]{{}}RangeData=[t:longbow,+:3],[t:shortbow,+:3],[t:warbow,+:3],[t:compositelongbow,+:3],[t:compositeshortbow,+:3]{{}}%{MI-DB|Flight-Arrow}{{subtitle=Magic Weapon}}{{Ammo=+3,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{desc=A magical Flight Arrow of fine quality}}'}, + {name:'Flight-Arrow+4',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=+4}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}AmmoData=[w:Flight Arrow+4,+:4],[w:Warbow Flight Arrow+4,+:4],[w:Shortbow Flight Arrow+4,+:4]{{}}RangeData=[t:longbow,+:4],[t:shortbow,+:4],[t:warbow,+:4],[t:compositelongbow,+:4],[t:compositeshortbow,+:4]{{}}%{MI-DB|Flight-Arrow}{{subtitle=Magic Weapon}}{{Ammo=+4,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{desc=A magical Flight Arrow of fine quality}}'}, {name:'Flight-Arrow-Cursed',type:'ammo',ct:'0',charge:'Cursed',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Cursed-Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Cursed-Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Cursed-Flight-Arrow]{{}}%{MI-DB|Cursed-Flight-Arrow}'}, {name:'Flight-Arrow-Stone',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=Flight arrow - stone}}WeapData=[qty:4+1d6]{{subtitle=ammo}}{{speed=As per bow}}{{size=Small}}specs=[flight-arrow,ammo,1h,arrow],[flight-arrow,ammo,1h,arrow],[flight-arrow,ammo,1h,arrow]{{ammo=+0,\n**warbow** vs. sm:0, l:0,\n**other bows** vs. sm:1d4, l:1d4, piercing}}ammodata=[w:Stone flight arrow,st:bow,+:0,sm:1d4,l:1d4,rc:uncharged],[w:Stone flight arrow,t:warbow,+:0,sm:0,l:0,rc:uncharged,msg:Automatically shatters with the force from the bow],[w:Stone flight arrow,t:shortbow,+:0,sm:1d4,l:1d4,rc:uncharged]{{range=pb:30, others vary by bow\n**shortbow:**\ns:50, m:100, l150,\n**longbow:**\ns:60, m:120, l:210,\n**warbow:**\ns:0, m:0, l:0,\n**composite sbow:**\ns:50, m:100, l:180,\n**composite lbow:**\ns:70, m:140, l:210}}rangedata=[t:longbow,sb:1,+:0,r:3/6/12/21],[t:shortbow,+:0,r:3/5/10/15],[t:warbow,sb:1,+:0,r:3/9/16/25],[t:compositelongbow,sb:1,+:0,r:3/7/14/21],[t:compositeshortbow,sb:1,+:0,r:3/5/10/18]{{desc=A stone flight arrow. Shatters 1 in 6 times. If used with a warbow, will shatter as soon as fired from the bow without doing any damage (won\'t travel even 5ft) as the bow is just too powerful for it.}}'}, - {name:'Flight-Arrows',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}%{MI-DB|Flight-Arrow}'}, + {name:'Flight-Arrows',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{}}%{MI-DB|Flight-Arrow}'}, {name:'Flight-arrow+?',type:'ammo|dminfo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=Flight Arrow+?}}{{subtitle=Magic Weapon}}{{Speed=As per bow}}{{Size=Small}}Specs=[Flight-Arrow,Ammo|DMinfo,1H,Arrow]{{To-hit=Unknown}}{{damage=Unknown}}{{desc=A magical Flight Arrow of very fine quality, but with unknown plusses}}'}, {name:'Glass-Arrow+3',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=Glass Sheaf Arrow+3}}{{subtitle=Magic Weapon}}WeapData=[qty:1d6]{{Speed=As per bow}}{{Size=Small}}Specs=[Glass Arrow,Ammo,1H,Arrow],[Glass Arrow,Ammo,1H,Arrow],[Glass Arrow,Ammo,1H,Arrow]{{Ammo=+3 Piercing,\n**Warbow** vs\nSM:1d10, L:1d10\n**Other Bows** vs\nSM:1d8, L:1d8,\nbreaks on use}}AmmoData=[w:Glass Arrow+3,st:Bow,+:3,ru:-1,SM:1d8,L:1d8],[w:Glass Arrow+3,t:warbow,+:3,ru:-1,SM:1d10,L:1d10],[w:Glass Arrow+3,t:shortbow,+:3,ru:-1,SM:1d8,L:1d8]{{Range=Varies by bow:\n**Longbow**\nPB:30 S:50 M:100 L:170\n**Shortbow**\nPB:30 S:40 M:80 L:150\n**Warbow**\nPB:30 S:70 M:120 L:210\n**Composite Lbow**\nPB:30 S:50 M:100 L:180\n**Composite Sbow**\nPB:30 S:50 M:100 L:150}}RangeData=[t:longbow,+:3,r:3/5/10/17],[t:shortbow,+:3,r:3/4/8/15],[t:warbow,+:3,r:3/7/12/21],[t:compositelongbow,+:3,r:3/5/10/18],[t:compositeshortbow:,+:3,r:3/5/10/17]{{desc=A magical Sheaf Arrow made of ultra-sharp glass. The arrows always shatter on use.}}'}, {name:'Glass-arrow+10',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=Glass Sheaf Arrow+3}}{{subtitle=Magic Weapon}}WeapData=[qty:1d3]{{Speed=As per bow}}{{Size=Small}}Specs=[Glass Arrow,Ammo,1H,Arrow],[Glass Arrow,Ammo,1H,Arrow],[Glass Arrow,Ammo,1H,Arrow]{{Ammo=+10 Piercing,\n**Warbow** vs\nSM:1d10, L:1d10\n**Other Bows** vs\nSM:1d8, L:1d8,\nbreaks on use}}AmmoData=[w:Glass Arrow+10,st:Bow,+:10,ru:-1,SM:1d8,L:1d8],[w:Glass Arrow+10,t:warbow,+:10,ru:-1,SM:1d10,L:1d10],[w:Glass Arrow+10,t:shortbow,+:10,ru:-1,SM:1d8,L:1d8]{{Range=Varies by bow:\n**Longbow**\nPB:30 S:50 M:100 L:170\n**Shortbow**\nPB:30 S:40 M:80 L:150\n**Warbow**\nPB:30 S:70 M:120 L:210\n**Composite Lbow**\nPB:30 S:50 M:100 L:180\n**Composite Sbow**\nPB:30 S:50 M:100 L:150}}RangeData=[t:longbow,+:10,r:3/5/10/17],[t:shortbow,+:10,r:3/4/8/15],[t:warbow,+:10,r:3/7/12/21],[t:compositelongbow,+:10,r:3/5/10/18],[t:compositeshortbow:,+:10,r:3/5/10/17]{{desc=A magical Sheaf Arrow made of ultra-sharp glass. The arrows always shatter on use.}}'}, @@ -8436,12 +8436,14 @@ const libRPGMaster = (() => { // eslint-disable-line no-unused-vars (findRE ? (attrVal.search(val) >= 0) : (findArray ? (val.includes(attrVal.dbName() || '-')) : false )))) { - if (!every) return tableIndex; + if (!every) return parseInt(tableIndex); indexArray.push(tableIndex); } let attrs = this[attrDef[0]].attrs; + if (!def) tableIndex = undefined; for (let i=0; i < this.sortKeys.length; i++) { let elem = _.has(attrs,this.sortKeys[i]) ? attrs[this.sortKeys[i]].get(property) : (def ? attrDef[2] : undefined); +// log('tableFind: row '+i+' value = '+elem+(findVal ? ' against '+val : '')); if (!_.isUndefined(elem)) { if (findVal ? (val === (String(elem).dbName() || '-')) : (findRE ? (String(elem).search(val) >= 0) : @@ -8449,16 +8451,18 @@ const libRPGMaster = (() => { // eslint-disable-line no-unused-vars false ))) { indexArray.push(i); - if (tableIndex < 0) tableIndex = i; + if (_.isUndefined(tableIndex) || tableIndex < 0) tableIndex = i; +// log('tableFind: found at row '+i+', every is '+every); if (!every) break; }; }; }; - if (tableIndex < 0 && ((findVal && val === '-') || (findArray && val.includes('-')))) { + if (def && tableIndex < 0 && ((findVal && val === '-') || (findArray && val.includes('-')))) { tableIndex = this.sortKeys.length; indexArray.push(tableIndex); } +// log('tableFind: indexArray.length = '+indexArray.length+' so returning '+(!indexArray.length ? undefined : (every ? indexArray : tableIndex))); return !indexArray.length ? undefined : (every ? indexArray : tableIndex) }; @@ -11209,10 +11213,10 @@ const libRPGMaster = (() => { // eslint-disable-line no-unused-vars if (!type) { return Math.max(1,Math.min( parseInt(LibFunctions.attrLookup( charCS, fields.MonsterThac0 )) || 20, baseThac0table[0][(LibFunctions.attrLookup( charCS, fields.Fighter_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Fighter_level ) || 0)], - baseThac0table[0][(LibFunctions.attrLookup( charCS, fields.Wizard_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Wizard_level ) || 0)], - baseThac0table[0][(LibFunctions.attrLookup( charCS, fields.Priest_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Priest_level ) || 0)], - baseThac0table[0][(LibFunctions.attrLookup( charCS, fields.Rogue_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Rogue_level ) || 0)], - baseThac0table[0][(LibFunctions.attrLookup( charCS, fields.Psion_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Psion_level ) || 0)] + baseThac0table[1][(LibFunctions.attrLookup( charCS, fields.Wizard_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Wizard_level ) || 0)], + baseThac0table[2][(LibFunctions.attrLookup( charCS, fields.Priest_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Priest_level ) || 0)], + baseThac0table[3][(LibFunctions.attrLookup( charCS, fields.Rogue_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Rogue_level ) || 0)], + baseThac0table[4][(LibFunctions.attrLookup( charCS, fields.Psion_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Psion_level ) || 0)] )); } else if (!isNaN(type)) { return parseInt(type); diff --git a/RPGMlibrary AD+D2e/libRPGMaster2e.js b/RPGMlibrary AD+D2e/libRPGMaster2e.js index d34caa18a..fa256cd0d 100644 --- a/RPGMlibrary AD+D2e/libRPGMaster2e.js +++ b/RPGMlibrary AD+D2e/libRPGMaster2e.js @@ -100,7 +100,7 @@ API_Meta.libRPGMaster={offset:Number.MAX_SAFE_INTEGER,lineCount:-1}; * handleGetBaseThac0() is called. API buttons with empty button name strings will be * trapped by the output parser and a dash inserted to ensure the button is displayed, * rather than code. Made parseData() robust to non-string Attribute parameters. - * v4.04 10/04/2025 Additional creatures and changes to functions to support them. + * v4.0.4 10/04/2025 Additional creatures and changes to functions to support them. **/ const libRPGMaster = (() => { // eslint-disable-line no-unused-vars @@ -2642,14 +2642,14 @@ const libRPGMaster = (() => { // eslint-disable-line no-unused-vars {name:'Fire-Giant-Sword',type:'melee',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.weaponTemplate+'}{{name=+1}}Specs=[Fire-Giant-Sword,Melee,2H,Long-blade|Great-blade,Two-Handed-Sword]{{}}WeapData=[st:Great Blade]{{}}ToHitData=[w:Fire Giant Sword,+:0]{{}}DmgData=[w:Fire Giant Sword,+:0,sm:2d10,L:2d10]{{}}%{MI-DB|Two-Handed-Sword}{{subtitle=Magic Sword}}{{To-hit=+0 + Str bonus}}{{Damage=+0, vs SM:2d10, L:2d10, + Str bonus}}{{desc=This is a really well balanced, but enormous sword, for use with Fire Giant strength. The blade is sharp, but nothing special}}'}, {name:'Tentacle-Rod',type:'rod|innate-melee',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.weaponTemplate+'}{{name=Tentacle Rod}}{{subtitle=Rod}}{{Speed=[[5]]}}{{Size=Small}}{{Weapon=1-handed melee rod}}Specs=[Tentacle Rod,Rod|Innate-Melee,1H,Rod]{{Range=[[15]] ft}}WandData=[query:attackBonus=What plus does each tentacle attack with? |+3%%+3 |+4%%+4 |+5%%+5 |+6%%+6 |+7%%+7 |+8%%+8 |+9%%+9 ]{{Attacks=^^attackBonus#1^^ magical weapon, 3 per round vs. up to 3 creatures}}ToHitData=[w:Tentacle Rod,sb:0,+:^^attackBonus#1^^,n:3,ch:20,cm:1,sz:M,ty:B,r:15,sp:5,rc:uncharged]{{Damage=SM:1d6, L:1d6 per tentacle hit (bonus does not apply to damage). All tentacles successfully hit 1 creature save vs. Rod or *Slowed*. Save again each round to negate}}DmgData=[w:Tentacle Rod,sb:0,+:0,SM:1d6,L:1d6,msg:If all 3 tentacles hit the same creature in 1 round click \\lbrak;Slow\\rbrak;(!rounds --target-save single|@{selected|token_id}|\\amp#64;{target|Which creature has been struck 3 times?|token_id}|Slow|99|0|You are slowed until you save vs. rod|snail|svrod\\clon;0) ***then*** ask creature to make save vs. rod or the creature will be slowed]{{Use=Take rod in-hand, then attack as a melee weapon up to three times per round. If all 3 attacks hit the same creature successfully then click the [Slow] button in the Damage dialog message which will prompt for a Save vs. Rod to be done which, if failed, will automatically slow the creature. Creature tries to save again each round and, once successful Use Item to display Tentacle Rod and click [Remove Slow](!rounds --removetargetstatus \\amp#64;{target|Remove slow from which creature?|token_id}|Slow) }}{{desc=Made by the drow, this rod is a magic weapon that ends in three rubbery tentacles. While holding the rod, you can use an action to direct each tentacle to attack a creature you can see within 15 feet of you.}}{{hide1= Each tentacle makes a melee attack roll with a ^^attackBonus#1^^ bonus. On a hit, the tentacle deals 1d6 bludgeoning damage. If you hit a target with all three tentacles, it must make a saving throw vs. rod. On a failure, the creature is *Slowed*. At the end of each of its turns, it can repeat the saving throw, ending the effect on itself on a success.}}'}, ]}, - MI_DB_Ammo: {bio:'

Weapons Database

v7.01 26/01/2025

This sheet holds definitions of weapons that can be used in the RPGMaster API system. They are defined in such a way as to be lootable and usable magic items for MagicMaster and also usable weapons in attackMaster.', - gmnotes:'
Change Log:
v7.01 26/01/2025 Updated with multiple changes for v4 RoundMaster APIs
v6.07 22/12/2024 Corrected speed and charge type of several entries
v6.05 30/01/2024 Added more magical ammo options
v6.04 23/01/2024 Compressed database items and added standard magical versions
v6.03 16/10/2023 Added Ballista Javelin
v6.02 10/12/2022 Added quarrels for crossbows used underwater
v6.01 25/09/2022 Moved to RPGM Library and updated templates
v5.8 14/07/2022 Removed hard-coded whisper commands on database entries as now directed to correct player(s) programmatically
v5.7 06/04/2022 Force update to RPGMaster templates
v5.6 01/01/2022 Added summoned Rainbow Sheaf Arrows for Rainbow spell
v5.5 05/11/2021 Split the Weapon and Ammo databases
v5.4 31/10/2021 Further encoded using machine readable data to support API databases
v5.3.4 21/08/2021 Fixed incorrect damage for all types of Two-handed Sword
v5.3.3 07/06/2021 Added the missing Scimitar macro
v5.3.2 31/05/2021 Cleaned ranged weapon ranges, as specifying a range for the weapon in the {{To-Hit=...}} section will now adjust the range of the ammo by that amount (for extended range weapons). Self-ammoed weapons (like thrown daggers) should specify their range in the {{Range=...}} section.
v5.3.1 19/05/2021 Fixed a couple of bugs, missing weapons in the transfer from MI-DB
v5.3 14/05/2021 All standard weapons from the PHB now encoded.
v5.2 12/05/2021 Added support for weapon types (S,P,B), and more standard weapons
v5.1 06/05/2021 Added a number of standard and magical weapons
v5.0 28/04/2021 Initial separation of weapons listings from the main MI-DB', + MI_DB_Ammo: {bio:'

Weapons Database

v7.03 18/04/2025

This sheet holds definitions of weapons that can be used in the RPGMaster API system. They are defined in such a way as to be lootable and usable magic items for MagicMaster and also usable weapons in attackMaster.', + gmnotes:'
Change Log:
v7.03 18/04/2025 Fixed magical flight arrows for shortbows
v7.02 10/04/2025 Fixed hidden arrow infinate loop error
v7.01 26/01/2025 Updated with multiple changes for v4 RoundMaster APIs
v6.07 22/12/2024 Corrected speed and charge type of several entries
v6.05 30/01/2024 Added more magical ammo options
v6.04 23/01/2024 Compressed database items and added standard magical versions
v6.03 16/10/2023 Added Ballista Javelin
v6.02 10/12/2022 Added quarrels for crossbows used underwater
v6.01 25/09/2022 Moved to RPGM Library and updated templates
v5.8 14/07/2022 Removed hard-coded whisper commands on database entries as now directed to correct player(s) programmatically
v5.7 06/04/2022 Force update to RPGMaster templates
v5.6 01/01/2022 Added summoned Rainbow Sheaf Arrows for Rainbow spell
v5.5 05/11/2021 Split the Weapon and Ammo databases
v5.4 31/10/2021 Further encoded using machine readable data to support API databases
v5.3.4 21/08/2021 Fixed incorrect damage for all types of Two-handed Sword
v5.3.3 07/06/2021 Added the missing Scimitar macro
v5.3.2 31/05/2021 Cleaned ranged weapon ranges, as specifying a range for the weapon in the {{To-Hit=...}} section will now adjust the range of the ammo by that amount (for extended range weapons). Self-ammoed weapons (like thrown daggers) should specify their range in the {{Range=...}} section.
v5.3.1 19/05/2021 Fixed a couple of bugs, missing weapons in the transfer from MI-DB
v5.3 14/05/2021 All standard weapons from the PHB now encoded.
v5.2 12/05/2021 Added support for weapon types (S,P,B), and more standard weapons
v5.1 06/05/2021 Added a number of standard and magical weapons
v5.0 28/04/2021 Initial separation of weapons listings from the main MI-DB', root:'MI-DB', api:'attk,magic', type:'mi', controlledby:'all', avatar:'https://files.d20.io/images/52530/max.png?1340359343', - version:7.02, + version:7.03, db:[{name:'-',type:'',ct:'0',charge:'uncharged',cost:'0',body:'This is a blank slot in your Magic Item bag. Go search out some new Magic Items to fill it up!'}, {name:'Ammo-Info',type:'format',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.armourTemplate+'}{{}}Specs=[Weapon-Info,Format,0H,Format]{{}}WeapData=[a:Weapon Info]{{Speed=}}{{Size=Small}}{{Ammo=}}{{Range=}}{{Immunity=None}}{{Saves=No effect}}{{GM Info=If Auto-Hide config is set, this weapon will automatically hide as a standard weapon of its type when added to a container and by default will reveal manually (see Magic Help Handout about hiding and revealing items).}}{{Use=Ammunition will automatically be transferred to the quiver or pouch when the appropriate ranged weapon is taken in-hand using the *Attk Menu \\gt Change Weapon* dialog.)}}'}, {name:'Arrow-of-Direction',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}WeapData=[ns:1],[cl:PW,w:MU-Locate-Object,sp:2,pd:1]{{}}AmmoData=[w:Arrow of Direction]{{}}%{MI-DB|Flight-Arrow}{{Power=Limited [Locate Object](!magic --mi-power @{selected|token_id}|MU-Locate-Object|Flight-Arrow-of-Direction) capability}}{{Use=To indicate use of the Power, select the *Locate Object* button on the displayed information. Ammunition will automatically be transferred to the quiver or pouch when the appropriate ranged weapon is taken in-hand using the *Attk Menu \\gt Change Weapon* dialog.}}{{desc=This typically appears to be a normal arrow. However, its magical properties make it function like a locate object spell, empowering the arrow to show the direction to the nearest stairway, passage, cave, etc.\nOnce per day the device can be tossed into the air; it will fall and point in the requested direction. This process can be repeated seven times during the next seven turns. The request must be for one of the following:\n• Stairway (up or down)\n• Sloping passage (up or down)\n• Dungeon exit or entrance\n• Cave or cavern\nRequests must be phrased by distance (nearest, farthest, highest, lowest) or by direction (north, south, east, west, etc.).}}'}, @@ -2672,13 +2672,13 @@ const libRPGMaster = (() => { // eslint-disable-line no-unused-vars {name:'Cursed-Sheaf-Arrow',type:'ammo',ct:'0',charge:'Cursed',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{prefix=Cursed }}{{name= ^^weaponCurse#0^^}}Specs=[Sheaf-Arrow,Ammo,1H,Arrow,Sheaf-Arrow]{{}}WeapData=[query:weaponCurse,+:^^weaponCurse#1^^,rc:Cursed]{{}}AmmoData=[w:Sheaf Arrow^^weaponCurse#0^^,+:^^weaponCurse#1^^],[w:Warbow Sheaf Arrow^^weaponCurse#0^^,+:^^weaponCurse#1^^]{{}}RangeData=[t:longbow,+:^^weaponCurse#1^^],[t:warbow,+:^^weaponCurse#1^^],[t:compositelongbow,+:^^weaponCurse#1^^]{{}}%{MI-DB|Sheaf-Arrow}{{}}%{MI-DB|Magical-Weapon-Info}{{Ammo=^^weaponCurse#0^^,\n**Warbow** vs. SM:1d10, L:1d10,\n**Other Bows** vs. SM:1d8, L:1d8, Piercing}}{{desc=A Sheaf Arrow of questionable quality with odd markings on the shaft and etched into the head}}'}, {name:'Daikyu-Arrow',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{title=Daikyu Arrow}}specs=[Daikyu-arrow,Ammo,1H,Arrow]{{}}WeapData=[qty:10+1d10]{{}}AmmoData=[w:Daikyu Arrow,t:Daikyu,+:0,sm:1d8,l:1d6,rc:uncharged]{{}}RangeData=[t:Daikyu,sb:1,+:0,r:3/7/14/21]{{subtitle=Ammo}}{{Speed=As per bow}}{{Size=small}}{{Ammo=+0,\n**Daikyu** vs. sm:1d8, l:1d6,\n**Other bows** does not work, Piercing}}{{Range=PB:30, S:70, M:140, L:210}}{{desc=An arrow that, due to the nock and the shape of the flights, can only be used with a Daikyu bow.}}'}, {name:'Flight-Arrow',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{title=Flight Arrow}}Specs=[Flight-Arrow,Ammo,1H,Arrow],[Flight-Arrow,Ammo,1H,Arrow],[Flight-Arrow,Ammo,1H,Arrow]{{}}WeapData=[qty:10+1d20]{{}}AmmoData=[w:Flight Arrow,st:Bow,+:0,SM:1d6,L:1d6,rc:uncharged],[w:Warbow Flight Arrow,t:warbow,+:0,SM:1d8,L:1d8,rc:uncharged],[w:Flight Arrow,t:shortbow,+:0,SM:1d6,L:1d6,rc:uncharged]{{}}RangeData=[t:longbow,sb:1,+:0,r:3/6/12/21],[t:shortbow,+:0,r:3/5/10/15],[t:warbow,sb:1,+:0,r:3/9/16/25],[t:compositelongbow,sb:1,+:0,r:3/7/14/21],[t:compositeshortbow,sb:1,+:0,r:3/5/10/18]{{}}%{MI-DB|Ammo-Info}{{subtitle=Ammo}}{{Speed=As per bow}}{{Size=Small}}{{Ammo=+0,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{Range=PB:30, others vary by bow\n**Shortbow:**\nS:50, M:100, L150,\n**Longbow:**\nS:60, M:120, L:210,\n**Warbow:**\nS90, M:160, L:250,\n**Composite Sbow:**\nS:50, M:100, L:180,\n**Composite Lbow:**\nS:70, M:140, L:210}}{{Looks Like=An arrow of 30 to 40 ins.}}{{Hide1=In general, arrows range in length from 20 to 40 inches. The feathers, or fletching, of the arrow consist of two or more feathers set coaxially to the shaft. The flight arrow is built for distance. These are lightweight arrows and are often used for hunting. Most of these arrows are made of ash or birch and are 30 to 40 inches long.}}{{desc=A Flight Arrow of good quality but otherwise ordinary}}'}, - {name:'Flight-Arrow+1',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=+1}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}AmmoData=[w:Flight Arrow+1,+:1],[w:Warbow Flight Arrow+1,+:1],[w:Shortbow Flight Arrow+1,+:1]{{}}RangeData=[t:longbow,+:1],[t:shortbow,+:1],[t:warbow,+:1],[t:compositelongbow,+:1],[t:compositeshortbow,+:1]{{}}%{MI-DB|Flight-Arrow}{{subtitle=Magic Weapon}}{{Ammo=+1,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{desc=A magical Flight Arrow of fine quality}}'}, - {name:'Flight-Arrow+2',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=+2}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}AmmoData=[w:Flight Arrow+2,+:2],[w:Warbow Flight Arrow+2,+:2],[w:Shortbow Flight Arrow+2,+:2]{{}}RangeData=[t:longbow,+:2],[t:shortbow,+:2],[t:warbow,+:2],[t:compositelongbow,+:2],[t:compositeshortbow,+:2]{{}}%{MI-DB|Flight-Arrow}{{subtitle=Magic Weapon}}{{Ammo=+2,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{desc=A magical Flight Arrow of fine quality}}'}, - {name:'Flight-Arrow+3',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=+3}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}AmmoData=[w:Flight Arrow+3,+:3],[w:Warbow Flight Arrow+3,+:3],[w:Shortbow Flight Arrow+3,+:3]{{}}RangeData=[t:longbow,+:3],[t:shortbow,+:3],[t:warbow,+:3],[t:compositelongbow,+:3],[t:compositeshortbow,+:3]{{}}%{MI-DB|Flight-Arrow}{{subtitle=Magic Weapon}}{{Ammo=+3,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{desc=A magical Flight Arrow of fine quality}}'}, - {name:'Flight-Arrow+4',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=+4}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}AmmoData=[w:Flight Arrow+4,+:4],[w:Warbow Flight Arrow+4,+:4],[w:Shortbow Flight Arrow+4,+:4]{{}}RangeData=[t:longbow,+:4],[t:shortbow,+:4],[t:warbow,+:4],[t:compositelongbow,+:4],[t:compositeshortbow,+:4]{{}}%{MI-DB|Flight-Arrow}{{subtitle=Magic Weapon}}{{Ammo=+4,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{desc=A magical Flight Arrow of fine quality}}'}, + {name:'Flight-Arrow+1',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=+1}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}AmmoData=[w:Flight Arrow+1,+:1],[w:Warbow Flight Arrow+1,+:1],[w:Shortbow Flight Arrow+1,+:1]{{}}RangeData=[t:longbow,+:1],[t:shortbow,+:1],[t:warbow,+:1],[t:compositelongbow,+:1],[t:compositeshortbow,+:1]{{}}%{MI-DB|Flight-Arrow}{{subtitle=Magic Weapon}}{{Ammo=+1,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{desc=A magical Flight Arrow of fine quality}}'}, + {name:'Flight-Arrow+2',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=+2}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}AmmoData=[w:Flight Arrow+2,+:2],[w:Warbow Flight Arrow+2,+:2],[w:Shortbow Flight Arrow+2,+:2]{{}}RangeData=[t:longbow,+:2],[t:shortbow,+:2],[t:warbow,+:2],[t:compositelongbow,+:2],[t:compositeshortbow,+:2]{{}}%{MI-DB|Flight-Arrow}{{subtitle=Magic Weapon}}{{Ammo=+2,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{desc=A magical Flight Arrow of fine quality}}'}, + {name:'Flight-Arrow+3',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=+3}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}AmmoData=[w:Flight Arrow+3,+:3],[w:Warbow Flight Arrow+3,+:3],[w:Shortbow Flight Arrow+3,+:3]{{}}RangeData=[t:longbow,+:3],[t:shortbow,+:3],[t:warbow,+:3],[t:compositelongbow,+:3],[t:compositeshortbow,+:3]{{}}%{MI-DB|Flight-Arrow}{{subtitle=Magic Weapon}}{{Ammo=+3,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{desc=A magical Flight Arrow of fine quality}}'}, + {name:'Flight-Arrow+4',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=+4}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}AmmoData=[w:Flight Arrow+4,+:4],[w:Warbow Flight Arrow+4,+:4],[w:Shortbow Flight Arrow+4,+:4]{{}}RangeData=[t:longbow,+:4],[t:shortbow,+:4],[t:warbow,+:4],[t:compositelongbow,+:4],[t:compositeshortbow,+:4]{{}}%{MI-DB|Flight-Arrow}{{subtitle=Magic Weapon}}{{Ammo=+4,\n**Warbow** vs. SM:1d8, L:1d8,\n**Other Bows** vs. SM:1d6, L:1d6, Piercing}}{{desc=A magical Flight Arrow of fine quality}}'}, {name:'Flight-Arrow-Cursed',type:'ammo',ct:'0',charge:'Cursed',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Cursed-Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Cursed-Flight-Arrow],[Flight-Arrow,Ammo,1H,Arrow,Cursed-Flight-Arrow]{{}}%{MI-DB|Cursed-Flight-Arrow}'}, {name:'Flight-Arrow-Stone',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=Flight arrow - stone}}WeapData=[qty:4+1d6]{{subtitle=ammo}}{{speed=As per bow}}{{size=Small}}specs=[flight-arrow,ammo,1h,arrow],[flight-arrow,ammo,1h,arrow],[flight-arrow,ammo,1h,arrow]{{ammo=+0,\n**warbow** vs. sm:0, l:0,\n**other bows** vs. sm:1d4, l:1d4, piercing}}ammodata=[w:Stone flight arrow,st:bow,+:0,sm:1d4,l:1d4,rc:uncharged],[w:Stone flight arrow,t:warbow,+:0,sm:0,l:0,rc:uncharged,msg:Automatically shatters with the force from the bow],[w:Stone flight arrow,t:shortbow,+:0,sm:1d4,l:1d4,rc:uncharged]{{range=pb:30, others vary by bow\n**shortbow:**\ns:50, m:100, l150,\n**longbow:**\ns:60, m:120, l:210,\n**warbow:**\ns:0, m:0, l:0,\n**composite sbow:**\ns:50, m:100, l:180,\n**composite lbow:**\ns:70, m:140, l:210}}rangedata=[t:longbow,sb:1,+:0,r:3/6/12/21],[t:shortbow,+:0,r:3/5/10/15],[t:warbow,sb:1,+:0,r:3/9/16/25],[t:compositelongbow,sb:1,+:0,r:3/7/14/21],[t:compositeshortbow,sb:1,+:0,r:3/5/10/18]{{desc=A stone flight arrow. Shatters 1 in 6 times. If used with a warbow, will shatter as soon as fired from the bow without doing any damage (won\'t travel even 5ft) as the bow is just too powerful for it.}}'}, - {name:'Flight-Arrows',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{}}Specs=[Flight-Arrow,Ammo,1H,Arrow,Flight-Arrow]{{}}%{MI-DB|Flight-Arrow}'}, + {name:'Flight-Arrows',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{}}%{MI-DB|Flight-Arrow}'}, {name:'Flight-arrow+?',type:'ammo|dminfo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=Flight Arrow+?}}{{subtitle=Magic Weapon}}{{Speed=As per bow}}{{Size=Small}}Specs=[Flight-Arrow,Ammo|DMinfo,1H,Arrow]{{To-hit=Unknown}}{{damage=Unknown}}{{desc=A magical Flight Arrow of very fine quality, but with unknown plusses}}'}, {name:'Glass-Arrow+3',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=Glass Sheaf Arrow+3}}{{subtitle=Magic Weapon}}WeapData=[qty:1d6]{{Speed=As per bow}}{{Size=Small}}Specs=[Glass Arrow,Ammo,1H,Arrow],[Glass Arrow,Ammo,1H,Arrow],[Glass Arrow,Ammo,1H,Arrow]{{Ammo=+3 Piercing,\n**Warbow** vs\nSM:1d10, L:1d10\n**Other Bows** vs\nSM:1d8, L:1d8,\nbreaks on use}}AmmoData=[w:Glass Arrow+3,st:Bow,+:3,ru:-1,SM:1d8,L:1d8],[w:Glass Arrow+3,t:warbow,+:3,ru:-1,SM:1d10,L:1d10],[w:Glass Arrow+3,t:shortbow,+:3,ru:-1,SM:1d8,L:1d8]{{Range=Varies by bow:\n**Longbow**\nPB:30 S:50 M:100 L:170\n**Shortbow**\nPB:30 S:40 M:80 L:150\n**Warbow**\nPB:30 S:70 M:120 L:210\n**Composite Lbow**\nPB:30 S:50 M:100 L:180\n**Composite Sbow**\nPB:30 S:50 M:100 L:150}}RangeData=[t:longbow,+:3,r:3/5/10/17],[t:shortbow,+:3,r:3/4/8/15],[t:warbow,+:3,r:3/7/12/21],[t:compositelongbow,+:3,r:3/5/10/18],[t:compositeshortbow:,+:3,r:3/5/10/17]{{desc=A magical Sheaf Arrow made of ultra-sharp glass. The arrows always shatter on use.}}'}, {name:'Glass-arrow+10',type:'ammo',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.ammoTemplate+'}{{name=Glass Sheaf Arrow+3}}{{subtitle=Magic Weapon}}WeapData=[qty:1d3]{{Speed=As per bow}}{{Size=Small}}Specs=[Glass Arrow,Ammo,1H,Arrow],[Glass Arrow,Ammo,1H,Arrow],[Glass Arrow,Ammo,1H,Arrow]{{Ammo=+10 Piercing,\n**Warbow** vs\nSM:1d10, L:1d10\n**Other Bows** vs\nSM:1d8, L:1d8,\nbreaks on use}}AmmoData=[w:Glass Arrow+10,st:Bow,+:10,ru:-1,SM:1d8,L:1d8],[w:Glass Arrow+10,t:warbow,+:10,ru:-1,SM:1d10,L:1d10],[w:Glass Arrow+10,t:shortbow,+:10,ru:-1,SM:1d8,L:1d8]{{Range=Varies by bow:\n**Longbow**\nPB:30 S:50 M:100 L:170\n**Shortbow**\nPB:30 S:40 M:80 L:150\n**Warbow**\nPB:30 S:70 M:120 L:210\n**Composite Lbow**\nPB:30 S:50 M:100 L:180\n**Composite Sbow**\nPB:30 S:50 M:100 L:150}}RangeData=[t:longbow,+:10,r:3/5/10/17],[t:shortbow,+:10,r:3/4/8/15],[t:warbow,+:10,r:3/7/12/21],[t:compositelongbow,+:10,r:3/5/10/18],[t:compositeshortbow:,+:10,r:3/5/10/17]{{desc=A magical Sheaf Arrow made of ultra-sharp glass. The arrows always shatter on use.}}'}, @@ -8436,12 +8436,14 @@ const libRPGMaster = (() => { // eslint-disable-line no-unused-vars (findRE ? (attrVal.search(val) >= 0) : (findArray ? (val.includes(attrVal.dbName() || '-')) : false )))) { - if (!every) return tableIndex; + if (!every) return parseInt(tableIndex); indexArray.push(tableIndex); } let attrs = this[attrDef[0]].attrs; + if (!def) tableIndex = undefined; for (let i=0; i < this.sortKeys.length; i++) { let elem = _.has(attrs,this.sortKeys[i]) ? attrs[this.sortKeys[i]].get(property) : (def ? attrDef[2] : undefined); +// log('tableFind: row '+i+' value = '+elem+(findVal ? ' against '+val : '')); if (!_.isUndefined(elem)) { if (findVal ? (val === (String(elem).dbName() || '-')) : (findRE ? (String(elem).search(val) >= 0) : @@ -8449,16 +8451,18 @@ const libRPGMaster = (() => { // eslint-disable-line no-unused-vars false ))) { indexArray.push(i); - if (tableIndex < 0) tableIndex = i; + if (_.isUndefined(tableIndex) || tableIndex < 0) tableIndex = i; +// log('tableFind: found at row '+i+', every is '+every); if (!every) break; }; }; }; - if (tableIndex < 0 && ((findVal && val === '-') || (findArray && val.includes('-')))) { + if (def && tableIndex < 0 && ((findVal && val === '-') || (findArray && val.includes('-')))) { tableIndex = this.sortKeys.length; indexArray.push(tableIndex); } +// log('tableFind: indexArray.length = '+indexArray.length+' so returning '+(!indexArray.length ? undefined : (every ? indexArray : tableIndex))); return !indexArray.length ? undefined : (every ? indexArray : tableIndex) }; @@ -11209,10 +11213,10 @@ const libRPGMaster = (() => { // eslint-disable-line no-unused-vars if (!type) { return Math.max(1,Math.min( parseInt(LibFunctions.attrLookup( charCS, fields.MonsterThac0 )) || 20, baseThac0table[0][(LibFunctions.attrLookup( charCS, fields.Fighter_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Fighter_level ) || 0)], - baseThac0table[0][(LibFunctions.attrLookup( charCS, fields.Wizard_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Wizard_level ) || 0)], - baseThac0table[0][(LibFunctions.attrLookup( charCS, fields.Priest_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Priest_level ) || 0)], - baseThac0table[0][(LibFunctions.attrLookup( charCS, fields.Rogue_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Rogue_level ) || 0)], - baseThac0table[0][(LibFunctions.attrLookup( charCS, fields.Psion_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Psion_level ) || 0)] + baseThac0table[1][(LibFunctions.attrLookup( charCS, fields.Wizard_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Wizard_level ) || 0)], + baseThac0table[2][(LibFunctions.attrLookup( charCS, fields.Priest_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Priest_level ) || 0)], + baseThac0table[3][(LibFunctions.attrLookup( charCS, fields.Rogue_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Rogue_level ) || 0)], + baseThac0table[4][(LibFunctions.attrLookup( charCS, fields.Psion_class ).toUpperCase() === 'CREATURE') ? 0 : (LibFunctions.attrLookup( charCS, fields.Psion_level ) || 0)] )); } else if (!isNaN(type)) { return parseInt(type);