forked from Sklore/HL_DD_5e_Colab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCOM_5ePack - Helper Things.user
242 lines (204 loc) · 11 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
<?xml version="1.0" encoding="UTF-8"?>
<document signature="Hero Lab Data">
<loadonce key="COM_5ePack - Helper Things"/>
<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">
<bootstrap thing="cfg5CFeatB"></bootstrap>
</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="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="Martial Adept" description="This is a helper Thing for the feat Martial Adept." compset="Configure" uniqueness="unique">
<fieldval field="cfgMax3" value="2"/>
<fieldval field="cfgAllow3" value="abCategory.FtrBMasMan"/>
<fieldval field="cfgObject3" value="Battle Master Maneuvers"/>
</thing>
<thing id="dt5CTrap" name="Traps" compset="DamageType"></thing>
<thing id="sel5CEleAc" name="Acid" description="Base Elemental Type" compset="SelectHelp">
<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">
<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">
<tag group="Selection" tag="EnergyBase" name="Energy Type (Base 4)"/>
<tag group="5CElemType" tag="Lightning"/>
</thing>
<thing id="sel5CEleTh" name="Thunder" description="Base Elemental Type" compset="SelectHelp">
<tag group="Selection" tag="EnergyBase" name="Energy Type (Base 4)"/>
<tag group="5CElemType" tag="Thunder"/>
</thing>
<thing id="cfg5CSpeSn" name="Spell Sniper" description="Helper Thing for the feat Spell Sniper." 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 "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 = 2 - tagcount[sLevel.0]
nLevel1 = 1 - 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 2 cantrips allowed."
Endif]]></eval>
</thing>
</document>