44 lines
1.2 KiB
Plaintext
44 lines
1.2 KiB
Plaintext
|
Scriptname _00E_SafeItemRemove extends Quest Hidden
|
||
|
|
||
|
Function RemoveAllItemsSafeVersion(ObjectReference TransferToLoc = NONE)
|
||
|
If Gold001 == NONE || _00E_AllAmmos == NONE
|
||
|
Return
|
||
|
EndIf
|
||
|
|
||
|
RemoveItemsIncrementally(Gold001, TransferToLoc)
|
||
|
Form[] arrows = _00E_AllAmmos.ToArray()
|
||
|
Int i = 0
|
||
|
While i < arrows.Length
|
||
|
RemoveItemsIncrementally(arrows[i], TransferToLoc)
|
||
|
i += 1
|
||
|
EndWhile
|
||
|
|
||
|
If TransferToLoc == NONE
|
||
|
PlayerREF.removeAllItems(_00E_RemoveAllItems_TrashContainer, abRemoveQuestItems = false)
|
||
|
_00E_RemoveAllItems_TrashContainer.removeAllItems()
|
||
|
Else
|
||
|
PlayerREF.RemoveAllItems(akTransferTo = TransferToLoc, abRemoveQuestItems = true)
|
||
|
EndIf
|
||
|
EndFunction
|
||
|
|
||
|
Function RemoveItemsIncrementally(Form akItem, ObjectReference TransferToLoc)
|
||
|
Int nCount = PlayerREF.GetItemCount(akItem)
|
||
|
If nCount > 3000000 && akItem == Gold001
|
||
|
_00E_PleaseRemoveMoney.Show()
|
||
|
EndIf
|
||
|
While nCount > 0
|
||
|
PlayerREF.RemoveItem(akItem, 10000, true, TransferToLoc)
|
||
|
nCount -= 10000
|
||
|
EndWhile
|
||
|
EndFunction
|
||
|
|
||
|
MiscObject Property Gold001 Auto
|
||
|
|
||
|
FormList Property _00E_AllAmmos Auto
|
||
|
|
||
|
actor Property PlayerRef Auto
|
||
|
|
||
|
ObjectReference Property _00E_RemoveAllItems_TrashContainer Auto
|
||
|
|
||
|
Message Property _00E_PleaseRemoveMoney Auto
|