Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Script] D&D 5e Shaped NPC & Spell Importer

1442228193

Edited 1442228588
Lucian
Pro
API Scripter
Hey, So I've seen two error cases so far, depending on the token and how fast the Roll20 hamsters are running: Mook HP not being set: Token has non-linked HP bar (mook) Token is dropped,  object passed to API event handler has "respresents" but not a lot else Your script finds the character, works out HD and rolls Your script sets the HP Roll20 comes along and blats the token's HP values with the ones from the character sheet Unique NPC HP being rolled incorrectly Token has linked HP bar Token is dropped, object has "represents" but not a lot else Your script finds character, checks to see if bar1 is linked, find that it is not (this info not filled in yet) Roll20 updates token, sets up linked HP bar etc Your script rolls and sets the token's HP and consequently updates the value on the character sheet as well as the token! [Edit: just read Riley's response in the other thread and realised that my understanding of how this works was entirely incorrect! Wild speculation deleted] I'm kind of astonished that all of the token setup happens in the client, seems a bit mad for a shared VTT, but I guess I don't really understand how Roll20 architecture works. I notice that in that other thread Aaron suggested correlating add: and change: events (I've always wondered why that script does that!) - perhaps you could try doing that instead of just using a timeout? Cheers, Lucian
1442229321

Edited 1442229342
Kryx
Pro
Sheet Author
API Scripter
All javascript is client side. That's not an issue. The issue is they aren't using promises to ensure that the data is returned from the server before continuing. Aaron's idea would probably work. It's just a pain to avoid roll20's bugs. :( I can look at it some time later this week.
1442229642
Lucian
Pro
API Scripter
Sorry, I had assumed that the stuff that updates tokens from character attributes happened server side and then notified the client/API independently. I hadn't realised that all of that logic was handled in the client, I guess it's a fatter client than I'd thought. I'm assuming that the API javascript runs server side, right? Thanks again for looking into this, I'll hack a timeout in there to make it work for me for the moment, if you can find the time to try a more robust fix at some point that would be amazing. Cheers, Lucian
1442230062
Kryx
Pro
Sheet Author
API Scripter
Lucian H. said: I hadn't realised that all of that logic was handled in the client, I guess it's a fatter client than I'd thought. This isn't abnormal. Client side is a perfectly fine place to handle logic. Most sites work like this nowadays. API javascript runs in the client like all javascript except NodeJS.
1442230990
Lucian
Pro
API Scripter
I think you're wrong about that, unless the Scriptomancer himself  is mistaken! The API runs under node on the server and communicates via a message queue with the rest of the system. Lucian
1442234237
Kryx
Pro
Sheet Author
API Scripter
Ya, he's right. It runs on node.
Hello! First off, LOVE the script and sheet! Beautifully done! Second, I am having an error converting my imported characters from my old campaign. I started off with the original sheet and 5e npc importer, and I have tons of monsters that I have imported, but I am having an issue converting them to the new shaped sheets. I'm getting error (From Shaped): Exception: TypeError: Cannot call method 'indexOf' of undefined. I am using the shaped sheets on a copy of my server. I followed the instructions on the first page and insured the names were correct but still nothing=P Any help would be appreciated!=)
1442260262
Kryx
Pro
Sheet Author
API Scripter
I honestly haven't updated or used conversion in months. I wouldn't be surprised if it is broken. Ummmmmm I can verify stuff later this week. Can you put the whole error message here please? (in a code block so the formatting doesn't suck)
1442269030

Edited 1442307758
O.o that is the whole error.... just  Exception: TypeError: Cannot call method 'indexOf' of undefined I'm pretty bad at code and what not so if there is a way to get more information, I'm not sure! I can give you the character stuff i was using if you like, but I tried it with a bunch of different NPC's and it wasn't working. =P  Edit: I lied! I retried it and saw it gave me a ton of info lol Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_initiative" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_initiative_overall" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_strength_save_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_basic_strength_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_dexterity_save_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_basic_dexterity_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_constitution_save_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_basic_constitution_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_intelligence_save_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_basic_intelligence_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_wisdom_save_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_basic_wisdom_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_charisma_save_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_basic_charisma_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_temp_HP" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_speed_fly" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_speed_climb" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_speed_swim" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_damage_resistance" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_damage_vulnerability" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_damage_immunity" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_condition_immunity" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_acrobatics_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_animalhandling_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_arcana_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_athletics_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_deception_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_history_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_insight_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_intimidation_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_investigation_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_medicine_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_nature_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_perception_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_performance_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_persuasion_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_religion_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_sleightofhand_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_stealth_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_survival_bonus" "Error: No attribute or sheet field found for character_id -JkjMv6Ew64UdvhjSMkq named npc_action_type1" "Exception: TypeError: Cannot call method 'indexOf' of undefined" Edit 2: I have figured it out! I didn't realise you had to convert the NPC's while using the original character sheet THEN switch to the shaped one.=)
1442323033

Edited 1442323049
Kryx
Pro
Sheet Author
API Scripter
Zach D. said: I have figured it out! I didn't realise you had to convert the NPC's while using the original character sheet THEN switch to the shaped one.=) You shouldn't have to. Conversion is different from importing. If you've imported and have the texts on the old NPCs' GM notes you can simply run "!shaped-import --clean" and it'll work 100%. I would recommend using this route. If you don't have the texts on the GM notes then you can try converting. Let me know if you still have a blocker and I can look into it, otherwise I will assume it is fixed.
1442323912
Kryx
Pro
Sheet Author
API Scripter
@Lucian: I have put in some code to hopefully get hp rolling right for slow connections. It works when I simulated a super slow connection. No idea if it'll work for you. Let me know please.
Kryx said: @Lucian: I have put in some code to hopefully get hp rolling right for slow connections. It works when I simulated a super slow connection. No idea if it'll work for you. Let me know please. Looks like it worked for me. I previously had the same issue with the script rolling when it wasn't supposed to for NPCs with linked HP, I just thought it was a known limitation of the code and just left hit dice info off of any NPCs with linked HP.
1442330629
Kryx
Pro
Sheet Author
API Scripter
So all is fixed for you, or are there any remaining issues?
1442330955
Lucian
Pro
API Scripter
Hey, Thanks for getting to this so quickly - will check this evening to make sure it works for me. Cheers, Lucian
Kryx said: So all is fixed for you, or are there any remaining issues? From the limited checking I've done, now when NPCs with linked HP get put on the tabletop, HP is not rolled for them. Before 1.99, I had the same issue as Lucian, where linked HP NPCs would be rolled (so I just removed their hit dice so nothing was rolled for them).
Kryx said: Zach D. said: I have figured it out! I didn't realise you had to convert the NPC's while using the original character sheet THEN switch to the shaped one.=) You shouldn't have to. Conversion is different from importing. If you've imported and have the texts on the old NPCs' GM notes you can simply run "!shaped-import --clean" and it'll work 100%. I would recommend using this route. If you don't have the texts on the GM notes then you can try converting. Let me know if you still have a blocker and I can look into it, otherwise I will assume it is fixed. I tried the clean command and it just seemed to delete my gm notes and then say they are empty.... It seemed to work fine with the switching after converting, so I did most of them that way so far and everything seems fine! It doesn't pull over the multiattack well but other than that it's worked! I'm sure it would be good to have a solution though in case someone else rtuns into this problem later!
1442342823
Kryx
Pro
Sheet Author
API Scripter
Zach D. said: I tried the clean command and it just seemed to delete my gm notes and then say they are empty.... It seemed to work fine with the switching after converting, so I did most of them that way so far and everything seems fine! It doesn't pull over the multiattack well but other than that it's worked! I'm sure it would be good to have a solution though in case someone else rtuns into this problem later! GM notes are never cleared by the script.
1442353086

Edited 1442353517
Lucian
Pro
API Scripter
Looking good to me - HP seem to be rolled/not rolled correctly as expected. Thanks for the super-fast fixes! :-) And no, I don't believe there are any other issues causing me trouble at the moment. One very minor thing that did occur to me is that the settings block at the top could be factored out a little bit like you've done with the spells so that people don't have to re-edit each time you update the script. For the time being I've created another script that loads after yours with this: if ((typeof shaped != 'undefined') && shaped.settings) {     shaped.settings.useAaronsNumberedScript = true;     shaped.settings.addInitiativeTokenAbility = false;     shaped.settings.attacksVsTargetAC = true;     shaped.settings.attacksVsTargetName = true;     shaped.settings.bar = [       /* Setting these to a sheet value will set the token bar value. If they are set to '' or not set then it will use whatever you already have set on the token        Do not use npc_HP, use HP instead        */       {         name: 'HP', // Red bar         max: true,         link: false,         show: false       }, {         name: 'speed', //Blue bar 'speed'         max: false,         link: true,         show: false       }, {         name: 'passive_perception', // Green bar         max: false,         link: true,         show: false       },     ] } else {     log("Can't set shaped scripts settings"); } which seems to do the trick for me, but I'm sure that can be done a bit more nicely! Or perhaps you could save some stuff in the state object - I believe that some of Aaron's scripts store user-overrides of settings in this way... Cheers Lucian
shaped.settings.attacksVsTargetAC = true; shaped.settings.attacksVsTargetName = true; With these 2 settings set to true...only the   shaped.settings.attacksVsTargetAC = true seems to make it to the sheet.  I still end up having to manually turn on the TargetName option in the settings.  Is it something I am doing wrong or is the script flag not changing the sheet setting?  I have tried this in a completely blank and fresh campaign with the same results.  I am clueless when it comes to code so it could easily be something I am missing. LOVING this script btw and finally got whatever was preventing my players from being able to use the spell-import command fixed.  Thank you for your hard work My Brother!!!
1442414579
Kryx
Pro
Sheet Author
API Scripter
Lucian H. said: which seems to do the trick for me, but I'm sure that can be done a bit more nicely! Or perhaps you could save some stuff in the state object - I believe that some of Aaron's scripts store user-overrides of settings in this way... I do it the same as aaron except some of his are stored in the state. That's a better solution than a different script.
1442414863
Kryx
Pro
Sheet Author
API Scripter
@Mike: attacksVsTargetName does nothing. lol. Dunno how that happened. Committed a fix.
Kryx said: Replace the square brackets in "spellData = [];" with the square brackets from the spell data. Is this still accurate?  I can't find spellData anywhere in the script.
1442653060
Kryx
Pro
Sheet Author
API Scripter
nope, spells are their own script now so as not to bloat this script. Grab it from github.
1442692109
Lucian
Pro
API Scripter
Hey, Minor feature request. Could we have an option to import spells as prepared? Although not usually right for PCs, most of the time with monsters I only give them the spells they have prepared, and it's annoying having to go in and flip them one by one afterwards.  Cheers, Lucian
1442692749
Kryx
Pro
Sheet Author
API Scripter
@Lucian: For what purpose? filtering? I just assume all spells are prepared for NPCs. If so, how do you see it working? A setting in the script to set all spells imported as prepared?
1442693072
Lucian
Pro
API Scripter
Haha, I thought you might ask that, nearly put in the explanation in my original post. My new spellbook script enforces spells being prepared and slots available in order for the spells to be castable. It seems neater to mark their spells as prepared than hack in a special case to the script for NPC sheets. I was just thinking of something like: !shaped-spell --firebolt magic missile mage hand --prepared Cheers, Lucian
1442694464

Edited 1442697152
Kryx
Pro
Sheet Author
API Scripter
Lucian H. said: !shaped-spell --firebolt magic missile mage hand --prepared Sounds good. (note, the list should be comma separated)
1442695086
Kryx
Pro
Sheet Author
API Scripter
Sep 19th 2015 Prepared now an option for spells
1442696536
Lucian
Pro
API Scripter
Wow, 50 minute turnaround from suggestion to being finished. Thanks! If only all software development was like that :-)
1442701117
Kryx
Pro
Sheet Author
API Scripter
Depreciate Skill macro
Hi again, hope these questions aren't too naive. Is there a workaround to get passive_perception linked to a bar?  (Do I have to define an extra attribute maybe?) Is there an option to parse the statblock for the list of spells and have them all imported when building an npc?  (I know you can give them as a list to !spell-import manually.) Are there any rules of thumb for the number of spells a sheet can have before the performance hit for loading the sheet becomes a hindrance, or is it a system specific issue? When clicking on a token, I'd like to be able to open its linked character sheet.  Is there already a way to do this, or is there a simple token action macro I could use to do so?  (A workaround is to use [Name] in the GM Description and click the hyperlink, but there's no doubt a better way. Thanks!
Sredni Vashtar said: When clicking on a token, I'd like to be able to open its linked character sheet.  Is there already a way to do this, or is there a simple token action macro I could use to do so?  (A workaround is to use [Name] in the GM Description and click the hyperlink, but there's no doubt a better way. If you hold [Shift] and double click on a token, it will open the accociated Character Sheet.
1442840218
Kryx
Pro
Sheet Author
API Scripter
Sredni Vashtar said: Is there a workaround to get passive_perception linked to a bar?  (Do I have to define an extra attribute maybe?) Not that I know of. I forget exactly why it doesn't work as I haven't looked at it in a while, but I remember it being a limit of Roll20's system. Sredni Vashtar said: Is there an option to parse the statblock for the list of spells and have them all imported when building an npc?  (I know you can give them as a list to !spell-import manually.) The problem is spell importing isn't quick - it would delay importing immensely and not be able to provide information along the way. Not sure this is a good idea. Sredni Vashtar said: Are there any rules of thumb for the number of spells a sheet can have before the performance hit for loading the sheet becomes a hindrance, or is it a system specific issue? Nope, it depends on connection speed. More spells = slower. Less than 20 is hardly noticeable though. Sredni Vashtar said: When clicking on a token, I'd like to be able to open its linked character sheet.  Is there already a way to do this, or is there a simple token action macro I could use to do so?  (A workaround is to use [Name] in the GM Description and click the hyperlink, but there's no doubt a better way. Shift+Double click
Anyone having issues with the script just not working all of a sudden?  I had imported three monsters this morning and started to do a fourth and nothing happened.  no errors in the API console , no feedback from the script, and nothing was created.  I did not change anything in the script at all and also tested the default from github in a clean campaign and still no joy.
1442868954
Kryx
Pro
Sheet Author
API Scripter
@Mike try resaving the script.
1442869346

Edited 1442870733
Did that multiple times and as I said created a new campaign and used the default script fresh from github.  I am thinking my api is busted because 2 other scripts have stopped as well.   I even went as far as using a different browser.  Sheets that have already been created seem to work just fine but anything script related is apparently stopped even though the API shows them to be working with no errors. Just for goofs I also set it up on the Dev server with the same results.  API console shows "Shaped Scripts ready" but no joy in using any of the commands.
1442871728

Edited 1442871788
Lucian
Pro
API Scripter
Mike said: Did that multiple times and as I said created a new campaign and used the default script fresh from github.  I am thinking my api is busted because 2 other scripts have stopped as well.   I even went as far as using a different browser.  Sheets that have already been created seem to work just fine but anything script related is apparently stopped even though the API shows them to be working with no errors. Do you get a "msg.content: <some stuff>" message in your API log when you issue an api command in the chat window? And do you see the initialisation text for the scripts you have loaded (e.g. "Shaped Scripts ready") Lucian
Mike said: Just for goofs I also set it up on the Dev server with the same results.  API console shows "Shaped Scripts ready" but no joy in using any of the commands. No messages at all in the API console after "Shaped Scripts Ready" even after issuing a build command or a spell import command.  I get ZERO feedback and nothing at all happens.  This also doesnt matter if it is in my game campaign or a brand new one I just created with no other scripts involved.
1442873170
Kryx
Pro
Sheet Author
API Scripter
@Mike sounds like your API is broken. Off to the bug forum! Though I've had it start working again after a day or so, so who knows.
Yea it seems so. Another DM in my gaming group also uses the script and he isnt even getting the "Shaped Scripts Ready" message in the API Console.
I fixed my issue...well discovered the actual problem.   It seems it was the "cloaker" statblock I was trying to import that kept breaking the API when I tried to parse it. After resetting the script I was again able to import monsters just not the one I was attempting to do at the time.  Not sure what is causing it to break at this point as I get no feedback in the console.  Not a big deal I will just manually enter this one hehe. Here is the copy/paste of the stat block in question if anyone not as old and blind as I am wants to find where it might be breaking. CLOAKER Large aberration, chaotic neutral Armor Class 14 (natural armor) Hit Points 78 (12d10 + 12) Speed 10ft., fly 40 ft. Skills Stealth +5 Senses darkvision 60ft., passive Perception 11 Languages Deep Speech, Undercommon Challenge 8 (3,900 XP) STR 17 (+3) DEX 15 (+2) CON 12 (+1) INT 13 (+1) WIS 12 (+1) CHA 14 (+2) Damage Transfer. While attached to a creature, the cloaker takes only half the damage dealt to it (rounded down). and that creature takes the other half. False Appearance. While the cloaker remains motionless without its underside exposed, it is indistinguishable from a dark leather cloak. Light Sensitivity. While in bright light, the cloaker has disadvantage on attack rolls and Wisdom (Perception) checks that rely on sight. ACTIONS Multiattack. The cloaker makes two attacks: one with its bite and one with its tail. Bite. Melee Weapon Attack: +6 to hit, reach 5 ft., one creature. Hit: 10 (2d6 + 3) piercing damage, and if the target is Large or smaller, the cloaker attaches to it. lfthe cloaker has advantage against the target, the cloaker attaches to the target's head, and the target is blinded and unable to breathe while the cloaker is attached. While attached, the cloaker can make this attack only against the target and has advantage on the attack roll. The cloaker can detach itself by spending 5 feet of its movement. A creature, including the target, can take its action to detach the cloaker by succeeding on a DC 16 Strength check. Tail. Melee Weapon Attack: +6 to hit, reach 10ft., one creature. Hit: 7 (1d8 + 3) slashing damage. Moan. Each creature within 60 feet of the cloaker that can hear its moan and that isn't an aberration must succeed on a DC 13 Wisdom saving throw or become frightened until the end of the cloaker's next turn. If a creature's saving throw is successful, the creature is immune to the cloaker's moan for the next 24 hours Phantasms (Recharges after a Short or Long Rest). The cloaker magically creates three illusory duplicates of itself if it isn't in bright light. The duplicates move with it and mimic its actions, s hifting position so as to make it impossible to track which cloaker is the real one. If the cloaker is ever in an area of bright light, the duplicates disappear. Whenever any creature targets the cloaker with an attack or a harmful spell while a duplicate remains, that creature rolls randomly to determine whether it targets the cloaker or one of the duplicates. A creature is unaffected by this magical effect if it can't see or if it relies on senses other than sight. A duplicate has the cloaker's AC and uses its saving throws. If an attack hits a duplicate, or if a duplicate fails a saving throw against an effect that deals damage, the duplicate disappears.
Spaces probably being #1
1442996210
Kryx
Pro
Sheet Author
API Scripter
Likely the recharge on phantasms if I had to guess.
Kryx said: Likely the recharge on phantasms if I had to guess. It's something to do with that block anyway.  I removed the CRLF in the description for Phantasm (end of "the duplicates disappear." ) and it works. CLOAKER Large aberration, chaotic neutral Armor Class 14 (natural armor) Hit Points 78 (12d10 + 12) Speed 10ft., fly 40 ft. Skills Stealth +5 Senses darkvision 60ft., passive Perception 11 Languages Deep Speech, Undercommon Challenge 8 (3,900 XP) STR 17 (+3) DEX 15 (+2) CON 12 (+1) INT 13 (+1) WIS 12 (+1) CHA 14 (+2) Damage Transfer. While attached to a creature, the cloaker takes only half the damage dealt to it (rounded down). and that creature takes the other half. False Appearance. While the cloaker remains motionless without its underside exposed, it is indistinguishable from a dark leather cloak. Light Sensitivity. While in bright light, the cloaker has disadvantage on attack rolls and Wisdom (Perception) checks that rely on sight. ACTIONS Tail. Melee Weapon Attack: +6 to hit, reach 10ft., one creature. Hit: 7 (1d8 + 3) slashing damage. Multiattack. The cloaker makes two attacks: one with its bite and one with its tail. Bite. Melee Weapon Attack: +6 to hit, reach 5 ft., one creature. Hit: 10 (2d6 + 3) piercing damage, and if the target is Large or smaller, the cloaker attaches to it. lfthe cloaker has advantage against the target, the cloaker attaches to the target's head, and the target is blinded and unable to breathe while the cloaker is attached. While attached, the cloaker can make this attack only against the target and has advantage on the attack roll. The cloaker can detach itself by spending 5 feet of its movement. A creature, including the target, can take its action to detach the cloaker by succeeding on a DC 16 Strength check. Moan. Each creature within 60 feet of the cloaker that can hear its moan and that isn't an aberration must succeed on a DC 13 Wisdom saving throw or become frightened until the end of the cloaker's next turn. If a creature's saving throw is successful, the creature is immune to the cloaker's moan for the next 24 hours Phantasms (Recharges after a Short or Long Rest). The cloaker magically creates three illusory duplicates of itself if it isn't in bright light. The duplicates move with it and mimic its actions, s hifting position so as to make it impossible to track which cloaker is the real one. If the cloaker is ever in an area of bright light, the duplicates disappear. Whenever any creature targets the cloaker with an attack or a harmful spell while a duplicate remains, that creature rolls randomly to determine whether it targets the cloaker or one of the duplicates. A creature is unaffected by this magical effect if it can't see or if it relies on senses other than sight. A duplicate has the cloaker's AC and uses its saving throws. If an attack hits a duplicate, or if a duplicate fails a saving throw against an effect that deals damage, the duplicate disappears.
First of thanks for this, you've saved me a lot of time, however I am having issues while trying to import the Ancient dragons. I'm not quite sure whats going on, I'm not getting any error messages, but its not importing either; it seems to be doing something with the api, as I am having to reset it to get it to work again.
1443548508
Kryx
Pro
Sheet Author
API Scripter
@Zyn: Seems like a similar error to above. Try removing blocks at a time - specifically the recharge. Post the stat block and maybe it can be fixed.
Tried to do Ancient Gold, Bronze, Copper and Silver, and had no luck, Tried both the stat block copy from the book ANCIENT GOLD DRAGON Gargantuan dragon, lawful good Armor Class 22 (n atural armor) Hit Points 546 (28d20 + 252) Speed 40 ft., fly 80 ft. , swim 40 ft. STR 30 (+10) DEX 14 (+2) CON 29 (+9) INT 18 (+4) WIS 17 (+3) Saving Throws Dex +9, Con +16, Wis +10, Cha +16 CHA 28 (+9) Skills In sight +10, Perception +17, Persuasion +1 6, Stealth +9 Damage Immunities fire Senses blindsight 60ft., darkvision 120ft., passive Perception 27 Languages Common, Draconic Challenge 24 (36,500 XP) Amphibious. The dragon can breathe air and water. Legendary Resistance (3jDay). If the dragon fails a saving throw, it can choose to succeed instead. ACTIONS Multiattack. The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws. Bite. Melee Weapon Attack:+ 17 to hit, reach 15 ft., one target. Hit: 21 (2d10 + 10) piercing damage. Claw. Melee Weapon Attack: +17 to hit, reach 10ft., one target. Hit: 17 (2d6 + 10) slashing damage. Tail. Melee Weapon Attack:+ 17 to hit, reach 20ft., one target. Hit: 19 (2d8 + 10) bludgeoning damage. Frightful Presence. Each creature of the dragon 's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 24 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours. Breath Weapons (Recharge 5-6}. The dragon uses one of the following breath weapons. Fire Breath. The dragon exhales fire in a 90-foot cone. Each creature in that area must make a DC 24 Dexterity saving throw, taking 71 (l3d10) fire damage on a failed save, or half as much damage on a successful one. Weakening Breath. The dragon exhales gas in a 90-foot cone. Each creature in that area must succeed on a DC 24 Strength saving throw or have disadvantage on Strength-based attack rolls, Strength checks, and Strength saving throws for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. Change Shape. The dragon magically polymorphs into a humanoid or beast that has a challenge rating no higher than its own, or back into its true form. It reverts to its true form if it dies. Any equipment it is wearing or carrying is absorbed or borne by the new form (the dragon's choice). In a new form, the dragon retains its alignment, hit points, Hit Dice, ability to speak, proficiencies, Legendary Resistance, lair actions, and Intelligence, Wisdom, and Charisma scores, as well as this action . Its statistics and capabilities are otherwise replaced by those of the new form, except any class features or legendary actions of that form . lEGENDARY ACTIONS The dragon can take 3 legendary actions, choosing from the options below. Only one legendary action option can be used at a time and only at the end of another creature's turn. The dragon regains spent legendary actions at the start of its turn. Detect. The dragon makes a Wisdom (Perception) check. Tail Attack. The dragon makes a tail attack. Wing Attack (Costs 2 Actions). The dragon beats its wings. Each creature within 15 feet of the dragon must succeed on a DC 25 Dexterity saving throw or take 17 (2d6 + 10) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed. and also one slightly changed just in a word document ANCIENT GOLD DRAGON Gargantuan Dragon, Lawful Good Armor Class 22 (natural armor) Hit Points 546 (28d20 + 252) Speed 40 ft., fly 80 ft., swim 40 ft. STR 30 (+10) DEX 14 (+2) CON 29 (+9) INT 18 (+4) WIS 17 (+3) Saving Throws Dex +9, Con +16, Wis +10, Cha +16 CHA 28 (+9) Skills In sight +10, Perception +17, Persuasion +1 6, Stealth +9 Damage Immunities Fire Senses blindsight 60ft., darkvision 120ft., passive Perception 27 Languages Common, Draconic Challenge 24 (36,500 XP) Amphibious. The Dragon can breathe air and water. Legendary Resistance (3/Day). If the Dragon fails a saving throw, it can choose to succeed instead. ACTIONS Multiattack. The Dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws. Bite. Melee Weapon Attack:+ 17 to hit, reach 15 ft., one target. Hit : 21 (2d10 + 10) Piercing damage. Claw. Melee Weapon Attack: +17 to hit, reach 10ft., one target. Hit: 17 (2d6 + 10) Slashing damage. Tail. Melee Weapon Attack:+ 17 to hit, reach 20ft., one target. Hit : 19 (2d8 + 10) Bludgeoning damage. Frightful Presence. Each creature of the Dragon 's choice that is within 120 feet of the Dragon and aware of it must succeed on a DC 24 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the Dragon's Frightful Presence for the next 24 hours. Breath Weapons (Recharge 5-6}. The Dragon uses one of the following breath weapons. Fire Breath. The Dragon exhales Fire in a 90-foot cone. Each creature in that area must make a DC 24 Dexterity saving throw, taking 71 (l3d10) Fire damage on a failed save, or half as much damage on a successful one. Weakening Breath. The Dragon exhales gas in a 90-foot cone. Each creature in that area must succeed on a DC 24 Strength saving throw or have disadvantage on Strength-based attack rolls, Strength checks, and Strength saving throws for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. Change Shape. The Dragon magically polymorphs into a humanoid or beast that has a challenge rating no higher than its own, or back into its true form. It reverts to its true form if it dies. Any equipment it is wearing or carrying is absorbed or borne by the new form (the Dragon's choice). In a new form, the Dragon retains its alignment, hit points, Hit Dice, ability to speak, proficiencies, Legendary Resistance, lair actions, and Intelligence, Wisdom, and Charisma scores, as well as this action . Its statistics and capabilities are otherwise replaced by those of the new form, except any class features or legendary actions of that form . LEGENDARY ACTIONS The Dragon can take 3 legendary actions, choosing from the options below. Only one legendary action option can be used at a time and only at the end of another creature's turn. The Dragon regains spent legendary actions at the start of its turn. Detect. The Dragon makes a Wisdom (Perception) check. Tail Attack. The Dragon makes a tail attack. Wing Attack (Costs 2 Actions). The Dragon beats its wings. Each creature within 15 feet of the Dragon must succeed on a DC 25 Dexterity saving throw or take 17 (2d6 + 10) Bludgeoning damage and be knocked prone. The Dragon can then fly up to half its flying speed. I also had some issues with a dracolich, which I can't get to port ANCIENT RED DRACOLICH Gargantuan dragon, Chaotic Evil Armor Class 22 (natural armor) Hit Points 547 (28d20 + 252) Speed 40 ft., climb 40 ft., fly 80ft. STR 30 (+10) DEX 10 (+0) CON 29 (+9) INT 18 (+4) WIS 15 (+2) Saving Throws Dex +7, Con +16, Wis +9, Cha +13 Skills Perception + 16, Stealth +7 Damage Resistances Necrotic Damage Immunities Fire, Poison Condition Immunities charmed, exhaustion, frightened, paralyzed, Poisoned CHA 23 (+6) Senses blindsight 60ft., darkvision 120ft., passive Perception 26 Languages Common, Draconic Challenge 25 (75,000 XP) Legendary Resistance (3/Day). If the dragon fails a saving throw, it can choose to succeed instead. ACTIONS Multiattack. The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws. Bite. Melee Weapon Attack: +17 to hit, reach 15 ft., one target. Hit: 21 (2d10 + 10) Piercing damage plus 14 (4d6) Fire damage. Claw. Melee Weapon Attack: +17 to hit, reach 10ft., one target. Hit: 17 (2d6 + 10) Slashing damage. Tail. Melee Weapon Attack: +17 to hit, reach 20 ft., one target. Hit: 19 (2d8 + 10) Bludgeoning damage. Frightful Presence. Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 22 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours. Fire Breath (Recharge 5-6). The dragon exhales acid in a 690-foot cone. Each creature in that line must make a DC 25 Dexterity saving throw, taking 91 (26d6) Firedamage on a failed save, or half as much damage on a successful one. LEGENDARY ACTIONS The dragon can take 3 legendary actions , choosing from the options below. Only one legendary action option can be used at a time and only at the end of another creature's turn. The dragon regains spent legendary actions at the start of its turn . Detect. The dragon makes a Wisdom (Perception) check. Tail Attack. The dragon makes a tail attack. Wing Attack (Costs 2 Actions). The dragon beats its wings. Each creature within 15 feet of the dragon must succeed on a DC 26 Dexterity saving throw or take 17 (2d6 + 10) Bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed. I had some trouble with some of the chromatic dragons, but after a couple of script resets they worked for some reason, the metallic ones however I couldn't get to work.
1443562430

Edited 1443562512
The only problems I see with the first dragon stat block is in this line: Skills In sight +10, Perception +17, Persuasion +1 6, Stealth +9 Just remove the space between "In" and "sight" and the space between "+1" and "6", like this: Skills Insight +10, Perception +17, Persuasion +16, Stealth +9 And it imported just fine. The Ancient Red Dracolich imported without modification.
1443603294
Kryx
Pro
Sheet Author
API Scripter
Ya, those stat blocks are really dirty. I clean up some things, but not all. Sounds like they work if you clean them up.
Hey Kryx, You say the spell-import function is in its own script now on Github.  Do you have a link to that script? Thanks, Malchior