-
Notifications
You must be signed in to change notification settings - Fork 6
/
GBT_Script_Combat_State.psc
59 lines (54 loc) · 1.66 KB
/
GBT_Script_Combat_State.psc
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
Scriptname GBT_Script_Combat_State extends activemagiceffect
IMPORT GAME
IMPORT Utility
FLOAT time
GrimyMenuMain Property GBT_MainMenu Auto
EVENT OnEffectStart(ACTOR akTarget, ACTOR akCaster)
time = GetCurrentGameTime()
ENDEVENT
EVENT OnEffectFinish(ACTOR akTarget, ACTOR akCaster)
time = GetCurrentGameTime() - time
time *= 24 * 60 ; time in minutes
AdvanceSkill("Block",time * GBT_MainMenu.GetGBT_BlockExp_Float())
time *= GBT_MainMenu.GetGBT_ArmorExp_Float()
AdvanceSkill("LightArmor",time*getLightCount(akCaster))
AdvanceSkill("HeavyArmor",time*getHeavyCount(akCaster))
ENDEVENT
FLOAT FUNCTION getLightCount(ACTOR akActor)
FLOAT retval = 0.0
IF (akActor.GetWornForm(0x00000002) AS ARMOR).GetWeightClass() != 1
retval += 1.0
ENDIF
IF (akActor.GetWornForm(0x00000004) AS ARMOR).GetWeightClass() != 1
retval += 1.0
ENDIF
IF (akActor.GetWornForm(0x00000008) AS ARMOR).GetWeightClass() != 1
retval += 1.0
ENDIF
IF (akActor.GetWornForm(0x00000080) AS ARMOR).GetWeightClass() != 1
retval += 1.0
ENDIF
IF (akActor.GetWornForm(0x00000200) AS ARMOR).GetWeightClass() != 1
retval += 1.0
ENDIF
RETURN retval
ENDFUNCTION
FLOAT FUNCTION getHeavyCount(ACTOR akActor)
FLOAT retval = 0.0
IF (akActor.GetWornForm(0x00000002) AS ARMOR).GetWeightClass() == 1
retval += 1.0
ENDIF
IF (akActor.GetWornForm(0x00000004) AS ARMOR).GetWeightClass() == 1
retval += 1.0
ENDIF
IF (akActor.GetWornForm(0x00000008) AS ARMOR).GetWeightClass() == 1
retval += 1.0
ENDIF
IF (akActor.GetWornForm(0x00000080) AS ARMOR).GetWeightClass() == 1
retval += 1.0
ENDIF
IF (akActor.GetWornForm(0x00000200) AS ARMOR).GetWeightClass() == 1
retval += 1.0
ENDIF
RETURN retval
ENDFUNCTION