-
Notifications
You must be signed in to change notification settings - Fork 0
/
TrailsOfDestructionMCMScript.psc
347 lines (323 loc) · 12.3 KB
/
TrailsOfDestructionMCMScript.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
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
Scriptname TrailsOfDestructionMCMScript extends SKI_ConfigBase
String[] TrailEffectOptions
String[] PlayerEffectOptions
String[] TrailLengthOverride
Bool bTrailEffectsToggle = True
Bool bPlayerEffectsToggle = True
Bool bTrailEffectOverride = False
Bool bPlayerEffectOverride = False
Bool bAccept = False
Bool bSound = True
Bool bDamage = True
Bool bKeyToggle = True
Int oTrailEffectsToggle
Int oPlayerEffectsToggle
Int oTrailEffectOverride
Int oPlayerEffectOverride
Int oTypeDropDownTrail
Int oTypeDropDownEffect
Int oTypeDropDownEffectPlayer
Int oSound
Int oDamage
Int oAccept
Int oToggleKey
Int oPlayerEffectLevel
Int iTrailEffect = 0
Int iTrailLength = 0
Int iPlayerEffect = 0
GlobalVariable Property TrailsofDestructionPlayerEffectLevel Auto
Event OnConfigInit()
TrailEffectOptions = New String[3]
TrailEffectOptions[0] = "Fire"
TrailEffectOptions[1] = "Frost"
TrailEffectOptions[2] = "Shock"
PlayerEffectOptions = New String[3]
PlayerEffectOptions[0] = "Fire"
PlayerEffectOptions[1] = "Frost"
PlayerEffectOptions[2] = "Shock"
TrailLengthOverride = New String[3]
TrailLengthOverride[0] = "Small"
TrailLengthOverride[1] = "Medium"
TrailLengthOverride[2] = "Large"
Pages = New String[3]
Pages[0] = "Trailing Effects"
Pages[1] = "Player Effects"
Pages[2] = "Misc and Accept"
UpdateSettings()
RegisterForKey(TrailsofDestructionToggleKey.GetValueInt())
EndEvent
Event OnPageReset(String page)
If (Page == "Trailing Effects")
SetCursorFillMode(Left_To_Right)
oTrailEffectsToggle = AddToggleOption("Trailing Effects Enabled", bTrailEffectsToggle)
AddEmptyOption()
AddEmptyOption()
AddEmptyOption()
oTypeDropDownEffect = AddMenuOption("Trail Effect", TrailEffectOptions[iTrailEffect])
AddEmptyOption()
AddEmptyOption()
AddEmptyOption()
oTrailEffectOverride = AddToggleOption("Trail Length Override", bTrailEffectOverride)
AddEmptyOption()
AddEmptyOption()
AddEmptyOption()
oTypeDropDownTrail = AddMenuOption("Trail Length Override Option", TrailLengthOverride[iTrailLength])
Elseif (Page == "Player Effects")
SetCursorFillMode(Left_To_Right)
oPlayerEffectsToggle = AddToggleOption("Player Effects Enabled", bPlayerEffectsToggle)
AddEmptyOption()
AddEmptyOption()
AddEmptyOption()
oPlayerEffectLevel = AddSliderOption("Player Effect Destruction Level", TrailsofDestructionPlayerEffectLevel.GetValue())
AddEmptyOption()
AddEmptyOption()
AddEmptyOption()
oPlayerEffectOverride = AddToggleOption("Player Effects Override", bPlayerEffectOverride)
AddEmptyOption()
AddEmptyOption()
AddEmptyOption()
oTypeDropDownEffectPlayer = AddMenuOption("Player Effect Override Option", PlayerEffectOptions[iPlayerEffect])
Elseif(Page == "Misc and Accept")
AddEmptyOption()
AddEmptyOption()
oSound = AddToggleOption("Effects Make Sound", bSound)
AddEmptyOption()
AddEmptyOption()
AddEmptyOption()
oDamage = AddToggleOption("Effects Deal Damage", bDamage)
AddEmptyOption()
AddEmptyOption()
AddEmptyOption()
oToggleKey = AddKeyMapOption("Effects Toggle Hotkey", TrailsofDestructionToggleKey.GetValueInt())
AddEmptyOption()
AddEmptyOption()
AddEmptyOption()
oAccept = AddToggleOption("Accept Settings", bAccept)
Endif
EndEvent
Event OnOptionSelect(int Option)
If CurrentPage == "Trailing Effects"
If Option == oTrailEffectsToggle
bTrailEffectsToggle = !bTrailEffectsToggle
SetToggleOptionValue(oTrailEffectsToggle, bTrailEffectsToggle)
Endif
If Option == oTrailEffectOverride
bTrailEffectOverride = !bTrailEffectOverride
SetToggleOptionValue(oTrailEffectOverride, bTrailEffectOverride)
Endif
Elseif CurrentPage == "Player Effects"
If Option == oPlayerEffectsToggle
bPlayerEffectsToggle = !bPlayerEffectsToggle
SetToggleOptionValue(oPlayerEffectsToggle, bPlayerEffectsToggle)
Endif
If Option == oPlayerEffectOverride
bPlayerEffectOverride = !bPlayerEffectOverride
SetToggleOptionValue(oPlayerEffectOverride, bPlayerEffectOverride)
Endif
Elseif CurrentPage == "Misc and Accept"
If Option == oSound
bSound = !bSound
SetToggleOptionValue(oSound, bSound)
Endif
If Option == oDamage
bDamage = !bDamage
SetToggleOptionValue(oDamage, bDamage)
If bDamage == True
TrailsofDestructionDamageGlob.SetValue(1)
Else
TrailsofDestructionDamageGlob.SetValue(0)
Endif
Endif
If Option == oAccept
bAccept = !bAccept
SetToggleOptionValue(oAccept, bAccept)
Utility.Wait(1)
UpdateSettings()
bAccept = !bAccept
Endif
Endif
EndEvent
Event OnOptionMenuOpen(Int Option)
If CurrentPage == "Trailing Effects"
If Option == oTypeDropDownEffect
SetMenuDialogOptions(TrailEffectOptions)
SetMenuDialogStartIndex(iTrailEffect)
SetMenuDialogDefaultIndex(iTrailEffect)
Endif
If Option == oTypeDropDownTrail
SetMenuDialogOptions(TrailLengthOverride)
SetMenuDialogStartIndex(iTrailLength)
SetMenuDialogDefaultIndex(iTrailLength)
Endif
Elseif CurrentPage == "Player Effects"
If Option == oTypeDropDownEffectPlayer
SetMenuDialogOptions(PlayerEffectOptions)
SetMenuDialogStartIndex(iPlayerEffect)
SetMenuDialogDefaultIndex(iPlayerEffect)
Endif
Endif
EndEvent
Event OnOptionMenuAccept(Int Option, Int Index)
If CurrentPage == "Trailing Effects"
If Option == oTypeDropDownEffect
iTrailEffect = Index
SetMenuOptionValue(oTypeDropDownEffect, TrailEffectOptions[iTrailEffect])
Endif
If Option == oTypeDropDownTrail
iTrailLength = Index
SetMenuOptionValue(oTypeDropDownTrail, TrailLengthOverride[iTrailLength])
Endif
Elseif CurrentPage == "Player Effects"
If Option == oTypeDropDownEffectPlayer
iPlayerEffect = Index
SetMenuOptionValue(oTypeDropDownEffectPlayer, PlayerEffectOptions[iPlayerEffect])
Endif
Endif
EndEvent
Event OnOptionKeyMapChange(Int option, Int keyCode, String conflictControl, String conflictName)
If CurrentPage == "Misc and Accept"
If Option == oToggleKey
If conflictControl == ""
UnregisterForKey(TrailsofDestructionToggleKey.GetValueInt())
TrailsofDestructionToggleKey.SetValueInt(keyCode)
RegisterForKey(TrailsofDestructionToggleKey.GetValueInt())
Else
String Conflict = conflictName
Debug.MessageBox("Key Already in use")
Endif
Endif
Endif
EndEvent
Event OnOptionSliderOpen(Int Option)
If CurrentPage == "Player Effects"
If Option == oPlayerEffectLevel
SetSliderDialogStartValue(TrailsofDestructionPlayerEffectLevel.GetValue())
SetSliderDialogDefaultValue(50.0)
SetSliderDialogRange(1.0, 100.0)
SetSliderDialogInterval(1.0)
Endif
Endif
EndEvent
Event OnOptionSliderAccept(int option, float value)
If CurrentPage == "Player Effects"
if option == oPlayerEffectLevel
TrailsofDestructionPlayerEffectLevel.SetValue(value)
SetSliderOptionValue(oPlayerEffectLevel, TrailsofDestructionPlayerEffectLevel.GetValue())
Endif
Endif
EndEvent
Event OnOptionHighlight(Int Option)
If Option == oTrailEffectsToggle
SetInfoText("This turns on/off the trail effects.")
Elseif Option == oPlayerEffectsToggle
SetInfoText("This turns on/off the player effects.")
Elseif Option == oTrailEffectOverride
SetInfoText("Use this to choose the length of trail effect you would like below. Default uses your destruction level.")
Elseif Option == oPlayerEffectOverride
SetInfoText("Use this if you want to have a different effect on the player.")
Elseif Option == oTypeDropDownTrail
SetInfoText("Use this to change the length of trail you want. Default uses your destruction level.")
Elseif Option == oTypeDropDownEffect
SetInfoText("Use this to choose the type of trail you would like.")
Elseif Option == oTypeDropDownEffectPlayer
SetInfoText("Use this to choose the type of player effect you would like. The toggle above must be enabled for this to work.")
Elseif Option == oSound
SetInfoText("Turn on/off the sound on the trail effects.")
Elseif Option == oDamage
SetInfoText("Turn on/off the damage on the trail effects.")
Elseif Option == oAccept
SetInfoText("When you are ready turn this on and it will save and apply your settings.")
Elseif Option == oToggleKey
SetInfoText("Pick a hotkey to quickly turn on/off the effects.")
Elseif Option == oPlayerEffectLevel
SetInfoText("Use this to choose the destruction level when the effect on the player will show.")
Endif
EndEvent
Spell Property FireMoving Auto
Spell Property FireMovingNS Auto
Spell Property FrostMoving Auto
Spell Property FrostMovingNS Auto
Spell Property ShockMoving Auto
Spell Property ShockMovingNS Auto
Spell Property FirePlayerEffect Auto
Spell Property FrostPlayerEffect Auto
Spell Property ShockPlayerEffect Auto
Actor Property PlayerRef Auto
GlobalVariable Property TrailsofDestructionOverride Auto
GlobalVariable Property TrailsofDestructionDamageGlob Auto
GlobalVariable Property TrailsofDestructionToggleKey Auto
Function UpdateSettings()
PlayerRef.RemoveSpell(FireMoving)
PlayerRef.RemoveSpell(FireMovingNS)
PlayerRef.RemoveSpell(FrostMoving)
PlayerRef.RemoveSpell(FrostMovingNS)
PlayerRef.RemoveSpell(ShockMoving)
PlayerRef.RemoveSpell(ShockMovingNS)
PlayerRef.RemoveSpell(FirePlayerEffect)
PlayerRef.RemoveSpell(FrostPlayerEffect)
PlayerRef.RemoveSpell(ShockPlayerEffect)
If bTrailEffectsToggle == True
If iTrailEffect == 0
If bSound == True
PlayerRef.AddSpell(FireMoving, False)
Else
PlayerRef.AddSpell(FireMovingNS, False)
Endif
Elseif iTrailEffect == 1
If bSound == True
PlayerRef.AddSpell(FrostMoving, False)
Else
PlayerRef.AddSpell(FrostMovingNS, False)
Endif
Elseif iTrailEffect == 2
If bSound == True
PlayerRef.AddSpell(ShockMoving, False)
Else
PlayerRef.AddSpell(ShockMovingNS, False)
Endif
Endif
Endif
If bTrailEffectOverride == True
If iTrailLength == 0
TrailsofDestructionOverride.SetValue(1)
Elseif iTrailLength == 1
TrailsofDestructionOverride.SetValue(2)
Elseif iTrailLength == 2
TrailsofDestructionOverride.SetValue(3)
Endif
Else
TrailsofDestructionOverride.SetValue(0)
Endif
If bPlayerEffectsToggle == True
If bPlayerEffectOverride == False
iPlayerEffect = iTrailEffect
Endif
If iPlayerEffect == 0
PlayerRef.AddSpell(FirePlayerEffect, False)
Elseif iPlayerEffect == 1
PlayerRef.AddSpell(FrostPlayerEffect, False)
Elseif iPlayerEffect == 2
PlayerRef.AddSpell(ShockPlayerEffect, False)
Endif
Endif
EndFunction
Event OnKeyDown(Int KeyCode)
If !UI.IsTextInputEnabled()
If Keycode == TrailsofDestructionToggleKey.GetValueInt()
bKeyToggle = !bKeyToggle
If bKeyToggle == True
UpdateSettings()
Else
PlayerRef.RemoveSpell(FireMoving)
PlayerRef.RemoveSpell(FireMovingNS)
PlayerRef.RemoveSpell(FrostMoving)
PlayerRef.RemoveSpell(FrostMovingNS)
PlayerRef.RemoveSpell(ShockMoving)
PlayerRef.RemoveSpell(ShockMovingNS)
PlayerRef.RemoveSpell(FirePlayerEffect)
PlayerRef.RemoveSpell(FrostPlayerEffect)
PlayerRef.RemoveSpell(ShockPlayerEffect)
Endif
Endif
Endif
EndEvent