Instant and SKSE-free dismantling list generation, added a script generating recipe conditions
This commit is contained in:
parent
b3058adf18
commit
315b7910eb
BIN
Dismantling update.esp
Normal file
BIN
Dismantling update.esp
Normal file
Binary file not shown.
@ -45,8 +45,9 @@ Gameplay changes:
|
|||||||
- Fixed visibility of the picnic quest marker in Cuthbert's Legacy.
|
- Fixed visibility of the picnic quest marker in Cuthbert's Legacy.
|
||||||
- Fixed the issue, when Ark citizens stopped reacting to player's crimes after signing contract with the Golden Sickle (reported by BallOfFire).
|
- Fixed the issue, when Ark citizens stopped reacting to player's crimes after signing contract with the Golden Sickle (reported by BallOfFire).
|
||||||
- Patched a source of infinite money, appearing during Every Day Like the Last, Part VI.
|
- Patched a source of infinite money, appearing during Every Day Like the Last, Part VI.
|
||||||
- Fixed inability to dismantle items after buying a house.
|
|
||||||
- Player no longer can leave the first conversation with Jespar.
|
- Player no longer can leave the first conversation with Jespar.
|
||||||
|
- Fixed inability to dismantle items after buying a house.
|
||||||
|
- Instant dismantling list generation. Surplus copies of equipped items can be dismantled as well.
|
||||||
- Due to changes in time calculation with active Slow Time effect in Skyrim SE 1.6+, echo visions started to end prematurely. Durations of the echoes have been updated for 1.6, but the slowdown effect now stays a few seconds too long on 1.5.97. Completed an unfinished vision in The Shards of Order, Part II.
|
- Due to changes in time calculation with active Slow Time effect in Skyrim SE 1.6+, echo visions started to end prematurely. Durations of the echoes have been updated for 1.6, but the slowdown effect now stays a few seconds too long on 1.5.97. Completed an unfinished vision in The Shards of Order, Part II.
|
||||||
- Added missing critical damage chance to 13 items, more consistent sound detection parameters.
|
- Added missing critical damage chance to 13 items, more consistent sound detection parameters.
|
||||||
- Updated dagger crit bonuses: minimum multiplier set to 2, fixed missing crit bonus with the Ambush daggers, increased bonus with mystical and unique items.
|
- Updated dagger crit bonuses: minimum multiplier set to 2, fixed missing crit bonus with the Ambush daggers, increased bonus with mystical and unique items.
|
||||||
|
BIN
_build/Enderal - Generate COBJ dismantling conditions.pas
(Stored with Git LFS)
Normal file
BIN
_build/Enderal - Generate COBJ dismantling conditions.pas
(Stored with Git LFS)
Normal file
Binary file not shown.
Binary file not shown.
@ -1,98 +1,41 @@
|
|||||||
Scriptname _00E_FS_Dismantle_Workbench extends ObjectReference
|
Scriptname _00E_FS_Dismantle_Workbench extends ObjectReference
|
||||||
{lets the player melt down items to one of its base components, extends the crafting classes}
|
{lets the player melt down items to one of its base components, extends the crafting classes}
|
||||||
|
|
||||||
; properties
|
|
||||||
Actor Property PlayerREF Auto
|
Actor Property PlayerREF Auto
|
||||||
FormList Property _00E_DismantleList Auto
|
ObjectReference Property _00E_RemoveAllItems_TrashContainer Auto
|
||||||
FormList Property _00E_DismantleItemList Auto
|
|
||||||
FormList Property _00E_DismantleResetList Auto
|
|
||||||
Message Property _00E_CheckForDismantlingMSG Auto
|
|
||||||
Keyword Property CraftingSmelterDismantling Auto
|
|
||||||
Keyword Property InvisibleDismantling Auto
|
|
||||||
Perk Property _00E_Class_Phasmalist_P04_A_ArcaneBreakdown Auto
|
|
||||||
|
|
||||||
; events
|
|
||||||
Event OnInit()
|
Event OnInit()
|
||||||
BlockActivation()
|
BlockActivation()
|
||||||
EndEvent
|
EndEvent
|
||||||
|
|
||||||
Event OnActivate(ObjectReference akActionRef)
|
Event OnActivate(ObjectReference akActionRef)
|
||||||
|
|
||||||
If Self.IsActivationBlocked()
|
Weapon rightHand = PlayerREF.GetEquippedWeapon(false)
|
||||||
RegisterForMenu("Crafting Menu")
|
Weapon leftHand = PlayerREF.GetEquippedWeapon(true)
|
||||||
; GenerateMeltDownList() is relatively slow due to using formlists hence we notify the player that something is calculated in the background
|
|
||||||
_00E_CheckForDismantlingMSG.Show()
|
|
||||||
GenerateMeltDownList()
|
|
||||||
Self.Activate(PlayerREF, true)
|
|
||||||
EndIf
|
|
||||||
|
|
||||||
Endevent
|
if rightHand || leftHand
|
||||||
|
_00E_RemoveAllItems_TrashContainer.RemoveAllItems()
|
||||||
Event OnMenuClose(String MenuName)
|
|
||||||
|
|
||||||
If menuName == ("Crafting Menu")
|
|
||||||
UnregisterForMenu("Crafting Menu")
|
|
||||||
ResetMeltDownList()
|
|
||||||
; only enable the player controls after everything is reset properly
|
|
||||||
Game.EnablePlayerControls()
|
|
||||||
EndIf
|
|
||||||
|
|
||||||
EndEvent
|
|
||||||
|
|
||||||
; functions
|
|
||||||
Function GenerateMeltDownList()
|
|
||||||
; this function is responsible for filling a list based on the items in the players inventory which can be melted down to crafting material
|
|
||||||
|
|
||||||
Int iTotalItemCount = PlayerREF.GetNumItems()
|
|
||||||
Int iItemCount = 0
|
|
||||||
Form ItemToCheck
|
|
||||||
Bool bPlayerHasArcaneBreakdown = PlayerREF.HasPerk(_00E_Class_Phasmalist_P04_A_ArcaneBreakdown)
|
|
||||||
Form equippedItemLeft = PlayerRef.GetEquippedObject(0)
|
|
||||||
Form equippedItemRight = PlayerRef.GetEquippedObject(1)
|
|
||||||
|
|
||||||
While iItemCount < iTotalItemCount
|
|
||||||
ItemToCheck = PlayerREF.GetNthForm(iItemCount)
|
|
||||||
|
|
||||||
If (ItemToCheck as Armor) != None ; armor
|
|
||||||
;checks the item if it's equipped and if it's either enchanted or if the player has the perk to dismantle enchantmented items
|
|
||||||
If ItemToCheck != equippedItemRight && ItemToCheck != equippedItemLeft && PlayerREF.IsEquipped(ItemToCheck) == False
|
|
||||||
If bPlayerHasArcaneBreakdown || (ItemToCheck as Armor).GetEnchantment() == None
|
|
||||||
AddItemToDismantleList(ItemToCheck)
|
|
||||||
EndIf
|
|
||||||
EndIf
|
|
||||||
ElseIf (ItemToCheck as Weapon) != None ; weapon
|
|
||||||
;checks the item if it's equipped and if it's either enchanted or if the player has the perk to dismantle enchantmented items
|
|
||||||
; Note: IsEquipped does not work for any stuff in the left hand when dual wielding
|
|
||||||
If ItemToCheck != equippedItemRight && ItemToCheck != equippedItemLeft
|
|
||||||
If bPlayerHasArcaneBreakdown || (ItemToCheck as Weapon).GetEnchantment() == None
|
|
||||||
AddItemToDismantleList(ItemToCheck)
|
|
||||||
EndIf
|
|
||||||
EndIf
|
|
||||||
EndIf
|
|
||||||
|
|
||||||
iItemCount += 1
|
if rightHand == leftHand
|
||||||
EndWhile
|
_00E_RemoveAllItems_TrashContainer.AddItem(rightHand, 2, true)
|
||||||
EndFunction
|
else
|
||||||
|
if rightHand
|
||||||
|
_00E_RemoveAllItems_TrashContainer.AddItem(rightHand, 1, true)
|
||||||
|
endif
|
||||||
|
if leftHand
|
||||||
|
_00E_RemoveAllItems_TrashContainer.AddItem(leftHand, 1, true)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
Function AddItemToDismantleList(Form itemToAdd)
|
Game.EnablePlayerControls()
|
||||||
; if the item passes the checks, we need to set the workbenchkeyword of the respective constructible object so it gets displayed properly in the menu
|
Activate(PlayerREF, true)
|
||||||
; it also adds it to the reset list so the keyword gets set back to the default one after exiting the menu
|
|
||||||
Int iFoundAtIndex = _00E_DismantleItemList.Find(itemToAdd)
|
|
||||||
If iFoundAtIndex >= 0
|
|
||||||
ConstructibleObject recipe = _00E_DismantleList.GetAt(iFoundAtIndex) as ConstructibleObject
|
|
||||||
recipe.SetWorkBenchKeyword(CraftingSmelterDismantling)
|
|
||||||
_00E_DismantleResetList.AddForm(recipe)
|
|
||||||
EndIf
|
|
||||||
EndFunction
|
|
||||||
|
|
||||||
Function ResetMeltDownList()
|
|
||||||
; this function resets the workbenchkeyword back to default
|
|
||||||
Int iTotalRecipesToReset = _00E_DismantleResetList.GetSize()
|
|
||||||
Int iRecipesToReset = iTotalRecipesToReset
|
|
||||||
|
|
||||||
While iRecipesToReset > 0
|
if rightHand || leftHand
|
||||||
iRecipesToReset -= 1
|
while ! Game.IsLookingControlsEnabled()
|
||||||
(_00E_DismantleResetList.GetAt(iRecipesToReset) as ConstructibleObject).SetWorkBenchKeyword(InvisibleDismantling)
|
Utility.Wait(0.5)
|
||||||
EndWhile
|
endwhile
|
||||||
_00E_DismantleResetList.Revert()
|
_00E_RemoveAllItems_TrashContainer.RemoveAllItems()
|
||||||
EndFunction
|
endif
|
||||||
|
|
||||||
|
Endevent
|
||||||
|
Loading…
Reference in New Issue
Block a user