All user data for FoundryVTT. Includes worlds, systems, modules, and any asset in the "foundryuserdata" directory. Does NOT include the FoundryVTT installation itself.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

326 lines
12 KiB

  1. Hooks.once("ready", async function () {
  2. if (!game.automatedevocations) {
  3. game.automatedevocations = {};
  4. game.automatedevocations[game.system.id] = {};
  5. }
  6. if (game.system.id == "dnd5e") {
  7. game.automatedevocations.dnd5e = {
  8. "Arcane Hand": [
  9. {
  10. creature: "Arcane Hand",
  11. number: 1,
  12. },
  13. ],
  14. "Flaming Sphere": [
  15. {
  16. creature: "Flaming Sphere",
  17. number: 1,
  18. },
  19. ],
  20. "Spiritual Weapon": [
  21. {
  22. creature: "Spiritual Weapon",
  23. number: 1,
  24. },
  25. ],
  26. "Guardian of Faith": [
  27. {
  28. creature: "Spectral Guardian",
  29. number: 1,
  30. },
  31. ],
  32. "Faithful Hound": [
  33. {
  34. creature: "Phantom Watchdog",
  35. number: 1,
  36. },
  37. ],
  38. "Find Steed": [
  39. {
  40. creature: "Warhorse",
  41. number: 1,
  42. },
  43. {
  44. creature: "Pony",
  45. number: 1,
  46. },
  47. {
  48. creature: "Camel",
  49. number: 1,
  50. },
  51. {
  52. creature: "Elk",
  53. number: 1,
  54. },
  55. {
  56. creature: "Mastiff",
  57. number: 1,
  58. },
  59. ],
  60. "Giant Insect": [
  61. {
  62. creature: "Giant Centipede",
  63. number: 10,
  64. },
  65. {
  66. creature: "Giant Spider",
  67. number: 3,
  68. },
  69. {
  70. creature: "Giant Wasp",
  71. number: 5,
  72. },
  73. {
  74. creature: "Giant Scorpion",
  75. number: 1,
  76. },
  77. ],
  78. "Arcane Sword": [
  79. {
  80. creature: "Arcane Sword",
  81. number: 1,
  82. },
  83. ],
  84. "Conjure Animals": (data) => {
  85. let multiplier = 1;
  86. if (data.level >= 5) multiplier = 2;
  87. if (data.level >= 7) multiplier = 3;
  88. let beasts = game.actors
  89. .filter((a) => a.type === "npc" && a.system.details.type?.value == "beast" && a.system.details.cr <= 2)
  90. .sort((a, b) => {
  91. return a.system.details.cr < b.system.details.cr ? 1 : -1;
  92. });
  93. let creatures = [];
  94. for (let beast of beasts) {
  95. let number = 1;
  96. const cr = beast.system.details.cr;
  97. if (cr == 2) number = 1;
  98. else if (cr == 1) number = 2;
  99. else if (cr == 0.5) number = 4;
  100. else if (cr <= 0.25) number = 8;
  101. creatures.push({
  102. creature: beast.name,
  103. number: number * multiplier,
  104. });
  105. }
  106. return creatures;
  107. },
  108. "Conjure Celestial": (data) => {
  109. let celestials = game.actors
  110. .filter((a) => a.type === "npc" && a.system.details.type?.value == "celestial" && a.system.details.cr <= 4)
  111. .sort((a, b) => {
  112. return a.system.details.cr < b.system.details.cr ? 1 : -1;
  113. });
  114. let creatures = [];
  115. for (let celestial of celestials) {
  116. creatures.push({
  117. creature: celestial.name,
  118. number: 1,
  119. });
  120. }
  121. return creatures;
  122. },
  123. "Conjure Elemental": (data) => {
  124. let elementals = game.actors
  125. .filter((a) => a.type === "npc" && a.system.details.type?.value == "elemental" && a.system.details.cr <= data.level)
  126. .sort((a, b) => {
  127. return a.system.details.cr < b.system.details.cr ? 1 : -1;
  128. });
  129. let creatures = [];
  130. for (let elemental of elementals) {
  131. creatures.push({
  132. creature: elemental.name,
  133. number: 1,
  134. });
  135. }
  136. return creatures;
  137. },
  138. "Conjure Fey": (data) => {
  139. let feys = game.actors
  140. .filter((a) => a.type === "npc" && a.system.details.type?.value == "fey" && a.system.details.cr <= data.level)
  141. .sort((a, b) => {
  142. return a.system.details.cr < b.system.details.cr ? 1 : -1;
  143. });
  144. let creatures = [];
  145. for (let fey of feys) {
  146. creatures.push({
  147. creature: fey.name,
  148. number: 1,
  149. });
  150. }
  151. return creatures;
  152. },
  153. "Conjure Minor Elementals": (data) => {
  154. let multiplier = 1;
  155. if (data.level >= 6) multiplier = 2;
  156. if (data.level >= 8) multiplier = 3;
  157. let elementals = game.actors
  158. .filter((a) => a.type === "npc" && a.system.details.type?.value == "elemental" && a.system.details.cr <= 2)
  159. .sort((a, b) => {
  160. return a.system.details.cr < b.system.details.cr ? 1 : -1;
  161. });
  162. let creatures = [];
  163. for (let elemental of elementals) {
  164. let number = 1;
  165. const cr = elemental.system.details.cr;
  166. if (cr == 2) number = 1;
  167. else if (cr == 1) number = 2;
  168. else if (cr == 0.5) number = 4;
  169. else if (cr <= 0.25) number = 8;
  170. creatures.push({
  171. creature: elemental.name,
  172. number: number * multiplier,
  173. });
  174. }
  175. return creatures;
  176. },
  177. "Conjure Woodland Beings": (data) => {
  178. let multiplier = 1;
  179. if (data.level >= 6) multiplier = 2;
  180. if (data.level >= 8) multiplier = 3;
  181. let feys = game.actors
  182. .filter((a) => a.type === "npc" && a.system.details.type?.value == "fey" && a.system.details.cr <= data.level)
  183. .sort((a, b) => {
  184. return a.system.details.cr < b.system.details.cr ? 1 : -1;
  185. });
  186. let creatures = [];
  187. for (let fey of feys) {
  188. let number = 1;
  189. const cr = fey.system.details.cr;
  190. if (cr == 2) number = 1;
  191. else if (cr == 1) number = 2;
  192. else if (cr == 0.5) number = 4;
  193. else if (cr <= 0.25) number = 8;
  194. creatures.push({
  195. creature: fey.name,
  196. number: number * multiplier,
  197. });
  198. }
  199. return creatures;
  200. },
  201. "Animate Dead": (data) => {
  202. let multiplier = 1 + (data.level - 3) * 2;
  203. return [
  204. {
  205. creature: "Skeleton",
  206. number: multiplier,
  207. },
  208. {
  209. creature: "Zombie",
  210. number: multiplier,
  211. },
  212. ];
  213. },
  214. "Create Undead": (data) => {
  215. let multiplier = data.level - 3;
  216. if (data.level == 8) {
  217. return [
  218. {
  219. creature: "Ghoul",
  220. number: 5,
  221. },
  222. {
  223. creature: "Ghast",
  224. number: 2,
  225. },
  226. {
  227. creature: "Wights",
  228. number: 2,
  229. },
  230. ];
  231. }
  232. if (data.level == 9) {
  233. return [
  234. {
  235. creature: "Ghoul",
  236. number: 6,
  237. },
  238. {
  239. creature: "Ghast",
  240. number: 3,
  241. },
  242. {
  243. creature: "Wights",
  244. number: 3,
  245. },
  246. {
  247. creature: "Mummy",
  248. number: 2,
  249. },
  250. ];
  251. }
  252. return [
  253. {
  254. creature: "Ghoul",
  255. number: multiplier,
  256. },
  257. ];
  258. },
  259. "Find Familiar": [
  260. {
  261. creature: "Bat",
  262. number: 1,
  263. },
  264. {
  265. creature: "Cat",
  266. number: 1,
  267. },
  268. {
  269. creature: "Crab",
  270. number: 1,
  271. },
  272. {
  273. creature: "Frog",
  274. number: 1,
  275. },
  276. {
  277. creature: "Hawk",
  278. number: 1,
  279. },
  280. {
  281. creature: "Lizard",
  282. number: 1,
  283. },
  284. {
  285. creature: "Octopus",
  286. number: 1,
  287. },
  288. {
  289. creature: "Owl",
  290. number: 1,
  291. },
  292. {
  293. creature: "Poisonous Snake",
  294. number: 1,
  295. },
  296. {
  297. creature: "Quipper",
  298. number: 1,
  299. },
  300. {
  301. creature: "Rat",
  302. number: 1,
  303. },
  304. {
  305. creature: "Raven",
  306. number: 1,
  307. },
  308. {
  309. creature: "Sea Horse",
  310. number: 1,
  311. },
  312. {
  313. creature: "Spider",
  314. number: 1,
  315. },
  316. {
  317. creature: "Weasel",
  318. number: 1,
  319. },
  320. ],
  321. };
  322. }
  323. game.automatedevocations.originalBindings = deepClone(game.automatedevocations[game.system.id]);
  324. game.automatedevocations[game.system.id] = mergeObject(game.automatedevocations[game.system.id], game.settings.get(AECONSTS.MN, "customautospells"));
  325. });