Guest User

Untitled

a guest
Feb 4th, 2020
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.49 KB | None | 0 0
  1. var iFileName = "DragonKnightClass.json"; // Optional; This is how the file will be named in the sheet if you import it as a file and not copy-paste its content. Only the first occurrence of this variable will be used
  2. //RequiredSheetVersion(12.999); // Optional; This is the minimum required version number of the sheet for the script to work. If the sheet being used to import the script is of an earlier version, the user will be warned
  3.  
  4. ClassList["dragonknight"] = { //Object name; Note the use of only lower case! Also note the absence of the word "var" and the use of brackets []
  5.  
  6. regExpSearch : /^(?=.*dragon)(?=.*knight).*$/i, //required; regular expression of what to look for (i.e. now it looks for any entry that has both the words "my" and "class" in it, disregarding capitalization). If this looks too complicated, just write: /myclass/i
  7.  
  8. name : "Dragon Knight", //required; the name to use for the class
  9.  
  10. source : ["LVLC", 0], //required; the source and the page number. "HB" stands for homebrew. See the "Complete SourceList" for an overview of sources that are already defined. Or define a new source using the "Homebrew Syntax - SourceList.js". // This can be an array of arrays to indicate the things appears in multiple sources. For example, if something appears on page 7 of the Elemental Evil Player's Companion and on page 115 of the Sword Coast Adventure Guide, use the following: [["E", 7], ["S", 115]]
  11.  
  12. primaryAbility : "\n \u2022 Dragon Knight: Strength;", //required; the text to display when citing the primary ability of the class
  13.  
  14. prereqs : "\n \u2022 Dragon Knight: Strength and Charisma 13;", //required; the text to display when citing the prerequisite for the class when multiclassing
  15.  
  16. die : 10, //required; the type of hit die the class has (i.e. 10 means d10)
  17.  
  18. improvements : [0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5], //required; the amount of ability score improvements (or feats) at each level. Note that there are 20 entries, one for each level. This example uses the Fighter's progression
  19.  
  20. saves : ["Cha", "Con"], //required; the two save proficiencies.
  21.  
  22. skills : ["\n\n" + toUni("Dragon Knight") + ": Choose two from Arcana, Animal Handling, Athletics, Deception, Intimidation, Perception, and Persuasion.", "\n\n"], //required; the text to display for skill proficiencies. Note the \n\n at the start, they are important! The first entry is for when the class is the primary class, the second entry is for when the class is taken later as part of a multiclass
  23.  
  24. /* SYNTAX CHANGE v12.998 >> old syntax for 'tools' and 'languages' are no longer supported!! */
  25. //toolProfs : { // optional; this is an object with arrays with the tool proficiencies gained. Each entry in an array can be its own array of 2 entries. The first entry is the name of the tool and the second entry is either 1) a number if the tool is yet to be chosen, or 2) the 3-letter ability score abbreviation if the tool is to be listed in the skill section and have a bonus calculated
  26. // primary : [["Musical instrument", 3], ["Thieves' tools", "Dex"]], // optional; the tool proficiencies gained if the class is the primary class (i.e. taken at 1st level)
  27. // secondary : [["Musical instrument", 1]] // optional; the tool proficiencies gained if the class is not the primary class (i.e. taken at a later level)
  28. //},
  29.  
  30. armor : [ //required; the 4 entries are for: ["light", "medium", "heavy", "shields"]
  31. [true, true, true, true], //required; the armor proficiencies if this is the first or only class
  32. [true, true, false, true] //required; the armor proficiencies if this class is multiclassed with (so not taken at level 1, but later)
  33. ],
  34.  
  35. weapons : [ //required; the 3 entries are for: ["simple", "martial", "other"]
  36. [true, true, [""]], //required; the weapon proficiencies if this is the first or only class
  37. [true, true, [""]] //required; the weapon proficiencies if this class is multiclassed with (so not taken at level 1, but later)
  38. ],
  39.  
  40. equipment : "Dragon Knight starting equipment:\n \u2022 Chain mail, scale mail -or- leather armor;\n \u2022 A martial weapon and a shield -or- two martial weapons;\n \u2022 A light crossbow and 20 bolts -or- five javelins;\n \u2022 A dungeoneer's pack -or- an explorer's pack.\n\nAlternatively, choose 5d4 \xD7 10 gp worth of starting equipment instead of both the class' and the background's starting equipment.", //required; the text to display when citing the starting equipment
  41.  
  42. subclasses : ["Dragon Knight Practice", [ "elemental", "valiant", "platinum", "shadow"]], //required; the names of the subclasses. The first entry is the overall name that is given to the subclasses, the second entry is a list of the subclass, using the exact names of the entry of the subclasses in the ClassSubList. //Note that if one of the entries in the array of subclasses doesn't exist in the ClassSubList, the sheet will throw an error as soon as you make a character with levels in this class
  43. //IMPORTANT: for any subclass you add using the AddSubClass() function, don't list them here! The AddSubClass() function makes its own entry in this array! If you have entries here that don't exist (because you didn't add any ClassSubList entry, or added it using the AddSubClass() function, then the sheet will throw strange errors)!
  44.  
  45.  
  46. attacks : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], //required; the amount of attacks at each level. Note that there are 20 entries, one for each level.
  47.  
  48. features : { //required; the class features. Each works the same way, so only a couple of example are given. You can add as many as you want
  49.  
  50. "dragon covenant" : {
  51. name : "Dragon Covenant",
  52. source : ["LVLC", 0],
  53. minlevel : 1,
  54. description : "\n " + "I can make small sensory effects appropriate to the color of my dragon and I can speak Draconic.",
  55. languageProfs : ["Draconic"],
  56.  
  57. },
  58.  
  59. "dragon companion" : {
  60. name : "Dragon Companion",
  61. source : ["LVLC", 0],
  62. minlevel : 1,
  63. description : "\n " + "Choose the type of Dragon using the \"Choose Feature\" button above",
  64. choices : ["Black", "Blue", "Brass", "Bronze", "Copper", "Gold", "Green", "Red", "Silver", "White"],
  65. "black" : {
  66. name : "Black Dragon",
  67. description : "\n " + "I have formed a covenant with a black dragon. If I die, my dragon will die after a number of hours equal to my dragon knight level. If my dragon is slain, I can spend 8 hours, 25 gp, and any number of hit dice, conducting a ritual to bring it back: a Charisma check with a DC of 15 - the number of hit dice expended (min DC 5). On a fail, it is revived, I can't regain those hit dice until a week later, and we both have 3 levels of exhaustion. On a success, the dragon is revived.",
  68. dependentChoices : "acid"
  69. },
  70. "blue" : {
  71. name : "Blue Dragon",
  72. description : "\n " + "I have formed a covenant with a blue dragon. If I die, my dragon will die after a number of hours equal to my dragon knight level. If my dragon is slain, I can spend 8 hours, 25 gp, and any number of hit dice, conducting a ritual to bring it back: a Charisma check with a DC of 15 - the number of hit dice expended (min DC 5). On a fail, it is revived, I can't regain those hit dice until a week later, and we both have 3 levels of exhaustion. On a success, the dragon is revived.",
  73. dependentChoices : "lightning"
  74. },
  75. "brass" : {
  76. name : "Brass Dragon",
  77. description : "\n " + "I have formed a covenant with a brass dragon. If I die, my dragon will die after a number of hours equal to my dragon knight level. If my dragon is slain, I can spend 8 hours, 25 gp, and any number of hit dice, conducting a ritual to bring it back: a Charisma check with a DC of 15 - the number of hit dice expended (min DC 5). On a fail, it is revived, I can't regain those hit dice until a week later, and we both have 3 levels of exhaustion. On a success, the dragon is revived.",
  78. dependentChoices : "fire"
  79. },
  80. "bronze" : {
  81. name : "Bronze Dragon",
  82. description : "\n " + "I have formed a covenant with a bronze dragon. If I die, my dragon will die after a number of hours equal to my dragon knight level. If my dragon is slain, I can spend 8 hours, 25 gp, and any number of hit dice, conducting a ritual to bring it back: a Charisma check with a DC of 15 - the number of hit dice expended (min DC 5). On a fail, it is revived, I can't regain those hit dice until a week later, and we both have 3 levels of exhaustion. On a success, the dragon is revived.",
  83. dependentChoices : "lightning"
  84. },
  85. "copper" : {
  86. name : "Copper Dragon",
  87. description : "\n " + "I have formed a covenant with a copper dragon. If I die, my dragon will die after a number of hours equal to my dragon knight level. If my dragon is slain, I can spend 8 hours, 25 gp, and any number of hit dice, conducting a ritual to bring it back: a Charisma check with a DC of 15 - the number of hit dice expended (min DC 5). On a fail, it is revived, I can't regain those hit dice until a week later, and we both have 3 levels of exhaustion. On a success, the dragon is revived.",
  88. dependentChoices : "acid"
  89. },
  90. "gold" : {
  91. name : "Gold Dragon",
  92. description : "\n " + "I have formed a covenant with a gold dragon. If I die, my dragon will die after a number of hours equal to my dragon knight level. If my dragon is slain, I can spend 8 hours, 25 gp, and any number of hit dice, conducting a ritual to bring it back: a Charisma check with a DC of 15 - the number of hit dice expended (min DC 5). On a fail, it is revived, I can't regain those hit dice until a week later, and we both have 3 levels of exhaustion. On a success, the dragon is revived.",
  93. dependentChoices : "fire"
  94. },
  95. "green" : {
  96. name : "Green Dragon",
  97. description : "\n " + "I have formed a covenant with a green dragon. If I die, my dragon will die after a number of hours equal to my dragon knight level. If my dragon is slain, I can spend 8 hours, 25 gp, and any number of hit dice, conducting a ritual to bring it back: a Charisma check with a DC of 15 - the number of hit dice expended (min DC 5). On a fail, it is revived, I can't regain those hit dice until a week later, and we both have 3 levels of exhaustion. On a success, the dragon is revived.",
  98. dependentChoices : "poison"
  99. },
  100. "red" : {
  101. name : "Red Dragon",
  102. description : "\n " + "I have formed a covenant with a red dragon. If I die, my dragon will die after a number of hours equal to my dragon knight level. If my dragon is slain, I can spend 8 hours, 25 gp, and any number of hit dice, conducting a ritual to bring it back: a Charisma check with a DC of 15 - the number of hit dice expended (min DC 5). On a fail, it is revived, I can't regain those hit dice until a week later, and we both have 3 levels of exhaustion. On a success, the dragon is revived.",
  103. dependentChoices : "fire"
  104. },
  105. "silver" : {
  106. name : "Silver Dragon",
  107. description : "\n " + "I have formed a covenant with a silver dragon. If I die, my dragon will die after a number of hours equal to my dragon knight level. If my dragon is slain, I can spend 8 hours, 25 gp, and any number of hit dice, conducting a ritual to bring it back: a Charisma check with a DC of 15 - the number of hit dice expended (min DC 5). On a fail, it is revived, I can't regain those hit dice until a week later, and we both have 3 levels of exhaustion. On a success, the dragon is revived.",
  108. dependentChoices : "cold"
  109. },
  110. "white" : {
  111. name : "White Dragon",
  112. description : "\n " + "I have formed a covenant with a white dragon. If I die, my dragon will die after a number of hours equal to my dragon knight level. If my dragon is slain, I can spend 8 hours, 25 gp, and any number of hit dice, conducting a ritual to bring it back: a Charisma check with a DC of 15 - the number of hit dice expended (min DC 5). On a fail, it is revived, I can't regain those hit dice until a week later, and we both have 3 levels of exhaustion. On a success, the dragon is revived.",
  113. dependentChoices : "cold"
  114. },
  115. },
  116.  
  117. "fighting style" : {
  118. name : "Fighting Style",
  119. source : [["SRD", 24], ["P", 72]],
  120. minlevel : 2,
  121. description : "\n " + "Choose a Fighting Style for the fighter using the \"Choose Feature\" button above",
  122. choices : ["Archery", "Defense", "Dueling", "Great Weapon Fighting", "Protection", "Two-Weapon Fighting"],
  123. "archery" : FightingStyles.archery,
  124. "defense" : FightingStyles.defense,
  125. "dueling" : FightingStyles.dueling,
  126. "great weapon fighting" : FightingStyles.great_weapon,
  127. "protection" : FightingStyles.protection,
  128. "two-weapon fighting" : FightingStyles.two_weapon
  129. },
  130.  
  131. "eye for detail" : {
  132. name : "Eye for Detail",
  133. source : ["LVLC", 0],
  134. minlevel : 2,
  135. description : "\n " + "I can spend 1 minute studying a gem or art piece to determine its value, and either the type of gemstone or age of the piece. I can cast the identify spell as a ritual.",
  136. },
  137.  
  138. "draconic nature resistance" : {
  139. name : "Draconic Nature",
  140. source : ["LVLC", 0],
  141. minlevel : 11,
  142. description : "\n " + "Choose the type of dragon damage appropriate to your dragon using the \"Choose Feature\" button above",
  143. choices : ["Acid", "Cold", "Fire", "Lightning", "Poison"],
  144. "acid" : {
  145. name : "Acid Resistance",
  146. description : "\n " + "I am resistant to acid damage.",
  147. dmgres : ["Acid"]
  148. },
  149. "cold" : {
  150. name : "Cold Resistance",
  151. description : "\n " + "I am resistant to cold damage.",
  152. dmgres : ["Cold"]
  153. },
  154. "fire" : {
  155. name : "Fire Resistance",
  156. description : "\n " + "I am resistant to fire damage.",
  157. dmgres : ["Fire"]
  158. },
  159. "lightning" : {
  160. name : "Lightning Resistance",
  161. description : "\n " + "I am resistant to lightning damage.",
  162. dmgres : ["Lightning"]
  163. },
  164. "poison" : {
  165. name : "Poison Resistance",
  166. description : "\n " + "I am resistant to poison damage.",
  167. dmgres : ["Poison"]
  168. },
  169.  
  170. },
  171.  
  172. "draconic nature benefit" : {
  173. name : "Draconic Nature",
  174. source : ["LVLC", 0],
  175. minlevel : 11,
  176. description : "\n " + "Choose the dragonic nature benefit using the \"Choose Feature\" button above",
  177. choices : ["Scales", "Eyes", "Tail"],
  178. "scales" : {
  179. name : "Scales",
  180. description : "\n " + "Without armor, my AC is 10 + Dexterity modifier + Charisma modifier + shield.",
  181. armorAdd : "Unarmored Defense (Cha)"
  182. },
  183. "eyes" : {
  184. name : "Eyes",
  185. description : "\n " + "I gain proficiencies in Perception and Investigation and I have advantage on sight-based Perception and Investigation checks.",
  186. skillstxt : "\n\n" + toUni("Draconic Nature") + ": proficiency with Perception and Investigation.",
  187. eval : "AddSkillProf('Perception', true, false); AddSkillProf('Investigation', true, false);",
  188. removeeval : "AddSkillProf('Perception', false, false); AddSkillProf('Investigation', false, false);"
  189. },
  190. "tail" : {
  191. name : "Tail",
  192. description : "\n " + "I grew a tail. When I take the Attack action, I can use my tail to shove a creature within 10 feet of me as a bonus action.",
  193. action : ["bonus action", ""]
  194. },
  195. },
  196.  
  197.  
  198. "ancient resistance" : {
  199. name : "Ancient Resistance",
  200. source : ["LVLC", 0],
  201. minlevel : 17,
  202. description : "\n " + "Whenever my dragon or I would fail a saving throw, one of us can choose to succeed instead. We can't do so again until we finish a long rest.",
  203. usages : 1,
  204. recovery : "long rest",
  205. },
  206.  
  207. "essence of the covenant" : {
  208. name : "Essence of the Covenant",
  209. source : ["LVLC", 0],
  210. minlevel : 20,
  211. description : "\n " + "If my dragon and I are within 30 feet of each other, we can redirect all damage taken by one of us to the other. This damage cannot be reduced or prevented.",
  212. },
  213.  
  214.  
  215. "essence of the covenant additional" : {
  216. name : "Essence of the Covenant",
  217. source : ["LVLC", 0],
  218. minlevel : 20,
  219. description : "\n " + "I automatically succeed on the ability check to restore my dragon to life.",
  220. },
  221.  
  222. }
  223. };
  224.  
  225. AddSubClass( // this is the function you will be calling to add the variant
  226.  
  227. "dragonknight", // Parent Class object name; Required; This has to be the exact name of the class of which you are adding a subclass. Look for the name of the class in the ClassList variable. For the default 12 classes these names are: "barbarian", "bard", "cleric", "druid", "fighter", "monk", "paladin", "ranger", "rogue", "sorcerer", "warlock", and "wizard"
  228.  
  229. "rider", // Object name; Required; The name the entry in the ClassSubList will have. This can be anything, it is just something that the sheet uses to reference the new entry and it will never be printed anywhere
  230.  
  231. { // don't forget this opening bracket
  232.  
  233. regExpSearch : /^(?=.*rider)(?=.*dragonknight).*$/i, //required; regular expression of what to look for (i.e. now it looks for any entry that has both the words "special" and "me" in it, disregarding capitalization). If this looks too complicated, just write: /specialme/i
  234.  
  235. subname : "Rider Practice", //required; the name of the subclass
  236.  
  237. source : ["LVLC", 0], //required; the source and the page number. "HB" stands for homebrew. See the "Complete SourceList" for an overview of sources that are already defined. Or define a new source using the "Homebrew Syntax - SourceList.js". // This can be an array of arrays to indicate the things appears in multiple sources. For example, if something appears on page 7 of the Elemental Evil Player's Companion and on page 115 of the Sword Coast Adventure Guide, use the following: [["E", 7], ["S", 115]]
  238.  
  239. // after defining the above three, you don't need to define anything more, but you can. Defining more stuff will overwrite the entries as they are given in the ClassList. So if you do not need something to be different than the basics of the class (for example, you subclass uses the same spellcasting ability), then you don't need to define it again.
  240. // For the syntax of how to define more stuff, look at the ClassList (see "Homebrew Syntax - ClassList.js"). You can define all the same stuff in the same way. The below are a couple of examples:
  241.  
  242. fullname : "Rider Practice", //if no fullname is defined it will be automatically generated as "Class Name (Subclass name)". In this example that would be: "MyClass (Path of SpecialMe)"
  243.  
  244. features : { //unlike the other entries, "features" will not delete all the features from the ClassList, but will add to the features in the ClassList. For this to work properly, the feature object has to be named "subclassfeatureX" and not something appropriate for the feature. The below are the features of the purple Dragon Knight
  245.  
  246. "subclassfeature3" : { // has to start with "subclassfeature" followed by a number. Note that the name has to be unique for this subclass, but it can be the same name as one of the features of the class in the ClassList variable. If you use the same name as a feature in the ClassList variable, it will be overwritten with this entry
  247. name : "Dragon's Claw",
  248. source : ["LVLC", 0],
  249. minlevel : 3,
  250. description : "\n " + "When both my dragon and I are within 5 feet of a hostile creature, the creature has disadvantage on attack rolls that do not target me or my dragon.",
  251. },
  252. "subclassfeature3.1" : {
  253. name : "Dragon's Claw",
  254. source : ["LVLC", 0],
  255. minlevel : 3,
  256. description : "\n " + "When a creature would provoke an opportunity attack from me, I can use my reaction to attempt to grapple or shove the creature.",
  257. action : ["reaction", ""]
  258. },
  259. "subclassfeature3.2" : {
  260. name : "Dragon's Eye",
  261. source : ["LVLC", 0],
  262. minlevel : 3,
  263. description : "\n " + "I add my Charisma modifier to my initiative.",
  264. addMod : { type : "skill", field : "Init", mod : "Cha", text : "I can add my Charisma modifier to my initiative rolls." }
  265. },
  266. "subclassfeature3.3" : {
  267. name : "Dragon's Eye",
  268. source : ["LVLC", 0],
  269. minlevel : 3,
  270. description : "\n " + "As long as I can see my dragon, creatures it can see don't have advantage on attack rolls against me if they're hiding from me.",
  271. },
  272. "subclassfeature7" : {
  273. name : "Dragon's Scale",
  274. source : ["LVLC", 0],
  275. minlevel : 7,
  276. description : "\n " + "I can use an action to stabilize my dragon, without needing to make a Wisdom (Medicine) check. When stabilized this way, my dragon will regain 1 hit point after 1d4 minutes instead of 1d4 hours.",
  277. action : ["action",""],
  278. },
  279. "subclassfeature10" : {
  280. name : "Dragon's Wing",
  281. source : ["LVLC", 0],
  282. minlevel : 10,
  283. description : "\n " + "Mounting and dismounting my dragon only costs 5 feet of movement instead of half your speed, I have advantage on saving throws made to avoid falling off my dragon, and I don't take falling damage if I fall 20 feet or less.",
  284. },
  285. "subclassfeature15" : {
  286. name : "Dragon's Fang",
  287. source : ["LVLC", 0],
  288. minlevel : 15,
  289. description : "\n " + "If I'm within 5 feet of my dragon when they rampage, I can use my reaction to make a melee weapon attack against each creature within my reach that was attacked by my dragon during their rampage.",
  290. action : ["reaction", ""],
  291. },
  292. "subclassfeature18" : {
  293. name : "Dragon's Presence",
  294. source : ["LVLC", 0],
  295. minlevel : 18,
  296. description : "\n " + "when I hit a creature that is frightened of my dragon with a weapon attack, the attack is considered a critical hit.",
  297. },
  298. }
  299. }
  300. );
Advertisement
Add Comment
Please, Sign In to add comment