2021-10-05 22:15:58 +00:00
|
|
|
Scriptname _00E_LootContainer extends ObjectReference
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; EVENTS
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
Event OnInit()
|
2024-02-05 13:15:49 +00:00
|
|
|
BlockActivation()
|
2021-10-05 22:15:58 +00:00
|
|
|
EndEvent
|
|
|
|
|
|
|
|
Event OnActivate(ObjectReference akActionRef)
|
|
|
|
|
2024-02-05 13:15:49 +00:00
|
|
|
Actor PlayerREF = Game.GetForm(0x14) as Actor
|
|
|
|
|
|
|
|
if AkActionRef != PlayerREF
|
|
|
|
return
|
|
|
|
endif
|
|
|
|
|
|
|
|
int iCurrentGoldCount = GetItemCount(Gold001)
|
|
|
|
|
|
|
|
if iCurrentGoldCount == 0
|
|
|
|
return
|
|
|
|
endif
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2024-02-05 13:15:49 +00:00
|
|
|
DisableNoWait()
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2024-02-05 13:15:49 +00:00
|
|
|
iCurrentGoldCount += GetGoldBonus(PlayerREF.GetActorValue("Lockpicking"), iCurrentGoldCount)
|
|
|
|
PlayerREF.AddItem(Gold001, iCurrentGoldCount)
|
|
|
|
|
|
|
|
RemoveAllItems()
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; FUNCTIONS
|
|
|
|
;=====================================================================================
|
|
|
|
|
2024-02-05 13:15:49 +00:00
|
|
|
int Function GetGoldBonus(float fPlayerLockpicking, int iCurrentGoldCount)
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2024-02-05 13:15:49 +00:00
|
|
|
if fPlayerLockpicking as int < 15
|
|
|
|
return 0
|
|
|
|
endif
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2024-02-05 13:15:49 +00:00
|
|
|
int iGoldMultiplicator = _00E_GoldMult.GetValue() as int
|
|
|
|
|
|
|
|
if iGoldMultiplicator <= 0
|
|
|
|
iGoldMultiplicator = 5
|
|
|
|
endif
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2024-02-05 13:15:49 +00:00
|
|
|
float fIncrementPercentage = (fPlayerLockpicking / iGoldMultiplicator) / 100
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2024-02-05 13:15:49 +00:00
|
|
|
return (iCurrentGoldCount * fIncrementPercentage) as Int
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; PROPERTIES
|
|
|
|
;=====================================================================================
|
|
|
|
|
2024-02-05 13:15:49 +00:00
|
|
|
MiscObject Property Gold001 Auto
|
|
|
|
GlobalVariable Property _00E_GoldMult Auto
|