2021-10-05 22:15:58 +00:00
|
|
|
Scriptname _00E_FS_SpectralChestSC extends ActiveMagicEffect
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; EVENTS
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
Event OnEffectStart(Actor akTarget, Actor akCaster)
|
|
|
|
|
|
|
|
If PlayerREF.GetParentCell() == MQ05Jail
|
|
|
|
|
|
|
|
_00E_FS_SpectralChestNotHere.Show()
|
|
|
|
|
|
|
|
ElseIf PlayerREF.IsInCombat()
|
|
|
|
|
|
|
|
_00E_FS_SpectralChestNotInCombat.Show()
|
|
|
|
|
|
|
|
Else
|
|
|
|
|
2023-12-08 02:45:53 +00:00
|
|
|
Float newCarryWeight = Self.GetMagnitude() + PlayerREF.GetActorValue("Alteration")
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2023-12-08 02:45:53 +00:00
|
|
|
_00E_FS_SpectralChestActorREF.SetActorValue("CarryWeight", newCarryWeight)
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
_00E_FS_SpectralChestActorREF.SetPlayerTeammate(True, True)
|
|
|
|
Utility.Wait(0.1)
|
|
|
|
_00E_FS_SpectralChestCapacity.Show(_00E_FS_SpectralChestActorREF.GetTotalItemWeight(), newCarryWeight)
|
|
|
|
_00E_FS_SpectralChestActorREF.OpenInventory()
|
|
|
|
DRScTreasureOpen.Play(PlayerREF)
|
|
|
|
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
Float Function GetCurrentWeight(Actor akActor)
|
|
|
|
|
|
|
|
Int NumItems = akActor.GetNumItems()
|
|
|
|
Int i = 0
|
|
|
|
Float fCurrentWeight
|
|
|
|
|
|
|
|
While (i < NumItems)
|
|
|
|
|
|
|
|
Form Entry = akActor.GetNthForm(i)
|
|
|
|
Float fEntryItemCount = akActor.GetItemCount(Entry) as Float
|
|
|
|
; iCurrentWeight += math.Ceiling(Entry.GetWeight() * iEntryItemCount)
|
|
|
|
fCurrentWeight += Entry.GetWeight() * fEntryItemCount
|
|
|
|
|
|
|
|
i += 1
|
|
|
|
|
|
|
|
EndWhile
|
|
|
|
|
|
|
|
Return fCurrentWeight
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; PROPERTIES
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
Actor Property PlayerREF Auto
|
|
|
|
Actor Property _00E_FS_SpectralChestActorREF Auto
|
|
|
|
|
|
|
|
Sound Property DRScTreasureOpen Auto
|
|
|
|
|
|
|
|
Message Property _00E_FS_SpectralChestNotHere Auto
|
|
|
|
Message Property _00E_FS_SpectralChestNotInCombat Auto
|
|
|
|
Message Property _00E_FS_SpectralChestCapacity Auto
|
|
|
|
|
|
|
|
Cell Property MQ05Jail Auto
|