-
Notifications
You must be signed in to change notification settings - Fork 31
/
COM_5ePack - Helper Things.user
915 lines (807 loc) · 43.6 KB
/
COM_5ePack - Helper Things.user
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
<?xml version="1.0" encoding="UTF-8"?>
<document signature="Hero Lab Data">
<loadonce key="COM_5ePack - Helper Things"/>
<procedure id="5CRcSplHd" scripttype="eval"><![CDATA[
var attacks as number
var saves as number
var defheader as string
~First, we make sure our focus is set to our root, and that we can get our info from it
perform state.clearfocus
if (isroot <> 0) then
if (root.tagis[component.RaceSplCst] <> 0) then
perform root.setfocus
else
perform hero.findchild[BaseRace].setfocus
endif
endif
if (state.isfocus <> 0) then
~Go looking for our header, if it's not already set
if (field[CustDesc].isempty <> 0) then
~Check the race
if (focus.field[rSplHead].isempty = 0) then
field[CustDesc].text = focus.field[rSplHead].text
else
~Use the default we were sent
field[CustDesc].text = defheader
endif
endif
~By default, the header uses the race name in its text. If we want
~ something else, we set that in abText
var name as string
if (field[abText].isempty = 0) then
name = field[abText].text
else
name = focus.field[name].text
name = lowercase(name)
name = "The " & name
endif
var lev as number
lev = focus.field[rSpCastLev].value
~Spellcasting attribute name
var aname as string
if (focus.islinkage[castattr] <> 0) then
aname = focus.linkage[castattr].field[name].text
else
aname = "Intelligence"
endif
var class as string
class = lowercase(focus.tagnames[sClass.cHelp?,"/"])
~And now spell stats, DC and attack bonus
var dc as number
var atk as number
var splstats as string
dc = focus.field[rSpDC].value
atk = focus.field[rSpAtk].value
if (saves <> 0) then
splstats = splice(splstats, "spell save DC " & dc,", ")
endif
if (attacks <> 0) then
splstats = splice(splstats, signed(atk) & " to hit with spell attacks",", ")
endif
if (empty(splstats) = 0) then
splstats = " (" & splstats & ")"
endif
~Substitute all our symbols in the header
~ Note that splstats, dc, and atk are ignored if they don't appear in the
~ header string (the substitution still happens, it just has nowhere to go)
field[CustDesc].text = replace(field[CustDesc].text,"#name#",name,0)
field[CustDesc].text = replace(field[CustDesc].text,"#lev#",ordinal(lev),0)
field[CustDesc].text = replace(field[CustDesc].text,"#abil#",aname,0)
field[CustDesc].text = replace(field[CustDesc].text,"#splstats#",splstats,0)
field[CustDesc].text = replace(field[CustDesc].text,"#dc#",dc,0)
field[CustDesc].text = replace(field[CustDesc].text,"#atk#",signed(atk),0)
field[CustDesc].text = replace(field[CustDesc].text,"#class#",class,0)
endif]]></procedure>
<thing id="meh5C" name="5e Community Mechanic" description="This mechanic holds special bootstraps called Configurable's that allow for adding "new" tabs into Hero Lab. Note that a Mechanic once made is ALWAYS live on the Hero allow one to bootsrap other Things or run a script always on every character." compset="Mechanics">
<tag group="DeityCat" tag="5CDrow" name="Drow Pantheon" abbrev="Drow"/>
<tag group="DeityCat" tag="5CForRealm" name="Forgotten Realms Pantheon" abbrev="For Realms"/>
<tag group="DeityCat" tag="5CGreyhawk" name="Greyhawk Pantheon" abbrev="Greyhawk"/>
<tag group="DeityCat" tag="5CDragonla" name="Dragonlance Pantheon" abbrev="Dragonlance"/>
<tag group="DeityCat" tag="5CDwarven" name="Dwarven Pantheon" abbrev="Dwarven"/>
<tag group="DeityCat" tag="5CElven" name="Elven Pantheon" abbrev="Elven"/>
<tag group="DeityCat" tag="5CHalfling" name="Halfling Pantheon" abbrev="Halfling"/>
<tag group="DeityCat" tag="5CGnomish" name="Gnomish Pantheon" abbrev="Gnomish"/>
<tag group="DeityCat" tag="5COrc" name="Orc Pantheon" abbrev="Orc"/>
<tag group="abCategory" tag="5COrdKnife" name="Mystic Order of the Knife"/>
<bootstrap thing="5CJournal"></bootstrap>
<bootstrap thing="cfg5CFeatB"></bootstrap>
<bootstrap thing="cfg5CProf"></bootstrap>
<bootstrap thing="cfg5CSupGif"></bootstrap>
<bootstrap thing="cfg5CTashVar"></bootstrap>
<bootstrap thing="sel5CEleAc"></bootstrap>
<bootstrap thing="sel5CEleCo"></bootstrap>
<bootstrap thing="sel5CEleLi"></bootstrap>
<bootstrap thing="sel5CEleFi"></bootstrap>
<bootstrap thing="sel5CEleTh"></bootstrap>
<bootstrap thing="ss5CAbjura"></bootstrap>
<bootstrap thing="ss5CConjur"></bootstrap>
<bootstrap thing="ss5CDivi"></bootstrap>
<bootstrap thing="ss5CEnchan"></bootstrap>
<bootstrap thing="ss5CEvocat"></bootstrap>
<bootstrap thing="ss5CIllusi"></bootstrap>
<bootstrap thing="ss5CNecrom"></bootstrap>
<bootstrap thing="ss5CTransm"></bootstrap>
<bootstrap thing="ss5CUniver"></bootstrap>
<bootstrap thing="ss5CAir"></bootstrap>
<bootstrap thing="ss5CEarth"></bootstrap>
<bootstrap thing="ss5CFire"></bootstrap>
<bootstrap thing="ss5CWater"></bootstrap>
<bootstrap thing="ss5CMetal"></bootstrap>
<bootstrap thing="ss5CVoid"></bootstrap>
<bootstrap thing="ss5CWood"></bootstrap>
<bootstrap thing="ss5CElemen"></bootstrap>
</thing>
<thing id="5CJournal" name="Always Show Journal Tab" description="This simple thing forces the {b}Journal{/b} tab to appear which is useful on NPC's which has the tab hidden." compset="Simple" uniqueness="useronce">
<usesource source="5eJournal"/>
<eval phase="PostAttr" priority="10000">~ If not a NPC get out now!
doneif (hero.tagis[CharType.typNPC] = 0)
~ Prevent the Journal Tab from being hidden for NPCs
perform hero.delete[HideTab.journal]
perform hero.delete[Hero.NoAdvance]
~perform hero.delete[Hero.ClsErLev?]</eval>
<eval phase="PostAttr" priority="50000" index="2">~ If not a NPC get out now!
doneif (hero.tagis[CharType.typNPC] = 0)
perform hero.delete[Hero.ClsErLev?]</eval>
</thing>
<thing id="sel5CEleAc" name="Acid" description="Base Elemental Type" compset="SelectHelp" uniqueness="unique">
<tag group="Selection" tag="Energy" name="Energy Type (All)"/>
<tag group="Selection" tag="EnergyBase" name="Energy Type (Base 4)"/>
<tag group="5CElemType" tag="Acid"/>
</thing>
<thing id="sel5CEleCo" name="Cold" description="Base Elemental Type" compset="SelectHelp" uniqueness="unique">
<tag group="Selection" tag="Energy" name="Energy Type (All)"/>
<tag group="Selection" tag="EnergyBase" name="Energy Type (Base 4)"/>
<tag group="5CElemType" tag="Cold"/>
</thing>
<thing id="sel5CEleLi" name="Lightning" description="Base Elemental Type" compset="SelectHelp" uniqueness="unique">
<tag group="Selection" tag="Energy" name="Energy Type (All)"/>
<tag group="Selection" tag="EnergyBase" name="Energy Type (Base 4)"/>
<tag group="5CElemType" tag="Lightning"/>
</thing>
<thing id="sel5CEleFi" name="Fire" description="Base Elemental Type" compset="SelectHelp" uniqueness="unique">
<tag group="Selection" tag="Energy" name="Energy Type (All)"/>
<tag group="Selection" tag="EnergyBase" name="Energy Type (Base 4)"/>
<tag group="5CElemType" tag="Fire"/>
</thing>
<thing id="sel5CEleTh" name="Thunder" description="Base Elemental Type" compset="SelectHelp" uniqueness="unique">
<tag group="Selection" tag="Energy" name="Energy Type (All)"/>
<tag group="5CElemType" tag="Thunder"/>
</thing>
<thing id="sel5CTxtAp" name="Append" description="Adjustment text action" compset="SelectHelp" uniqueness="unique">
<tag group="Selection" tag="5CTextAct" name="Text Action"/>
<tag group="5CTextAct" tag="Append"/>
</thing>
<thing id="sel5CTxtOv" name="Override" description="Adjustment text action" compset="SelectHelp" uniqueness="unique">
<tag group="Selection" tag="5CTextAct" name="Text Action"/>
<tag group="5CTextAct" tag="OverWrite"/>
</thing>
<thing id="sel5CValueBonus0" name="+0" description="Value Bonus Helper" compset="SelectHelp" uniqueness="unique">
<tag group="Selection" tag="5CValueBonus" name="Value Bonus"/>
<tag group="Value" tag="0"/>
</thing>
<thing id="sel5CValueBonus1" name="+1" description="Value Bonus Helper" compset="SelectHelp" uniqueness="unique">
<tag group="Selection" tag="5CValueBonus"/>
<tag group="Value" tag="1"/>
</thing>
<thing id="sel5CValueBonus2" name="+2" description="Value Bonus Helper" compset="SelectHelp" uniqueness="unique">
<tag group="Selection" tag="5CValueBonus"/>
<tag group="Value" tag="2"/>
</thing>
<thing id="sel5CValueBonus3" name="+3" description="Value Bonus Helper" compset="SelectHelp" uniqueness="unique">
<tag group="Selection" tag="5CValueBonus"/>
<tag group="Value" tag="3"/>
</thing>
<thing id="sel5CValueBonus4" name="+4" description="Value Bonus Helper" compset="SelectHelp" uniqueness="unique">
<tag group="Selection" tag="5CValueBonus"/>
<tag group="Value" tag="4"/>
</thing>
<thing id="sel5CValueBonus5" name="+5" description="Value Bonus Helper" compset="SelectHelp" uniqueness="unique">
<tag group="Selection" tag="5CValueBonus"/>
<tag group="Value" tag="5"/>
</thing>
<thing id="sel5CValueBonus6" name="+6" description="Value Bonus Helper" compset="SelectHelp" uniqueness="unique">
<tag group="Selection" tag="5CValueBonus"/>
<tag group="Value" tag="6"/>
</thing>
<thing id="sel5CValueBonus7" name="+7" description="Value Bonus Helper" compset="SelectHelp" uniqueness="unique">
<tag group="Selection" tag="5CValueBonus"/>
<tag group="Value" tag="7"/>
</thing>
<thing id="sel5CValueBonus8" name="+8" description="Value Bonus Helper" compset="SelectHelp" uniqueness="unique">
<tag group="Selection" tag="5CValueBonus"/>
<tag group="Value" tag="8"/>
</thing>
<thing id="sel5CValueBonus9" name="+9" description="Value Bonus Helper" compset="SelectHelp" uniqueness="unique">
<tag group="Selection" tag="5CValueBonus"/>
<tag group="Value" tag="9"/>
</thing>
<thing id="ss5CAbjura" name="Abjuration" compset="SplSchool">
<tag group="MagSch5C" tag="CORE"/>
<tag group="sSchool" tag="Abjur"/>
<eval phase="PostLevel" priority="20000"><![CDATA[
~ Check for Spell Focus for this specific school &
call 5CSplSchSF]]></eval>
</thing>
<thing id="ss5CConjur" name="Conjuration" compset="SplSchool">
<tag group="MagSch5C" tag="CORE"/>
<tag group="sSchool" tag="Conjur"/>
<eval phase="PostLevel" priority="20000"><![CDATA[
~ Check for Spell Focus for this specific school &
call 5CSplSchSF]]></eval>
</thing>
<thing id="ss5CDivi" name="Divination" compset="SplSchool">
<tag group="MagSch5C" tag="CORE"/>
<tag group="sSchool" tag="Divination"/>
<eval phase="PostLevel" priority="20000"><![CDATA[
~ Check for Spell Focus for this specific school &
call 5CSplSchSF]]></eval>
</thing>
<thing id="ss5CEnchan" name="Enchantment" compset="SplSchool">
<tag group="MagSch5C" tag="CORE"/>
<tag group="sSchool" tag="Enchant"/>
<eval phase="PostLevel" priority="20000"><![CDATA[
~ Check for Spell Focus for this specific school &
call 5CSplSchSF]]></eval>
</thing>
<thing id="ss5CEvocat" name="Evocation" compset="SplSchool">
<tag group="MagSch5C" tag="CORE"/>
<tag group="sSchool" tag="Evocation"/>
<eval phase="PostLevel" priority="20000"><![CDATA[
~ Check for Spell Focus for this specific school &
call 5CSplSchSF]]></eval>
</thing>
<thing id="ss5CIllusi" name="Illusion" compset="SplSchool">
<tag group="MagSch5C" tag="CORE"/>
<tag group="sSchool" tag="Illusion"/>
<eval phase="PostLevel" priority="20000"><![CDATA[
~ Check for Spell Focus for this specific school &
call 5CSplSchSF]]></eval>
</thing>
<thing id="ss5CNecrom" name="Necromancy" compset="SplSchool">
<tag group="MagSch5C" tag="CORE"/>
<tag group="sSchool" tag="Necromancy"/>
<eval phase="PostLevel" priority="20000"><![CDATA[
~ Check for Spell Focus for this specific school &
call 5CSplSchSF]]></eval>
</thing>
<thing id="ss5CTransm" name="Transmutat" compset="SplSchool">
<tag group="MagSch5C" tag="CORE"/>
<tag group="sSchool" tag="Transmutat"/>
<eval phase="PostLevel" priority="20000"><![CDATA[
~ Check for Spell Focus for this specific school &
call 5CSplSchSF]]></eval>
</thing>
<thing id="ss5CUniver" name="Universal" compset="SplSchool">
<tag group="sSchool" tag="Universal"/>
<eval phase="PostLevel" priority="20000"><![CDATA[
~ Check for Spell Focus for this specific school &
call 5CSplSchSF]]></eval>
</thing>
<thing id="ss5CAir" name="Air" compset="SplSchool">
<tag group="MagSch5C" tag="Element"/>
<tag group="sSchool" tag="Air"/>
<eval phase="PostLevel" priority="20000"><![CDATA[
~ Check for Spell Focus for this specific school &
call 5CSplSchSF]]></eval>
</thing>
<thing id="ss5CEarth" name="Earth" compset="SplSchool">
<tag group="MagSch5C" tag="Element"/>
<tag group="sSchool" tag="Earth"/>
<eval phase="PostLevel" priority="20000"><![CDATA[
~ Check for Spell Focus for this specific school &
call 5CSplSchSF]]></eval>
</thing>
<thing id="ss5CFire" name="Fire" compset="SplSchool">
<tag group="MagSch5C" tag="Element"/>
<tag group="sSchool" tag="Fire"/>
<eval phase="PostLevel" priority="20000"><![CDATA[
~ Check for Spell Focus for this specific school &
call 5CSplSchSF]]></eval>
</thing>
<thing id="ss5CWater" name="Water" compset="SplSchool">
<tag group="MagSch5C" tag="Element"/>
<tag group="sSchool" tag="Water"/>
<eval phase="PostLevel" priority="20000"><![CDATA[
~ Check for Spell Focus for this specific school &
call 5CSplSchSF]]></eval>
</thing>
<thing id="ss5CMetal" name="Metal" compset="SplSchool">
<tag group="MagSch5C" tag="ExpElement"/>
<tag group="sSchool" tag="Abjur"/>
<eval phase="PostLevel" priority="20000"><![CDATA[
~ Check for Spell Focus for this specific school &
call 5CSplSchSF]]></eval>
</thing>
<thing id="ss5CVoid" name="Void" compset="SplSchool">
<tag group="MagSch5C" tag="ExpElement"/>
<tag group="sSchool" tag="Abjur"/>
<eval phase="PostLevel" priority="20000"><![CDATA[
~ Check for Spell Focus for this specific school &
call 5CSplSchSF]]></eval>
</thing>
<thing id="ss5CWood" name="Wood" compset="SplSchool">
<tag group="MagSch5C" tag="ExpElement"/>
<tag group="sSchool" tag="Wood"/>
<eval phase="PostLevel" priority="20000"><![CDATA[
~ Check for Spell Focus for this specific school &
call 5CSplSchSF]]></eval>
</thing>
<thing id="ss5CElemen" name="Elemental" compset="SplSchool">
<tag group="MagSch5C" tag="ExpElement"/>
<tag group="sSchool" tag="Elemental"/>
<eval phase="PostLevel" priority="20000"><![CDATA[
~ Check for Spell Focus for this specific school &
call 5CSplSchSF]]></eval>
</thing>
<thing id="cfg5CFeatB" name="Feats, Bonus" description="This allows for the new tab "Feats, Bonus" to appear in HL once the field cfgMaxF1 is greater than zero. In addition this only works because I have bootstrapped this "Thing" to a new "Mechanics" that I created." compset="Configure" uniqueness="unique">
<tag group="fExclude" tag="fChaInc1"/>
<tag group="fExclude" tag="fChaInc2"/>
<tag group="fExclude" tag="fConInc1"/>
<tag group="fExclude" tag="fConInc2"/>
<tag group="fExclude" tag="fDexInc1"/>
<tag group="fExclude" tag="fDexInc2"/>
<tag group="fExclude" tag="fIntInc1"/>
<tag group="fExclude" tag="fIntInc2"/>
<tag group="fExclude" tag="fStrInc1"/>
<tag group="fExclude" tag="fStrInc2"/>
<tag group="fExclude" tag="fWisInc1"/>
<tag group="fExclude" tag="fWisInc2"/>
<tag group="fExclude" tag="fHdAbilImp"/>
<tag group="fExclude" tag="fHdFeat"/>
</thing>
<thing id="cfg5CProf" name="Proficiencies" description="This allows for having a single central place to add additional proficiencies to a character." compset="Configure" uniqueness="unique">
<fieldval field="cSkCandExp" value="component.BaseSkill & !Helper.Obsolete"/>
<fieldval field="cTlCandExp" value="component.Tool & !Helper.Obsolete"/>
<fieldval field="cSkCandEx2" value="component.BaseSkill & !Helper.Obsolete"/>
<fieldval field="cTlCandEx2" value="component.Tool & !Helper.Obsolete"/>
<eval phase="Attr" priority="10000"><![CDATA[
~ The below logic is needed because we have two seperate lists
~ for tools & skills. But we need to allow for a combination
~ of tools/skills to be chosen.
~ Total up all the skills and tools that have been chosen
field[cPhaStart].value += field[cSkillCur].value + field[cToolCur].value
~ Set the Used values for both Tools/Skills to be the same
field[cToolCur].value = field[cPhaStart].value
field[cSkillCur].value = field[cPhaStart].value]]></eval>
</thing>
<thing id="cfg5CMagIn" name="Magic Initiate" description="Helper Thing for the feat Magic Initiate." compset="Configure" uniqueness="unique">
<tag group="Helper" tag="SpCountLev"/>
<tag group="Helper" tag="ClsCastLev"/>
<eval phase="Final" priority="50000"><![CDATA[
~ If no spell class tags, do nothing &
doneif (tagcount[sClass.?] = 0)
~ NOTE: I am thinking I found more bugs in 5e game system as
~ I shouldn't have to do this to get spells to appear
~ on the "Spells" tab.
~ Generate SpellSort and SpellType tags
perform pulltags[sClass.?,SpellSort]
perform pulltags[sClass.?,SpellType]
~ Loop through all the spell picks added on the "Magic Initiate"
~ Configurable tab.
foreach pick in hero from BaseSpell where "CfgSpell.cfg5CMagIn"
~ Set the SpellSort and SpellType tags which are needed
~ to get spells to display correctly on the Spells tab
perform eachpick.pushtags[SpellSort.?]
perform eachpick.pushtags[SpellType.?]
~ Pull the spell level selected and the deny tags so that
~ we can set the message and selection list corretly.
perform eachpick.pulltags[sLevel.?]
perform eachpick.pulltags[ClsDenySp.?]
~ If we are a cantrip add the helper cantrip tag
if (eachpick.tagis[sLevel.0] = 1) then
perform eachpick.assign[Helper.Cantrip]
~.. otherwise we are level 1+ spell so make us a
~ racial spell so we can limit its use to 1/longrest
else
perform eachpick.assign[Helper.SpellLike]
perform eachpick.assign[Usage.LongRest]
eachpick.field[trkMax].value += 1
endif
nexteach
~ Set the spell selection expression to only be the selected class
field[cfgAllwSp1].text &= " & (sLevel.0|sLevel.1) & (" & tagids[sClass.?,"|"] & ") & !Helper.Helper"
~ If we have Class Deny Spells then remove those from the list. This
~ prevents the same spell from being added twice. This way we act
~ like the normal spell portal does.
if (tagcount[ClsDenySp.?] <> 0) then
field[cfgAllwSp1].text &= " & !(" & tagids[ClsDenySp.?,"|"] & ")"
endif]]></eval>
<eval phase="Render" priority="99999999999" index="2"><![CDATA[
var nLevel0 as number
var nLevel1 as number
~ Calculate the number of spells selected
nLevel0 = 2 - tagcount[sLevel.0]
nLevel1 = 1 - tagcount[sLevel.1]
~ Set the correct message
If (nLevel0 + nLevel1 > 0) then
field[cfgAdTxSp1].text = "Add " & nLevel0 & " Cantrips and " & nLevel1 & " 1st-level spell"
ElseIf (nLevel0 + nLevel1 = 0) then
field[cfgAdTxSp1].text = "No more spells to add."
ElseIf (nLevel0 < 0) then
field[cfgAdTxSp1].text = "You have " & tagcount[sLevel.0] & " of 2 cantrips allowed."
ElseIf (nLevel1 < 0) then
field[cfgAdTxSp1].text = "You have " & tagcount[sLevel.1] & " of one 1st-level spell allowed."
Endif]]></eval>
</thing>
<thing id="cfg5CRitCa" name="Ritual Caster" description="Helper Thing for the feat Ritual Caster." compset="Configure" uniqueness="unique">
<fieldval field="cfgSpell1" value="Rituals"/>
<tag group="Helper" tag="ClsCastLev"/>
<eval phase="Final" priority="50000"><![CDATA[
~ If no spell class tags, do nothing &
doneif (tagcount[sClass.?] = 0)
~ NOTE: I am thinking I found more bugs in 5e game system as
~ I shouldn't have to do this to get spells to appear
~ on the "Spells" tab.
~ Generate SpellSort and SpellType tags
perform pulltags[sClass.?,SpellSort]
perform pulltags[sClass.?,SpellType]
~ Loop through all the spell picks added on the "Ritual Caster"
~ Configurable tab.
foreach pick in hero from BaseSpell where "CfgSpell.cfg5CRitCa"
~ Set the SpellSort and SpellType tags which are needed
~ to get spells to display correctly on the Spells tab
perform eachpick.pushtags[SpellSort.?]
perform eachpick.pushtags[SpellType.?]
~ Pull the spell level selected and the deny tags so that
~ we can set the message and selection list corretly.
perform eachpick.pulltags[sLevel.?]
perform eachpick.pulltags[ClsDenySp.?]
~ Set these as Ritual Spell-like spells so we display
~ on the Spells tab.
perform eachpick.assign[Helper.SpellLike]
eachpick.field[livename].text = eachpick.field[thingname].text & " (Ritual)"
nexteach
~ Set the spell selection expression to the selected class, Level 1 Ritual Spells
~ and not Helper.Helper spells.
field[cfgAllwSp1].text &= " & Helper.RitualSpel & !Helper.Helper & (" & tagids[sClass.?,"|"] & ")"
~ If we have Class Deny Spells then remove those from the list. This
~ prevents the same spell from being added twice. This way we act
~ like the normal spell portal does.
if (tagcount[ClsDenySp.?] <> 0) then
field[cfgAllwSp1].text &= " & !(" & tagids[ClsDenySp.?,"|"] & ")"
endif
~ We have no "limit" of spells that can be added.
~ So each time we select a spell increase the max to
~ to match.
field[cfgMaxSp1].value += tagcount[sLevel.?]
field[cfgLeftSp1].value = 0]]></eval>
</thing>
<thing id="cfg5CMarAd" name="Maneuvers" description="This is a helper Thing for the Martial Adept feat and the Superior Technique Fighting Style." compset="Configure" uniqueness="unique">
<fieldval field="cfgAllow3" value="abCategory.FtrBMasMan"/>
<fieldval field="cfgObject3" value="Battle Master Maneuvers"/>
</thing>
<thing id="dt5CTrap" name="Traps" compset="DamageType"></thing>
<thing id="dt5CBPSNon" name="bludgeoning, piercing, and slashing from nonmagical weapons" compset="DamageType"></thing>
<thing id="cfg5CSpeSn" name="Spell Sniper" description="Helper Thing for the feat Spell Sniper." compset="Configure" uniqueness="unique">
<tag group="Helper" tag="ClsCastLev"/>
<eval phase="Final" priority="50000"><![CDATA[
~ If no spell class tags, do nothing &
doneif (tagcount[sClass.?] = 0)
~ NOTE: I am thinking I found more bugs in 5e game system as
~ I shouldn't have to do this to get spells to appear
~ on the "Spells" tab.
~ Generate SpellSort and SpellType tags
perform pulltags[sClass.?,SpellSort]
perform pulltags[sClass.?,SpellType]
~ Loop through all the spell picks added on the "Spell Sniper"
~ Configurable tab.
foreach pick in hero from BaseSpell where "CfgSpell.cfg5CSpeSn"
~ Set the SpellSort and SpellType tags which are needed
~ to get spells to display correctly on the Spells tab
perform eachpick.pushtags[SpellSort.?]
perform eachpick.pushtags[SpellType.?]
~ Pull the spell level selected and the deny tags so that
~ we can set the message and selection list corretly.
perform eachpick.pulltags[sLevel.?]
perform eachpick.pulltags[ClsDenySp.?]
~ If we are a cantrip add the helper cantrip tag
if (eachpick.tagis[sLevel.0] = 1) then
perform eachpick.assign[Helper.Cantrip]
~.. otherwise we are level 1+ spell so make us a
~ racial spell so we can limit its use to 1/longrest
else
perform eachpick.assign[Helper.SpellLike]
perform eachpick.assign[Usage.LongRest]
eachpick.field[trkMax].value += 1
endif
nexteach
~ Set the spell selection expression to only be the selected class
field[cfgAllwSp1].text &= " & (sLevel.0) & (" & tagids[sClass.?,"|"] & ")"
~ If we have Class Deny Spells then remove those from the list. This
~ prevents the same spell from being added twice. This way we act
~ like the normal spell portal does.
if (tagcount[ClsDenySp.?] <> 0) then
field[cfgAllwSp1].text &= " & !(" & tagids[ClsDenySp.?,"|"] & ")"
endif]]></eval>
<eval phase="Render" priority="99999999999" index="2"><![CDATA[
var nLevel0 as number
var nLevel1 as number
~ Calculate the number of spells selected
nLevel0 = 1 - tagcount[sLevel.0]
nLevel1 = 0 - tagcount[sLevel.1]
~ Set the correct message
If (nLevel0 > 0) then
field[cfgAdTxSp1].text = "Add " & nLevel0 & " Cantrips."
ElseIf (nLevel0 = 0) then
field[cfgAdTxSp1].text = "No more spells to add."
ElseIf (nLevel0 < 0) then
field[cfgAdTxSp1].text = "You have " & tagcount[sLevel.0] & " of 1 cantrips allowed."
Endif]]></eval>
</thing>
<thing id="gt5CHerbs" name="Herbs" compset="GearType" isshowonly="yes"></thing>
<thing id="g5CHerbs" name="Herbs" description="Herbs and other ingredients found in the wild have long been a staple part of the healer's toolkit. Indeed, herbalism is linked not just with healing, but also with protection, witchcraft, and – of course – poison. Whether applied as a poultice, infused as a incense, drank as a soup or tea, nature's power over the world is undeniable, especially when applied by those skilled in its use. \n\nHerbalism is covered by three skills – Medicine (for healing herbs), Nature (for most other herbs), and Religion (for herbs dealing with the undead and the like). Preparation of an herb is an Intelligence (Nature), Wisdom (Medicine), or Wisdom (Religion) check, and requires proficiency with a herbalism kit, which contains the necessary tools and implements. \n\nHerbs are divided into three types: healing, endowment, and warding. Healing herbs restore hit points, and help deal with poison and illness. Endowment herbs grant abilities, including enhanced senses and adrenalin-like 'buffs'. Warding herbs protect the user from things, including the undead." compset="Gear" isshowonly="yes">
<tag group="explicit" tag="100"/>
<tag group="GearType" tag="gt5CHerbs" name="Herbs" abbrev="Herbs"/>
</thing>
<thing id="gt5CAlcItm" name="Alchemical Items" compset="GearType" summary="Alchemical Items" isshowonly="yes"></thing>
<thing id="g5CAlchItm" name="Alchemical Items" description="Alchemists are masters of haphazard mprovisation and calculated improvement. Even lacking the right tool, the alchemist is almost always working up a new concoction. Here you’ll find a few new items to add to the alchemist’s arsenal, and a new variant rule for crafting them.\n\nOn an average day, a craftsman produces about 5 gp worth of marketable goods. Alchemy is no different—but oftentimes, alchemists lack\nthe required downtime. To quickly produce alchemical items, you may make a DC 10 Intelligence (Alchemist’s Tools) check. Your daily progress is doubled for every 5 points by which you exceed this DC. If you fail by 5 or more, you ruin the day’s ingredients, losing the day’s\nraw materials and 5 gp of progress. You may attempt to craft during an adventuring day, but doing so imposes disadvantage on your crafting\ncheck to represent various complications and interruptions" compset="Gear" isshowonly="yes">
<tag group="GearType" tag="gt5CAlcItm" name="Alchemical Items"/>
<tag group="explicit" tag="51"/>
</thing>
<thing id="x5CSpellCast" name="Spellcasting" description="A monster with the ability to cast spells as an action has the Spellcasting action. Unless noted otherwise, an innate spell of 1st level or higher is always cast at its lowest possible level and can’t be cast at a higher level. If a monster has a cantrip where its level matters and no level is given, use the monster’s challenge rating." compset="RaceSpec" summary="Has a spellcaster level and spell slots.">
<comment><![CDATA[This version of spellcasting was made to follow WotC's newer (2021 and later) method of displaying spellcasting as an action in creature stat blocks.]]></comment>
<tag group="Helper" tag="ShowSpec" name="Show Spec" abbrev="Show Spec"/>
<tag group="Helper" tag="Spellcast" name="Spellcast" abbrev="Spellcast"/>
<tag group="abAction" tag="Action"/>
<tag group="FeatureTyp" tag="Action"/>
<eval phase="Render" priority="120000" name="Spellcasting description"><![CDATA[
var spells as string
var period as string
var uses as number
var isnewline as number
var nl as string
var attacks as number
var saves as number
nl="{br}"
~First, we get all the innate racial spells on the character
~ These are what used to be "spell-like abilities"
foreach pick in hero from BaseSpell where "Helper.RaceSpell" sortas SplLikeSB
~we use two variables - period, and uses to detect whether the uses/period
~has changed. Each time it does change, we start a new line
isnewline = 0
~on the initial run-through, nothing has been stored in the variables,
~and we always want to start a new line to place the first ability on
if (empty(period) <> 0) then
isnewline = 1
elseif (eachpick.tagexpr[SBSortOver.Constant | SBSortOver.AtWill] <> 0) then
if (compare(eachpick.tagids[SBSortOver.?],period) <> 0) then
isnewline = 1
endif
else
~if the usage period for this ability differs from the usage period of
~our last ability, start a new line
if (compare(eachpick.tagids[Usage.?],period) <> 0) then
isnewline = 1
~and if the usage period is the same, but the uses/period changes, we
~also start a new line
elseif (eachpick.field[trkMax].value <> uses) then
isnewline = 1
endif
endif
var spellname as string
if (empty(eachpick.field[sNameOver].text) = 0) then
spellname = "{i}" & lowercase(eachpick.field[sNameOver].text) & "{/i}"
else
spellname = "{i}" & lowercase(eachpick.field[thingname].text) & "{/i}"
endif
~Track how many spells have saves or need attack rolls
saves += eachpick.tagis[Helper.SplSave]
attacks += eachpick.tagis[Helper.SplAttack]
~debug eachpick.field[name].text &", " & eachpick.tagnames[Helper.Spl?,"/"]
~Any addons to the name
if (eachpick.field[sNameMod].isempty = 0) then
spellname &= " (" & eachpick.field[sNameMod].text & ")"
endif
if (isnewline <> 0) then
if (eachpick.field[trkMax].value > 0) then
spells &= nl & eachpick.field[trkMax].value & eachpick.tagnames[Usage.?] & " each:"
else
spells &= nl & eachpick.tagnames[Usage.?] & ":"
endif
if (eachpick.tagexpr[SBSortOver.Constant | SBSortOver.AtWill] <> 0) then
period = eachpick.tagids[SBSortOver.?]
else
period = eachpick.tagids[Usage.?]
uses = eachpick.field[trkMax].value
endif
spells = splice(spells, spellname, " ")
else
spells = splice(spells, spellname, ", ")
endif
nexteach
~Set our default header string
var defheader as string
defheader = "#name# casts one of these spells, needing no material components and using #abil# as the spellcasting ability#splstats#:"
call 5CRcSplHd
field[CustDesc].text &= spells]]>
<after name="Calc cSpellOut"/>
</eval>
</thing>
<thing id="x5CSpellPsi" name="Spellcasting (Psionics)" description="A monster with the ability to cast spells psionically as an action has the Spellcasting (Psionics) action. Unless noted otherwise, a spell of 1st level or higher is always cast at its lowest possible level and can’t be cast at a higher level. If a monster has a cantrip where its level matters and no level is given, use the monster’s challenge rating." compset="RaceSpec" summary="Has a spellcaster level and spell slots.">
<comment><![CDATA[This version of spellcasting was made to follow WotC's newer (2021 and later) method of displaying spellcasting as an action in creature stat blocks.]]></comment>
<tag group="Helper" tag="ShowSpec" name="Show Spec" abbrev="Show Spec"/>
<tag group="Helper" tag="Spellcast" name="Spellcast" abbrev="Spellcast"/>
<tag group="abAction" tag="Action"/>
<tag group="FeatureTyp" tag="Action"/>
<eval phase="Render" priority="120000" name="Spellcasting description"><![CDATA[
var spells as string
var period as string
var uses as number
var isnewline as number
var nl as string
var attacks as number
var saves as number
nl="{br}"
~First, we get all the innate racial spells on the character
~ These are what used to be "spell-like abilities"
foreach pick in hero from BaseSpell where "Helper.RaceSpell" sortas SplLikeSB
~we use two variables - period, and uses to detect whether the uses/period
~has changed. Each time it does change, we start a new line
isnewline = 0
~on the initial run-through, nothing has been stored in the variables,
~and we always want to start a new line to place the first ability on
if (empty(period) <> 0) then
isnewline = 1
elseif (eachpick.tagexpr[SBSortOver.Constant | SBSortOver.AtWill] <> 0) then
if (compare(eachpick.tagids[SBSortOver.?],period) <> 0) then
isnewline = 1
endif
else
~if the usage period for this ability differs from the usage period of
~our last ability, start a new line
if (compare(eachpick.tagids[Usage.?],period) <> 0) then
isnewline = 1
~and if the usage period is the same, but the uses/period changes, we
~also start a new line
elseif (eachpick.field[trkMax].value <> uses) then
isnewline = 1
endif
endif
var spellname as string
if (empty(eachpick.field[sNameOver].text) = 0) then
spellname = "{i}" & lowercase(eachpick.field[sNameOver].text) & "{/i}"
else
spellname = "{i}" & lowercase(eachpick.field[thingname].text) & "{/i}"
endif
~Track how many spells have saves or need attack rolls
saves += eachpick.tagis[Helper.SplSave]
attacks += eachpick.tagis[Helper.SplAttack]
~debug eachpick.field[name].text &", " & eachpick.tagnames[Helper.Spl?,"/"]
~Any addons to the name
if (eachpick.field[sNameMod].isempty = 0) then
spellname &= " (" & eachpick.field[sNameMod].text & ")"
endif
if (isnewline <> 0) then
if (eachpick.field[trkMax].value > 0) then
spells &= nl & eachpick.field[trkMax].value & eachpick.tagnames[Usage.?] & " each:"
else
spells &= nl & eachpick.tagnames[Usage.?] & ":"
endif
if (eachpick.tagexpr[SBSortOver.Constant | SBSortOver.AtWill] <> 0) then
period = eachpick.tagids[SBSortOver.?]
else
period = eachpick.tagids[Usage.?]
uses = eachpick.field[trkMax].value
endif
spells = splice(spells, spellname, " ")
else
spells = splice(spells, spellname, ", ")
endif
nexteach
~Set our default header string
var defheader as string
defheader = "#name# casts one of these spells, needing no spell components and using #abil# as the spellcasting ability#splstats#:"
call 5CRcSplHd
field[CustDesc].text &= spells]]>
<after name="Calc cSpellOut"/>
</eval>
</thing>
<thing id="x5CSplCstMat" name="Spellcasting" description="A monster with the ability to cast spells as an action has the Spellcasting action. Unless noted otherwise, an innate spell of 1st level or higher is always cast at its lowest possible level and can’t be cast at a higher level. If a monster has a cantrip where its level matters and no level is given, use the monster’s challenge rating." compset="RaceSpec" summary="Has a spellcaster level and spell slots.">
<comment><![CDATA[This version of spellcasting was made to follow WotC's newer (2021 and later) method of displaying spellcasting as an action in creature stat blocks.
This is the same as x5CSpellCast, except that one says they require no material components.]]></comment>
<tag group="Helper" tag="ShowSpec" name="Show Spec" abbrev="Show Spec"/>
<tag group="Helper" tag="Spellcast" name="Spellcast" abbrev="Spellcast"/>
<tag group="abAction" tag="Action"/>
<tag group="FeatureTyp" tag="Action"/>
<eval phase="Render" priority="120000" name="Spellcasting description"><![CDATA[
var spells as string
var period as string
var uses as number
var isnewline as number
var nl as string
var attacks as number
var saves as number
nl="{br}"
~First, we get all the innate racial spells on the character
~ These are what used to be "spell-like abilities"
foreach pick in hero from BaseSpell where "Helper.RaceSpell" sortas SplLikeSB
~we use two variables - period, and uses to detect whether the uses/period
~has changed. Each time it does change, we start a new line
isnewline = 0
~on the initial run-through, nothing has been stored in the variables,
~and we always want to start a new line to place the first ability on
if (empty(period) <> 0) then
isnewline = 1
elseif (eachpick.tagexpr[SBSortOver.Constant | SBSortOver.AtWill] <> 0) then
if (compare(eachpick.tagids[SBSortOver.?],period) <> 0) then
isnewline = 1
endif
else
~if the usage period for this ability differs from the usage period of
~our last ability, start a new line
if (compare(eachpick.tagids[Usage.?],period) <> 0) then
isnewline = 1
~and if the usage period is the same, but the uses/period changes, we
~also start a new line
elseif (eachpick.field[trkMax].value <> uses) then
isnewline = 1
endif
endif
var spellname as string
if (empty(eachpick.field[sNameOver].text) = 0) then
spellname = "{i}" & lowercase(eachpick.field[sNameOver].text) & "{/i}"
else
spellname = "{i}" & lowercase(eachpick.field[thingname].text) & "{/i}"
endif
~Track how many spells have saves or need attack rolls
saves += eachpick.tagis[Helper.SplSave]
attacks += eachpick.tagis[Helper.SplAttack]
~debug eachpick.field[name].text &", " & eachpick.tagnames[Helper.Spl?,"/"]
~Any addons to the name
if (eachpick.field[sNameMod].isempty = 0) then
spellname &= " (" & eachpick.field[sNameMod].text & ")"
endif
if (isnewline <> 0) then
if (eachpick.field[trkMax].value > 0) then
spells &= nl & eachpick.field[trkMax].value & eachpick.tagnames[Usage.?] & " each:"
else
spells &= nl & eachpick.tagnames[Usage.?] & ":"
endif
if (eachpick.tagexpr[SBSortOver.Constant | SBSortOver.AtWill] <> 0) then
period = eachpick.tagids[SBSortOver.?]
else
period = eachpick.tagids[Usage.?]
uses = eachpick.field[trkMax].value
endif
spells = splice(spells, spellname, " ")
else
spells = splice(spells, spellname, ", ")
endif
nexteach
~Set our default header string
var defheader as string
defheader = "#name# casts one of these spells, using #abil# as the spellcasting ability#splstats#:"
call 5CRcSplHd
field[CustDesc].text &= spells]]>
<after name="Calc cSpellOut"/>
</eval>
</thing>
<thing id="min5CCustMnt" name="Custom Mount" description="This option will add a mount that can be any Medium or larger, non-Humanoid creature." compset="Minion" stacking="never">
<tag group="GearType" tag="gtMounts" name="Mounts" abbrev="Mounts"/>
<eval phase="PostAttr" priority="11000"><![CDATA[
minion.childfound[Totals].field[tRaceExpr].text = "component.BaseRace & RaceType.NPC & !RaceSize.Tiny12 & !RaceSize.Small11 & !(hasbootstrap:tp5CObject) & !(hasbootstrap:tp5CVehicle) & !(hasbootstrap:tpHumanoid) "]]></eval>
<minion id="Mount"></minion>
</thing>
<thing id="ra5CMPLrVar" name="Lair Actions" description="The creature is in its lair, allowing it to take lair actions." compset="VarRaceTrt" summary="The creature can use its lair actions." uniqueness="unique">
<fieldval field="abText" value="the creature"/>
<tag group="AllowRCust" tag="r5CBalhanR"/>
<tag group="AllowRCust" tag="r5CBaphomR"/>
<tag group="AllowRCust" tag="r5CDemogoR"/>
<tag group="AllowRCust" tag="r5CDroMatR"/>
<tag group="AllowRCust" tag="r5CEldBraR"/>
<tag group="AllowRCust" tag="r5CGitAnaR"/>
<tag group="AllowRCust" tag="r5CGrazztR"/>
<tag group="AllowRCust" tag="r5CKirinR"/>
<tag group="AllowRCust" tag="r5COrcusR"/>
<tag group="AllowRCust" tag="r5CZarielR"/>
<tag group="AllowRCust" tag="r5CZuggtmR"/>
<tag group="Custom" tag="LairActions"/>
<tag group="Helper" tag="SpecUp"/>
<tag group="AllowRCust" tag="r5CMerrenR"/>
<tag group="AllowRCust" tag="r5CStnQntR"/>
<tag group="AllowRCust" tag="r5CArasta"/>
<tag group="AllowRCust" tag="r5CHython"/>
<tag group="AllowRCust" tag="r5CAlyxAbs"/>
<tag group="AllowRCust" tag="r5CAlyxCal"/>
<tag group="AllowRCust" tag="r5CAlyxDsp"/>
<tag group="AllowRCust" tag="r5CAlyxTrm"/>
<eval phase="First" priority="10">perform hero.assign[Custom.LairActions]</eval>
</thing>
<thing id="ra5CMPLrVarCR" name="Lair Actions" description="The creature is in its lair, allowing it to take lair actions. Being in its lair causes the creature's CR to increase by 1." compset="VarRaceTrt" summary="The creature can use its lair actions." uniqueness="unique">
<fieldval field="abText" value="the creature"/>
<tag group="Custom" tag="LairActions"/>
<tag group="Helper" tag="SpecUp"/>
<tag group="AllowRCust" tag="r5CFrzUrbR"/>
<tag group="AllowRCust" tag="r5CGeryonR"/>
<tag group="AllowRCust" tag="r5CJuibleR"/>
<tag group="AllowRCust" tag="r5CMorkotR"/>
<tag group="AllowRCust" tag="r5CYeenogR"/>
<eval phase="First" priority="10">perform hero.assign[Custom.LairActions]</eval>
<eval phase="Final" priority="10000" index="2">herofield[tCR].value += 1</eval>
</thing>
<thing id="ra5CMPLrHdr" name="Lair Actions" compset="RaceSpec">
<tag group="FeatureTyp" tag="LairHeader" name="Lair Actions Header" abbrev="Lair Actions Header"/>
<tag group="Helper" tag="ShowSpec" name="Show Spec" abbrev="Show Spec"/>
<eval phase="Final"><![CDATA[field[CustDesc].text = "On initiative count 20, " & field[abText].text & " can use one of the following lair actions. The same action cannot be used two rounds in a row."]]></eval>
</thing>
</document>