42 lines
1.0 KiB
Plaintext
42 lines
1.0 KiB
Plaintext
Scriptname _00E_FS_Dismantle_Workbench extends ObjectReference
|
|
{lets the player melt down items to one of its base components, extends the crafting classes}
|
|
|
|
Actor Property PlayerREF Auto
|
|
ObjectReference Property _00E_RemoveAllItems_TrashContainer Auto
|
|
|
|
Event OnInit()
|
|
BlockActivation()
|
|
EndEvent
|
|
|
|
Event OnActivate(ObjectReference akActionRef)
|
|
|
|
Weapon rightHand = PlayerREF.GetEquippedWeapon(false)
|
|
Weapon leftHand = PlayerREF.GetEquippedWeapon(true)
|
|
|
|
if rightHand || leftHand
|
|
_00E_RemoveAllItems_TrashContainer.RemoveAllItems()
|
|
|
|
if rightHand == leftHand
|
|
_00E_RemoveAllItems_TrashContainer.AddItem(rightHand, 2, true)
|
|
else
|
|
if rightHand
|
|
_00E_RemoveAllItems_TrashContainer.AddItem(rightHand, 1, true)
|
|
endif
|
|
if leftHand
|
|
_00E_RemoveAllItems_TrashContainer.AddItem(leftHand, 1, true)
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
Game.EnablePlayerControls()
|
|
Activate(PlayerREF, true)
|
|
|
|
if rightHand || leftHand
|
|
while ! Game.IsLookingControlsEnabled()
|
|
Utility.Wait(0.5)
|
|
endwhile
|
|
_00E_RemoveAllItems_TrashContainer.RemoveAllItems()
|
|
endif
|
|
|
|
Endevent
|