-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathGELO_Script_Transcription.psc
49 lines (42 loc) · 1.35 KB
/
GELO_Script_Transcription.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
Scriptname GELO_Script_Transcription extends activemagiceffect
GELO_MenuMain Property GELO_MainMenu AUTO
ACTOR PROPERTY PlayerRef AUTO
Event OnEffectStart(Actor akTarget, Actor akCaster)
RegisterForMenu("Sleep/Wait Menu")
EndEvent
Event OnPlayerLoadGame()
RegisterForMenu("Sleep/Wait Menu")
EndEvent
Event OnMenuClose(String MenuName)
INT i = 0
INT delta
WHILE i < GELO_MainMenu.SignatureScrollList.Length
IF GELO_MainMenu.SignatureScrollList[i]
delta = GELO_MainMenu.ScrollCount - PlayerRef.GetItemCount(GELO_MainMenu.SignatureScrollList[i])
IF delta > 0
Refill(GELO_MainMenu.SignatureScrollList[i],delta)
ENDIF
ENDIF
i += 1
ENDWHILE
Debug.Notification("Scrolls Restocked")
EndEvent
FORM PROPERTY GrimyArcaneDust AUTO
FORM PROPERTY Charcoal AUTO
FORM PROPERTY PaperRoll AUTO
Function Refill(SCROLL akScroll, INT akNum)
int akCount = akNum
IF PlayerRef.GetItemCount(GrimyArcaneDust) < akCount
akCount = PlayerRef.GetItemCount(GrimyArcaneDust)
ENDIF
IF PlayerRef.GetItemCount(Charcoal) < akCount
akCount = PlayerRef.GetItemCount(Charcoal)
ENDIF
IF PlayerRef.GetItemCount(PaperRoll) < akCount
akCount = PlayerRef.GetItemCount(PaperRoll)
ENDIF
PlayerRef.RemoveItem(GrimyArcaneDust,akCount,true)
PlayerRef.RemoveItem(Charcoal,akCount,true)
PlayerRef.RemoveItem(PaperRoll,akCount,true)
PlayerRef.AddItem(akScroll,akCount,true)
EndFunction