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
;=====================================================================================
; FUNCTIONS
; FUNCTIONS
;=====================================================================================
Function SetUp()
@ -14,107 +14,47 @@ Function SetUp()
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()
RegisterForMenu("GiftMenu")
FS_NQR05_SQ_01_FakeREF.AddInventoryEventFilter(_00E_FS_PyreanItems)
FS_NQR05_SQ_01_FakeREF.ShowGiftMenu(True, _00E_FS_PyreanItems, True, False)
FS_NQR05_SQ_01_FakeREF.RemoveAllInventoryEventFilters()
FS_NQR05_SQ_01_FakeREF.RemoveAllItems()
FS_NQR05_SQ_01_FakeREF.ShowGiftMenu(True, _00E_FS_PyreanMiscItems, True, False)
Utility.Wait(0.2)
GiveRewardNEW()
EndFunction
Event OnMenuClose(String MenuName)
UnregisterForMenu("GiftMenu")
If MenuName == "GiftMenu" && FS_NQR05_SQ_01_FakeREF.GetNumItems() > 0
GiveRewardNEW()
EndIf
EndEvent
Function GiveRewardNEW()
Int NumItems = FS_NQR05_SQ_01_FakeREF.GetNumItems()
if NumItems <= 0
return
endif
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()
if iGoldValue > 0
float fValue = (iGoldValue + iGoldValue * 0.33) * FS_NQR05_SQ_01_FakeREF.GetItemCount(Entry)
iTotalReward = iTotalReward + fValue as Int
endif
While (i < NumItems)
i += 1
Form Entry = FS_NQR05_SQ_01_FakeREF.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)*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)
EndWhile
FS_NQR05_SQ_01_FakeREF.RemoveAllItems()
PlayerREF.AddItem(Gold001, iTotalReward)
EndFunction
;=====================================================================================
; PROPERTIES
; PROPERTIES
;=====================================================================================
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
Formlist Property _00E_FS_PyreanItems Auto
Formlist Property _00E_FS_PyreanMiscItems Auto
MiscObject Property Gold001 Auto