4
Fork 0

Simplified _00E_FS_NQR_SQ_01_Functions, removed SKSE dependency

development
Eddoursul 3 months ago
parent f3dea2bce8
commit f76762381f
  1. BIN
      Enderal - Forgotten Stories.esm
  2. BIN
      scripts/_00e_fs_nqr_sq_01_functions.pex
  3. 116
      source/scripts/_00e_fs_nqr_sq_01_functions.psc

Binary file not shown.

@ -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)
EndFunction
Event OnMenuClose(String MenuName)
GiveRewardNEW()
UnregisterForMenu("GiftMenu")
If MenuName == "GiftMenu" && FS_NQR05_SQ_01_FakeREF.GetNumItems() > 0
GiveRewardNEW()
EndIf
EndEvent
EndFunction
Function GiveRewardNEW()
int iTotalReward
Int NumItems = FS_NQR05_SQ_01_FakeREF.GetNumItems()
Int i = 0
int[] elementCountToRemoveForEachItem = Utility.CreateIntArray(_00E_FS_PyreanItems.getSize())
While (i < NumItems)
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
Int NumItems = FS_NQR05_SQ_01_FakeREF.GetNumItems()
if NumItems <= 0
return
endif
EndWhile
int iTotalReward
Int i = 0
While (i < NumItems)
i = 0
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 < _00E_FS_PyreanItems.GetSize())
FS_NQR05_SQ_01_FakeREF.RemoveItem(_00E_FS_PyreanItems.GetAt(i), elementCountToRemoveForEachItem[i])
i += 1
Endwhile
i += 1
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
Loading…
Cancel
Save