Simplified _00E_FS_NQR_SQ_01_Functions, removed SKSE dependency

This commit is contained in:
Eddoursul 2024-01-29 05:52:32 +01:00
parent f3dea2bce8
commit f76762381f
3 changed files with 28 additions and 88 deletions

Binary file not shown.

View File

@ -1,7 +1,7 @@
Scriptname _00E_FS_NQR_SQ_01_Functions extends Quest Scriptname _00E_FS_NQR_SQ_01_Functions extends Quest
;===================================================================================== ;=====================================================================================
; FUNCTIONS ; FUNCTIONS
;===================================================================================== ;=====================================================================================
Function SetUp() Function SetUp()
@ -14,107 +14,47 @@ Function SetUp()
EndFunction EndFunction
;Old Function
;Function GiveReward()
;
; int iTotalReward
; Int NumItems = PlayerREF.GetNumItems()
; Int i = 0
;
; int[] elementCountToRemoveForEachItem = Utility.CreateIntArray(_00E_FS_PyreanItems.getSize())
;
; While (i < NumItems)
;
; Form Entry = PlayerREF.GetNthForm(i)
;
; If Entry as MiscObject
;
; if _00E_FS_PyreanItems.HasForm(Entry)
;
; Int itemIndexInFormlist = _00E_FS_PyreanItems.Find(Entry)
; float fValue = (Entry.GetGoldValue() + Entry.GetGoldValue()*0.33)*PlayerREF.GetItemCount(Entry)
;
; iTotalReward = iTotalReward + fValue as Int
; elementCountToRemoveForEachItem[itemIndexInFormlist] = PlayerREF.GetItemCount(Entry)
;
; EndIf
; EndIf
;
; i += 1
;
; EndWhile
;
; i = 0
;
; While (i < _00E_FS_PyreanItems.GetSize())
; PlayerREF.RemoveItem(_00E_FS_PyreanItems.GetAt(i), elementCountToRemoveForEachItem[i])
; i += 1
; Endwhile
;
; PlayerREF.AddItem(Gold001, iTotalReward)
;
;EndFunction
Function OpenGiftmenu() Function OpenGiftmenu()
RegisterForMenu("GiftMenu") FS_NQR05_SQ_01_FakeREF.RemoveAllItems()
FS_NQR05_SQ_01_FakeREF.AddInventoryEventFilter(_00E_FS_PyreanItems) FS_NQR05_SQ_01_FakeREF.ShowGiftMenu(True, _00E_FS_PyreanMiscItems, True, False)
FS_NQR05_SQ_01_FakeREF.ShowGiftMenu(True, _00E_FS_PyreanItems, True, False) Utility.Wait(0.2)
FS_NQR05_SQ_01_FakeREF.RemoveAllInventoryEventFilters()
GiveRewardNEW()
EndFunction EndFunction
Event OnMenuClose(String MenuName)
UnregisterForMenu("GiftMenu")
If MenuName == "GiftMenu" && FS_NQR05_SQ_01_FakeREF.GetNumItems() > 0
GiveRewardNEW()
EndIf
EndEvent
Function GiveRewardNEW() Function GiveRewardNEW()
Int NumItems = FS_NQR05_SQ_01_FakeREF.GetNumItems()
if NumItems <= 0
return
endif
int iTotalReward int iTotalReward
Int NumItems = FS_NQR05_SQ_01_FakeREF.GetNumItems() Int i = 0
Int i = 0 While (i < NumItems)
int[] elementCountToRemoveForEachItem = Utility.CreateIntArray(_00E_FS_PyreanItems.getSize()) Form Entry = FS_NQR05_SQ_01_FakeREF.GetNthForm(i)
int iGoldValue = Entry.GetGoldValue()
While (i < NumItems) if iGoldValue > 0
float fValue = (iGoldValue + iGoldValue * 0.33) * FS_NQR05_SQ_01_FakeREF.GetItemCount(Entry)
iTotalReward = iTotalReward + fValue as Int
endif
Form Entry = FS_NQR05_SQ_01_FakeREF.GetNthForm(i) i += 1
If Entry as MiscObject EndWhile
if _00E_FS_PyreanItems.HasForm(Entry) FS_NQR05_SQ_01_FakeREF.RemoveAllItems()
PlayerREF.AddItem(Gold001, iTotalReward)
Int itemIndexInFormlist = _00E_FS_PyreanItems.Find(Entry)
float fValue = (Entry.GetGoldValue() + Entry.GetGoldValue()*0.33)*FS_NQR05_SQ_01_FakeREF.GetItemCount(Entry)
iTotalReward = iTotalReward + fValue as Int
elementCountToRemoveForEachItem[itemIndexInFormlist] = FS_NQR05_SQ_01_FakeREF.GetItemCount(Entry)
EndIf
EndIf
i += 1
EndWhile
i = 0
While (i < _00E_FS_PyreanItems.GetSize())
FS_NQR05_SQ_01_FakeREF.RemoveItem(_00E_FS_PyreanItems.GetAt(i), elementCountToRemoveForEachItem[i])
i += 1
Endwhile
PlayerREF.AddItem(Gold001, iTotalReward)
EndFunction EndFunction
;===================================================================================== ;=====================================================================================
; PROPERTIES ; PROPERTIES
;===================================================================================== ;=====================================================================================
Actor Property FS_NQR_SQ_01_ScionGustavREF Auto Actor Property FS_NQR_SQ_01_ScionGustavREF Auto
@ -123,6 +63,6 @@ Actor Property FS_NQR05_SQ_01_FakeREF Auto
Scene Property FS_NQR_SQ_01_Scene_01 Auto Scene Property FS_NQR_SQ_01_Scene_01 Auto
Formlist Property _00E_FS_PyreanItems Auto Formlist Property _00E_FS_PyreanMiscItems Auto
MiscObject Property Gold001 Auto MiscObject Property Gold001 Auto