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.

349 lines
7.8 KiB

1 year ago
  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(
  90. (a) =>
  91. a.system.details.type?.value == "beast" &&
  92. a.system.details.cr <= 2
  93. )
  94. .sort((a, b) => {
  95. return a.system.details.cr < b.system.details.cr ? 1 : -1;
  96. });
  97. let creatures = [];
  98. for (let beast of beasts) {
  99. let number = 1;
  100. const cr = beast.system.details.cr;
  101. if(cr==2) number = 1;
  102. else if(cr==1) number = 2;
  103. else if(cr==0.5) number = 4;
  104. else if(cr<=0.25) number = 8;
  105. creatures.push({
  106. creature: beast.name,
  107. number: number*multiplier,
  108. });
  109. }
  110. return creatures;
  111. },
  112. "Conjure Celestial": (data) => {
  113. let celestials = game.actors
  114. .filter(
  115. (a) =>
  116. a.system.details.type?.value == "celestial" &&
  117. a.system.details.cr <= 4
  118. )
  119. .sort((a, b) => {
  120. return a.system.details.cr < b.system.details.cr ? 1 : -1;
  121. });
  122. let creatures = [];
  123. for (let celestial of celestials) {
  124. creatures.push({
  125. creature: celestial.name,
  126. number: 1,
  127. });
  128. }
  129. return creatures;
  130. },
  131. "Conjure Elemental": (data) => {
  132. let elementals = game.actors
  133. .filter(
  134. (a) =>
  135. a.system.details.type?.value == "elemental" &&
  136. a.system.details.cr <= data.level
  137. )
  138. .sort((a, b) => {
  139. return a.system.details.cr < b.system.details.cr ? 1 : -1;
  140. });
  141. let creatures = [];
  142. for (let elemental of elementals) {
  143. creatures.push({
  144. creature: elemental.name,
  145. number: 1,
  146. });
  147. }
  148. return creatures;
  149. },
  150. "Conjure Fey": (data) => {
  151. let feys = game.actors
  152. .filter(
  153. (a) =>
  154. a.system.details.type?.value == "fey" &&
  155. a.system.details.cr <= data.level
  156. )
  157. .sort((a, b) => {
  158. return a.system.details.cr < b.system.details.cr ? 1 : -1;
  159. });
  160. let creatures = [];
  161. for (let fey of feys) {
  162. creatures.push({
  163. creature: fey.name,
  164. number: 1,
  165. });
  166. }
  167. return creatures;
  168. },
  169. "Conjure Minor Elementals": (data) => {
  170. let multiplier = 1;
  171. if (data.level >= 6) multiplier = 2;
  172. if (data.level >= 8) multiplier = 3;
  173. let elementals = game.actors
  174. .filter(
  175. (a) =>
  176. a.system.details.type?.value == "elemental" &&
  177. a.system.details.cr <= 2
  178. )
  179. .sort((a, b) => {
  180. return a.system.details.cr < b.system.details.cr ? 1 : -1;
  181. });
  182. let creatures = [];
  183. for (let elemental of elementals) {
  184. let number = 1;
  185. const cr = elemental.system.details.cr;
  186. if(cr==2) number = 1;
  187. else if(cr==1) number = 2;
  188. else if(cr==0.5) number = 4;
  189. else if(cr<=0.25) number = 8;
  190. creatures.push({
  191. creature: elemental.name,
  192. number: number*multiplier,
  193. });
  194. }
  195. return creatures;
  196. },
  197. "Conjure Woodland Beings": (data) => {
  198. let multiplier = 1;
  199. if (data.level >= 6) multiplier = 2;
  200. if (data.level >= 8) multiplier = 3;
  201. let feys = game.actors
  202. .filter(
  203. (a) =>
  204. a.system.details.type?.value == "fey" &&
  205. a.system.details.cr <= data.level
  206. )
  207. .sort((a, b) => {
  208. return a.system.details.cr < b.system.details.cr ? 1 : -1;
  209. });
  210. let creatures = [];
  211. for (let fey of feys) {
  212. let number = 1;
  213. const cr = fey.system.details.cr;
  214. if(cr==2) number = 1;
  215. else if(cr==1) number = 2;
  216. else if(cr==0.5) number = 4;
  217. else if(cr<=0.25) number = 8;
  218. creatures.push({
  219. creature: fey.name,
  220. number: number*multiplier,
  221. });
  222. }
  223. return creatures;
  224. },
  225. "Animate Dead": (data) => {
  226. let multiplier = 1 + (data.level-3)*2;
  227. return [
  228. {
  229. creature: "Skeleton",
  230. number: multiplier,
  231. },
  232. {
  233. creature: "Zombie",
  234. number: multiplier,
  235. }
  236. ]
  237. },
  238. "Create Undead": (data) => {
  239. let multiplier = data.level-3
  240. if(data.level == 8){
  241. return [
  242. {
  243. creature: "Ghoul",
  244. number: 5,
  245. },
  246. {
  247. creature: "Ghast",
  248. number: 2,
  249. },
  250. {
  251. creature: "Wights",
  252. number: 2,
  253. }
  254. ]
  255. };
  256. if(data.level == 9){
  257. return [
  258. {
  259. creature: "Ghoul",
  260. number: 6,
  261. },
  262. {
  263. creature: "Ghast",
  264. number: 3,
  265. },
  266. {
  267. creature: "Wights",
  268. number: 3,
  269. },
  270. {
  271. creature: "Mummy",
  272. number: 2,
  273. }
  274. ]
  275. };
  276. return [
  277. {
  278. creature: "Ghoul",
  279. number: multiplier,
  280. }
  281. ]
  282. },
  283. "Find Familiar": [
  284. {
  285. creature: "Bat",
  286. number: 1,
  287. },
  288. {
  289. creature: "Cat",
  290. number: 1,
  291. },
  292. {
  293. creature: "Crab",
  294. number: 1,
  295. },
  296. {
  297. creature: "Frog",
  298. number: 1,
  299. },
  300. {
  301. creature: "Hawk",
  302. number: 1,
  303. },
  304. {
  305. creature: "Lizard",
  306. number: 1,
  307. },
  308. {
  309. creature: "Octopus",
  310. number: 1,
  311. },
  312. {
  313. creature: "Owl",
  314. number: 1,
  315. },
  316. {
  317. creature: "Poisonous Snake",
  318. number: 1,
  319. },
  320. {
  321. creature: "Quipper",
  322. number: 1,
  323. },
  324. {
  325. creature: "Rat",
  326. number: 1,
  327. },
  328. {
  329. creature: "Raven",
  330. number: 1,
  331. },
  332. {
  333. creature: "Sea Horse",
  334. number: 1,
  335. },
  336. {
  337. creature: "Spider",
  338. number: 1,
  339. },
  340. {
  341. creature: "Weasel",
  342. number: 1,
  343. },
  344. ],
  345. };
  346. }
  347. game.automatedevocations.originalBindings = deepClone(game.automatedevocations[game.system.id]);
  348. game.automatedevocations[game.system.id] = mergeObject(game.automatedevocations[game.system.id],game.settings.get(AECONSTS.MN, "customautospells"))
  349. });