forked from Sklore/HL_DD_5e_Colab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCOM_5ePack - Procedures Validate.user
48 lines (40 loc) · 1.43 KB
/
COM_5ePack - Procedures Validate.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
<?xml version="1.0" encoding="ISO-8859-1"?>
<document signature="Hero Lab Data">
<loadonce key="COM_5ePack - Procedures Validate"/>
<fileinfo>
<info_author><![CDATA[
Tim Shadow
Email: [email protected]
]]>
</info_author>
<info_history><![CDATA[
Janary 14, 2016
-Added new procedure "5CHasSpell" to check to see if the character can cast any spells including Spell-Like abilites.
]]>
</info_history>
</fileinfo>
<procedure id="5CHasSpell" scripttype="validate"><![CDATA[
~ This procedure tests if a character has a specific spell and sets the valid field
~ ===How to use this Procedure===
~ var HasSpells as number
~ Call 5CHasSpell
~ @valid = HasSpells
var HasSpells as number
var S2Spells as number
~ Init fields here
HasSpells = 0
S2Spells = 0
~ Changed logic her to be more universal. Instead of hardcoding
~ to specific classes instead see if a class can "cast spells".
S2Spells += hero.childfound[SpellSlots].field[FinalSpLev].value
~ Check the special Warlock spell helper in addition
S2Spells += hero.childfound[SlotHoldWa].field[MaxAllow].value
~ Check to see if the character has any Spell-like abilites active
S2Spells += hero.tagcount[Hero.HasSpLike]
~ If we have any spells or Spell-like abilities then we are valid
if (S2Spells > 0) then
HasSpells = 1
endif
]]>
</procedure>
</document>