4
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

67 lines
1.9 KiB

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
Float newCarryWeight = Self.GetMagnitude() + PlayerREF.GetAV("Alteration")
_00E_FS_SpectralChestActorREF.SetAV("CarryWeight", newCarryWeight)
_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