diff --git a/Dismantling update.esp b/Dismantling update.esp new file mode 100644 index 00000000..4a5d2557 Binary files /dev/null and b/Dismantling update.esp differ diff --git a/Enderal SE v2.1.0 Changelog.txt b/Enderal SE v2.1.0 Changelog.txt index d13ef5c1..65c1c075 100644 --- a/Enderal SE v2.1.0 Changelog.txt +++ b/Enderal SE v2.1.0 Changelog.txt @@ -45,8 +45,9 @@ Gameplay changes: - 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). - 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. +- 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. - 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. diff --git a/_build/Enderal - Generate COBJ dismantling conditions.pas b/_build/Enderal - Generate COBJ dismantling conditions.pas new file mode 100644 index 00000000..70f56689 --- /dev/null +++ b/_build/Enderal - Generate COBJ dismantling conditions.pas @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:564df24472fd8ed43f1fd7725b1c1c929e4c410a768b4cfd6872d10e1e7c42a7 +size 5830 diff --git a/scripts/_00e_fs_dismantle_workbench.pex b/scripts/_00e_fs_dismantle_workbench.pex index a72fec29..da823726 100644 Binary files a/scripts/_00e_fs_dismantle_workbench.pex and b/scripts/_00e_fs_dismantle_workbench.pex differ diff --git a/source/scripts/_00e_fs_dismantle_workbench.psc b/source/scripts/_00e_fs_dismantle_workbench.psc index 3a789922..408a4958 100644 --- a/source/scripts/_00e_fs_dismantle_workbench.psc +++ b/source/scripts/_00e_fs_dismantle_workbench.psc @@ -1,98 +1,41 @@ Scriptname _00E_FS_Dismantle_Workbench extends ObjectReference {lets the player melt down items to one of its base components, extends the crafting classes} -; properties Actor Property PlayerREF Auto -FormList Property _00E_DismantleList 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 +ObjectReference Property _00E_RemoveAllItems_TrashContainer Auto -; events Event OnInit() BlockActivation() EndEvent Event OnActivate(ObjectReference akActionRef) - If Self.IsActivationBlocked() - RegisterForMenu("Crafting Menu") - ; 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 + Weapon rightHand = PlayerREF.GetEquippedWeapon(false) + Weapon leftHand = PlayerREF.GetEquippedWeapon(true) -Endevent - -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 + if rightHand || leftHand + _00E_RemoveAllItems_TrashContainer.RemoveAllItems() - iItemCount += 1 - EndWhile -EndFunction - -Function AddItemToDismantleList(Form itemToAdd) - ; 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 - ; 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 + 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 - While iRecipesToReset > 0 - iRecipesToReset -= 1 - (_00E_DismantleResetList.GetAt(iRecipesToReset) as ConstructibleObject).SetWorkBenchKeyword(InvisibleDismantling) - EndWhile - _00E_DismantleResetList.Revert() -EndFunction \ No newline at end of file +Endevent