4
Fork 0

Merge branch 'crafting-refactoring' into development

master
Eddoursul 2 years ago
commit 8210468f79
  1. BIN
      Enderal - Forgotten Stories.esm
  2. 21
      Enderal - Forgotten Stories.esm.xml
  3. BIN
      OnItemAdded Optimization.esp
  4. BIN
      Skyrim.esm
  5. BIN
      TheriantrophistControlQuest optimization and graceful degradation.esp
  6. BIN
      scripts/PRKF__00E_CraftQuestPotionPe_0300146D.pex
  7. BIN
      scripts/PRKF__00E_FS_NQ07_CraftPotio_0300146E.pex
  8. BIN
      scripts/PRKF__00E_SE_2_0_12_UpgradeP_030090B3.pex
  9. BIN
      scripts/PRKF__00E_SE_DismantlePerk_03009D21.pex
  10. BIN
      scripts/_00e_fs_nq05_functions.pex
  11. BIN
      scripts/_00e_fs_nq07_functions.pex
  12. BIN
      scripts/_00e_fs_smelter_workbench.pex
  13. BIN
      scripts/_00e_playerhousingmaster.pex
  14. BIN
      scripts/_00e_playersetupscript.pex
  15. BIN
      scripts/_00e_theriantrophist_alchemycontrol.pex
  16. BIN
      scripts/_00e_theriantrophist_blockcraftingsc.pex
  17. BIN
      scripts/_00e_theriantrophist_summonlabsc.pex
  18. BIN
      scripts/_00e_theriantrophist_transformsc.pex
  19. BIN
      scripts/enderallib.pex
  20. BIN
      scripts/fs_nq05_alchemyscript.pex
  21. BIN
      scripts/fs_nq07_alchemyscript.pex
  22. BIN
      scripts/prkf__00e_fs_werewolfprevent_0300146d.pex
  23. BIN
      scripts/qf_fs_nq05_0101c82f.pex
  24. BIN
      scripts/qf_fs_nq07_0101ca09.pex
  25. 19
      source/scripts/PRKF__00E_CraftQuestPotionPe_0300146D.psc
  26. 19
      source/scripts/PRKF__00E_FS_NQ07_CraftPotio_0300146E.psc
  27. 16
      source/scripts/PRKF__00E_SE_2_0_12_UpgradeP_030090B3.psc
  28. 26
      source/scripts/PRKF__00E_SE_DismantlePerk_03009D21.psc
  29. 19
      source/scripts/_00e_fs_nq05_functions.psc
  30. 18
      source/scripts/_00e_fs_nq07_functions.psc
  31. 27
      source/scripts/_00e_fs_smelter_workbench.psc
  32. 6
      source/scripts/_00e_playerhousingmaster.psc
  33. 57
      source/scripts/_00e_playersetupscript.psc
  34. 183
      source/scripts/_00e_theriantrophist_alchemycontrol.psc
  35. 28
      source/scripts/_00e_theriantrophist_blockcraftingsc.psc
  36. 51
      source/scripts/_00e_theriantrophist_summonlabsc.psc
  37. 10
      source/scripts/_00e_theriantrophist_transformsc.psc
  38. 6
      source/scripts/enderallib.psc
  39. 20
      source/scripts/fs_nq05_alchemyscript.psc
  40. 19
      source/scripts/fs_nq07_alchemyscript.psc
  41. 15
      source/scripts/prkf__00e_fs_werewolfprevent_0300146d.psc
  42. 3
      source/scripts/qf_fs_nq05_0101c82f.psc
  43. 4
      source/scripts/qf_fs_nq07_0101ca09.psc

Binary file not shown.

@ -2,10 +2,10 @@
<plugin version="0.7.4">
<TES4 flags="0x00000081" id="00000000" day="0" month="0" lastUserID="0" currentUserID="0" version="44" unknown="0x0000">
<HEDR>
<struct version="1.70000005" numRecords="42830" nextObjectID="00014cf3" />
<struct version="1.70000005" numRecords="42831" nextObjectID="00014cf3" />
</HEDR>
<CNAM>Niseam</CNAM>
<SNAM>Enderal: Forgotten Stories (Special Edition) 2.0.11</SNAM>
<SNAM>Enderal: Forgotten Stories (Special Edition) 2.0.12</SNAM>
<MAST>Skyrim.esm</MAST>
<DATA>0</DATA>
<MAST>Update.esm</MAST>
@ -140639,6 +140639,9 @@
<property name="Levelsystem" type="1" status="1">
<object formID="00010aa2" alias="65535" unused="0x0000" />
</property>
<property name="" type="1" status="1">
<object formID="000493b8" alias="65535" unused="0x0000" />
</property>
</script>
<script name="_00E_StanceLoadFailsafeSC" status="0">
<property name="_00E_Class_Vandal_P04_Talent_SkaraggianStance_02" type="1" status="1">
@ -854073,6 +854076,20 @@
<LNAM>0202e68e</LNAM>
<LNAM>0201e8fc</LNAM>
</FLST>
<FLST flags="0x00000000" id="000493b8" day="0" month="0" lastUserID="0" currentUserID="0" version="44" unknown="0x0000">
<EDID>PlayerPerks</EDID>
<LNAM>000cb40d</LNAM>
<LNAM>000cb40e</LNAM>
<LNAM>000cb40f</LNAM>
<LNAM>000cb410</LNAM>
<LNAM>000cb411</LNAM>
<LNAM>000cb412</LNAM>
<LNAM>000cb413</LNAM>
<LNAM>000cb414</LNAM>
<LNAM>00052190</LNAM>
<LNAM>0202f218</LNAM>
<LNAM>0202f219</LNAM>
</FLST>
<FLST flags="0x00000000" id="00082f6e" day="0" month="0" lastUserID="0" currentUserID="0" version="44" unknown="0x0000">
<EDID>TrapGasMagicDrawn</EDID>
<LNAM>00035d7f</LNAM>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,19 @@
;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 12
Scriptname PRKF__00E_CraftQuestPotionPe_0300146D Extends Perk Hidden
;BEGIN FRAGMENT Fragment_7
Function Fragment_7(ObjectReference akTargetRef, Actor akActor)
;BEGIN CODE
if FS_NQ05.GetStage() >= 40
Game.GetPlayer().RemovePerk(Self)
return
endif
(FS_NQ05 as _00E_FS_NQ05_Functions).AskCreatePotion()
;END CODE
EndFunction
;END FRAGMENT
;END FRAGMENT CODE - Do not edit anything between this and the begin comment
Quest Property FS_NQ05 Auto

@ -0,0 +1,19 @@
;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 10
Scriptname PRKF__00E_FS_NQ07_CraftPotio_0300146E Extends Perk Hidden
;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akTargetRef, Actor akActor)
;BEGIN CODE
if FS_NQ07.GetStage() >= 120
Game.GetPlayer().RemovePerk(Self)
return
endif
(FS_NQ07 as _00E_FS_NQ07_Functions).AskCreatePotion()
;END CODE
EndFunction
;END FRAGMENT
;END FRAGMENT CODE - Do not edit anything between this and the begin comment
Quest Property FS_NQ07 Auto

@ -0,0 +1,16 @@
;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 3
Scriptname PRKF__00E_SE_2_0_12_UpgradeP_030090B3 Extends Perk Hidden
;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akTargetRef, Actor akActor)
;BEGIN CODE
if akTargetRef.IsActivationBlocked()
akTargetRef.Activate(akActor, true)
akTargetRef.BlockActivation(False)
endif
;END CODE
EndFunction
;END FRAGMENT
;END FRAGMENT CODE - Do not edit anything between this and the begin comment

@ -0,0 +1,26 @@
;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 8
Scriptname PRKF__00E_SE_DismantlePerk_03009D21 Extends Perk Hidden
;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akTargetRef, Actor akActor)
;BEGIN CODE
int iButton = _00E_Smelting_DismantlingMSG.Show()
If iButton == 0 ; if the player wants to process ore into ingots
akTargetRef.Activate(akActor, true)
ElseIf iButton == 1 ; if the player wants to dismantle items back into crafting components, disable player controls
Game.DisablePlayerControls(true, true, true, true, true, true, true, true)
_00E_Dismantling_SmelterREF.Activate(akActor)
Else
return
EndIf
;END CODE
EndFunction
;END FRAGMENT
;END FRAGMENT CODE - Do not edit anything between this and the begin comment
Message Property _00E_Smelting_DismantlingMSG Auto
ObjectReference Property _00E_Dismantling_SmelterREF Auto

@ -197,6 +197,22 @@ Function PrepareEnde4()
EndFunction
Function AskCreatePotion()
Int qStage = Self.GetStage()
If qStage >= 30 && qStage < 40
If FS_NQ05_AlchemyMessagebox.Show() == 0
Self.SetStage(40)
PlayerREF.RemoveItem(Vynroot, 1)
PlayerREF.RemoveItem(SkeeverTail, 1)
PlayerREF.RemoveItem(MothWingMonarch, 1)
PlayerREF.RemoveItem(Garlic, 1)
PlayerREF.RemoveItem(_00E_FS_NQ05_Rezept, 1)
EndIf
EndIf
EndFunction
;=====================================================================================
; EVENTS
;=====================================================================================
@ -266,4 +282,5 @@ Scene Property FS_NQ05_SceneKeller Auto
Scene Property FS_NQ05_SceneTochter Auto
Scene Property FS_NQ05_SceneGoAway Auto
Sound Property _00E_FS_NQ05_FemaleMumblingM Auto
Sound Property _00E_FS_NQ05_FemaleMumblingM Auto
Message Property FS_NQ05_AlchemyMessagebox Auto

@ -554,6 +554,20 @@ Function UpdateAarosCarryTraySpell() ; Version 2.0.8 Update
EndIf
EndFunction
Function AskCreatePotion()
If Self.GetStage() == 115
If _00E_FS_NQ07_AlchemyMessagebox.Show() == 0
Self.SetStage(120)
PlayerREF.RemoveItem(FoodMead, 1)
PlayerREF.RemoveItem(FrostMirriam, 2)
PlayerREF.RemoveItem(FoodBananenschnaps, 1)
PlayerREF.RemoveItem(_00E_FS_NQ07_Rezept, 1)
EndIf
EndIf
EndFunction
;=====================================================================================
; PROPERTIES
@ -593,6 +607,7 @@ GlobalVariable Property _00E_AchievementsEnabled Auto
GlobalVariable Property _00E_TeleportGlobal Auto
Message Property _00E_FS_NQ07_Thoughts Auto
Message Property _00E_FS_NQ07_AlchemyMessagebox Auto
MiscObject Property Gold001 Auto
MiscObject Property _00E_FS_NQ07_Borstenbeutel Auto
@ -651,10 +666,13 @@ ObjectReference Property _00E_FS_NQ07_AuroraTeleportMarkerREF Auto
ImageSpaceModifier Property MAGShockExpMassImod Auto
Potion Property FoodMead Auto
Potion Property FoodBananenschnaps Auto
Potion Property _00E_DalSarkerHoneywine Auto
Potion Property FoodChickenCooked Auto
Potion Property FoodCabbagePotatoSoup Auto
Ingredient Property FrostMirriam Auto
Spell Property _00E_AbCarryDrinkTray_Old Auto
Spell Property _00E_AbCarryDrinkTray_New Auto
Spell Property _00E_FS_NQ07_LightSpell Auto

@ -7,28 +7,5 @@ Message Property _00E_Smelting_DismantlingMSG Auto
Race Property _00E_Theriantrophist_PlayerWerewolfRace Auto
ObjectReference Property _00E_Dismantling_SmelterREF Auto
Event OnInit()
BlockActivation()
Endevent
Event OnActivate(ObjectReference akActionRef)
; block the player from activating the smelter when being transformed in werewolf due to animation bugs
If akActionRef == PlayerREF && PlayerREF.GetRace() == _00E_Theriantrophist_PlayerWerewolfRace
_00E_Theriantrophist_CantCraftMSG.Show()
ElseIf akActionRef == PlayerREF && !(PlayerREF.GetRace() == _00E_Theriantrophist_PlayerWerewolfRace)
int iButton = _00E_Smelting_DismantlingMSG.Show()
If iButton == 0 ; if the player wants to process ore into ingots
Self.Activate(akActionRef, true)
ElseIf iButton == 1 ; if the player wants to dismantle items back into crafting components, disable player controls
Game.DisablePlayerControls(true, true, true, true, true, true, true, true)
_00E_Dismantling_SmelterREF.Activate(PlayerREF)
Else
return
EndIf
Else
Self.Activate(akActionRef, true) ; if it's not the player but an NPC
EndIf
Endevent
; The script is obsolete as of 2.0.12 and has been replaced with a perk.
; Do not add it to new references.

@ -1,4 +1,4 @@
scriptname _00E_PlayerhousingMaster extends Quest
scriptname _00E_PlayerhousingMaster extends Quest Conditional
Actor Property player Auto
ReferenceAlias Property currentHousingObjectInTranslation Auto
@ -20,8 +20,8 @@ GlobalVariable Property _00E_DisableCraftingTutorials Auto
_00E_Playerhousing_Furniture currentHousingObject
Bool bIsInPlacementMode = False
Bool bDisableNormalActivation = False
Bool Property bIsInPlacementMode = False Auto Conditional
Bool Property bDisableNormalActivation = False Auto Conditional
Bool bGamepadMode = False
Bool bDroppedFromInventory = False
Int iPickupKey

@ -1,7 +1,7 @@
Scriptname _00E_PlayerSetUpScript extends ObjectReference
{Initializes all the necessary Quests, maintains the player, contains various OnPlayerLoadGame() failsafes. This script is important for proper updating, do not overwrite it.}
Float Property CURRENT_PATCH_VERSION = 2.11 AutoReadOnly
Float Property CURRENT_PATCH_VERSION = 2.12 AutoReadOnly
;=====================================================================================
@ -35,12 +35,16 @@ Event OnInit()
; starts all quests that are in the formlist
Int iIndex = QuestsToStart.GetSize()
While iIndex
While iIndex > 0
iIndex -= 1
Quest kQuest = QuestsToStart.GetAt(iIndex) as Quest
kQuest.Start()
endwhile
; Added in 2.0.12
AddPlayerPerks()
EndEvent
Event OnPlayerLoadGame()
@ -148,6 +152,33 @@ Function Update_210()
EndFunction
;=====================================================================================
; 2.0.12
;=====================================================================================
Function Update_212()
;
EndFunction
Function AddPlayerPerks()
if PlayerPerks == None
PlayerPerks = Game.GetForm(0x000493B8) as FormList
endif
Perk kPerk
int iIndex = PlayerPerks.GetSize()
While iIndex > 0
iIndex -= 1
kPerk = PlayerPerks.GetAt(iIndex) as Perk
if ! PlayerREF.HasPerk(kPerk)
PlayerREF.AddPerk(kPerk)
endif
endwhile
EndFunction
;=====================================================================================
; ALL UPDATES
;=====================================================================================
@ -177,7 +208,7 @@ Function FailsafeMQ05PrologueAliases()
; failsafe for issue 1536, fills empty aliases
If MQ05PrologueFunctions == None
MQ05PrologueFunctions = Game.GetFormFromFile(0x00033A5B, "Skyrim.esm") as _00E_MQ05Prologue_Functions
MQ05PrologueFunctions = Game.GetForm(0x00033A5B) as _00E_MQ05Prologue_Functions
EndIf
MQ05PrologueFunctions.FillEmptyAliasesFailsafe()
@ -331,6 +362,9 @@ Function Maintenance()
If fPatchVersion < 2.10
Update_210()
EndIf
If fPatchVersion < 2.12
Update_212()
EndIf
fPatchVersion = CURRENT_PATCH_VERSION
endif
@ -338,22 +372,24 @@ Function Maintenance()
; every time a save gets loaded the healrate needs to be set to 0, otherwise it will go back again to default at 0.7
; this is called before active magic effects of potions or spells are applied to the player which could also alter the value
PlayerREF.SetActorValue("Healrate", 0)
; Workaround for broken physics on loading saves, made on a mount
If PlayerREF.IsOnMount()
PlayerREF.Dismount()
EndIf
EnableDisableKillmove()
ResetArmorWeightPerks()
AddPlayerPerks()
SetAutoSaveInterval()
FailsafeMQ05PrologueAliases()
RefreshMountNamesOnLoad()
; Workaround for broken physics on loading saves, made on a mount
If PlayerREF.IsOnMount()
PlayerREF.Dismount()
EndIf
; fixes properties that were accidentally set to NONE by the "More Affinities" mod
If Game.GetModByName("Enderal_FS_More_Affinities.esp") != 255
FixMoreAffinitiesMod()
@ -372,6 +408,7 @@ _00E_MQ05Prologue_Functions Property MQ05PrologueFunctions Auto
Actor Property PlayerREF Auto
FormList Property QuestsToStart Auto
FormList Property PlayerPerks Auto
GlobalVariable Property KillMove Auto

@ -64,6 +64,8 @@ MagicEffect Property AlchFortifyTwoHanded Auto
MagicEffect Property AlchRestoreMagicka Auto
MagicEffect Property AlchRestoreStamina Auto
FormList Property _00E_EmptyFormlist Auto
Int Property GreyAlchemist2PotionDurationLimitInSeconds = 180 Autoreadonly Hidden
{The potion duration of all werewolf potions is limited to this amount if the player has the first and second perk grey alchemist}
Int Property GreyAlchemist1PotionDurationLimitInSeconds = 120 Autoreadonly Hidden
@ -98,10 +100,10 @@ EndProperty
bool bDoneDarkBlood = false
bool bDoneChymikum = false
int PotionsMixedOnLastTest = 0 ; OBSOLETE AFTER 1.5.3.0. Needed for version update
int criticalSectionProcesses = 0 ; OBSOLETE AFTER 1.5.3.0. Needed for version update
Int curScriptVersion = 0
Int Property LATEST_SCRIPT_VERSION = 4 AutoReadOnly
FormList Property _00E_EmptyFormlist Auto
bool bHasJContainers = false
;=====================================================================================
@ -116,7 +118,10 @@ Function _UpdatePotion(Potion item, Int count)
Bool bIsTheriantrophistPotion = item.HasKeyword(_00E_Theriantrophist_Effect)
MagicEffect firstTheriantrophistEffect = None
If bIsTheriantrophistPotion ; FRESHLY BREWN THERIANTROPHIST POTION
If bIsTheriantrophistPotion && EnderalLib.IsDLLLoaded() ; FRESHLY BREWN THERIANTROPHIST POTION
Debug.Notification("Replacing theriantrophist potion")
PlayerREF.removeItem(item, count, abSilent = true)
Bool bRemoveTheriantrophistEffects = False
@ -190,26 +195,37 @@ Function _UpdatePotion(Potion item, Int count)
EndIf
Potion newPotion = EnderalLib.CreatePotion(newEffects, newMagnitudes, newAreas, newDurations, nNewEffects)
If JFormMap.hasKey(RenamedPotions, newPotion) == False
If bHasJContainers && JFormMap.hasKey(RenamedPotions, newPotion) == False
_RenamePotion(newPotion, newEffects, nNewEffects, bRemoveTheriantrophistEffects)
_SetPotionModel(newPotion, firstTheriantrophistEffect, newEffects[0])
EndIf
GoToState("") ; skip OnItemAdded
PlayerREF.addItem(newPotion, count, abSilent = true)
GoToState("InCrafting")
If bRemoveTheriantrophistEffects == False
_UpdateNQ11(newPotion)
EndIf
Else ; COMMON POTION
return
EndIf
if bHasJContainers && JFormMap.hasKey(RenamedPotions, item) == False ; COMMON POTION
_RenamePotion(item, potionEffects, nPotionEffects, True)
_SetPotionModel(item, None, potionEffects[0])
EndIf
if bIsTheriantrophistPotion
_UpdateNQ11(item)
endif
EndFunction
Function _RenamePotion(Potion p, MagicEffect[] potionEffects, Int nPotionEffects, Bool bCommonPotion)
Debug.Notification("Renaming potion")
String name = ""
If bCommonPotion
@ -349,21 +365,93 @@ EndFunction
Function _UpdateInventoryFilters()
RemoveAllInventoryEventFilters()
AddInventoryEventFilter(_00E_EmptyFormlist)
Form[] aPotions = JFormMap.allKeysPArray(RenamedPotions)
int i = aPotions.length
while i > 0
i -= 1
AddInventoryEventFilter(aPotions[i])
Int potionNames = RenamedPotions
Form k = JFormMap.nextKey(potionNames, previousKey = None, endKey = None)
while k != None
AddInventoryEventFilter(k)
k = JFormMap.nextKey(potionNames, k, endKey = None)
endwhile
aPotions = JFormMap.allKeysPArray(ModelChangedPotions)
i = aPotions.length
while i > 0
i -= 1
AddInventoryEventFilter(aPotions[i])
EndFunction
Function _RestorePotionAttributes()
Debug.Notification("Restoring potion names")
Potion k
Int potionNames = RenamedPotions
k = JFormMap.nextKey(potionNames, previousKey = None, endKey = None) as Potion
while k != None
k.setName(JFormMap.getStr(potionNames, k))
k = JFormMap.nextKey(potionNames, k, endKey = None) as Potion
endwhile
Int potionModels = ModelChangedPotions
k = JFormMap.nextKey(potionModels, previousKey = None, endKey = None) as Potion
while k != None
k.SetWorldModelPath(JFormMap.getStr(potionModels, k))
k = JFormMap.nextKey(potionModels, k, endKey = None) as Potion
endwhile
EndFunction
Function _InitAchemyControl()
;Debug.Notification("AchemyControl init")
GoToState("")
int iSKSEVer = SKSE.GetVersion()
if iSKSEVer < 2
RemoveAllInventoryEventFilters()
bHasJContainers = false
;Debug.Notification("SKSE is not loaded")
Debug.Trace("SKSE is not loaded, _00E_Theriantrophist_AlchemyControl is disabled")
return
endif
bHasJContainers = ( (SKSE.GetPluginVersion("JContainers64") != -1) || (SKSE.GetPluginVersion("JContainersVR") != -1) )
if ! bHasJContainers && ! EnderalLib.IsDLLLoaded()
; Both required components are missing, do not update version and disable everything
RemoveAllInventoryEventFilters()
UnregisterForAllMenus()
Debug.Trace("JContainers and fs.dll are not loaded, _00E_Theriantrophist_AlchemyControl is disabled.")
;Debug.Notification("JContainers and fs.dll are not loaded")
return
endif
; Version update
If curScriptVersion < LATEST_SCRIPT_VERSION
Int oldScriptVersion = curScriptVersion
curScriptVersion = LATEST_SCRIPT_VERSION
If oldScriptVersion < 4
;Debug.Notification("Updating AlchemyControl")
UnregisterForUpdate()
EndIf
EndIf
; Re-initialize everything to stay resilient to co-save deletion or corruption
if bHasJContainers
RegisterForMenu("ContainerMenu")
RegisterForMenu("InventoryMenu")
RegisterForMenu("FavoritesMenu")
;Debug.Trace("JContainers is loaded, hooking to menus")
else
RemoveAllInventoryEventFilters()
UnregisterForAllMenus()
Debug.Notification("JContainers is not loaded")
Debug.Trace("JContainers is not loaded, renaming and changing potion models is disabled")
endif
RegisterForMenu("Crafting Menu")
EndFunction
@ -378,7 +466,10 @@ Event OnMenuOpen(String MenuName)
return
endif
GoToState("InInventory")
if bHasJContainers
Debug.Notification("InInventory")
GoToState("InInventory")
endif
EndEvent
@ -390,15 +481,18 @@ EndEvent
State InCrafting
Event OnBeginState()
;Debug.Notification("RemoveAllInventoryEventFilters")
RemoveAllInventoryEventFilters()
EndEvent
Event OnItemAdded(Form baseItem, int count, ObjectReference itemRef, ObjectReference source)
Debug.Notification("Added " + baseItem.GetName())
Potion item = baseItem as Potion
If item
; Ignore not-custom potions (with FormID not starting with 0xFF) or already registered potions
If (Math.LogicalAnd(item.GetFormID(), 0xFF000000) == 0xFF000000) && JFormMap.hasKey(RenamedPotions, item) == False
If (Math.LogicalAnd(item.GetFormID(), 0xFF000000) == 0xFF000000) && (!bHasJContainers || JFormMap.hasKey(RenamedPotions, item) == False)
_UpdatePotion(item, count)
EndIf
EndIf
@ -406,7 +500,10 @@ State InCrafting
EndEvent
Event OnEndState()
_UpdateInventoryFilters()
if bHasJContainers && UI.IsMenuOpen("Crafting Menu") == false
Debug.Notification("_UpdateInventoryFilters")
_UpdateInventoryFilters()
endif
EndEvent
EndState
@ -415,6 +512,7 @@ State InInventory
if dest != None
return
endif
Debug.Notification("Removed " + baseItem.GetName())
; Probably a potion is consumed
Potion item = baseItem as Potion
if item
@ -430,49 +528,16 @@ State InInventory
EndEvent
EndState
Int curScriptVersion = 0
Int Property LATEST_SCRIPT_VERSION = 4 AutoReadOnly
Event OnInit()
curScriptVersion = LATEST_SCRIPT_VERSION
RegisterForMenu("ContainerMenu")
RegisterForMenu("InventoryMenu")
RegisterForMenu("FavoritesMenu")
RegisterForMenu("Crafting Menu")
_InitAchemyControl()
EndEvent
Event OnPlayerLoadGame()
GoToState("")
; Version update
If curScriptVersion < LATEST_SCRIPT_VERSION
Int oldScriptVersion = curScriptVersion
curScriptVersion = LATEST_SCRIPT_VERSION
_InitAchemyControl()
If oldScriptVersion < 4
UnregisterForUpdate()
RegisterForMenu("ContainerMenu")
RegisterForMenu("InventoryMenu")
RegisterForMenu("FavoritesMenu")
RegisterForMenu("Crafting Menu")
_UpdateInventoryFilters()
EndIf
EndIf
; Restore names and models
Potion k
Int potionNames = RenamedPotions
k = JFormMap.nextKey(potionNames, previousKey = None, endKey = None) as Potion
while k != None
k.setName(JFormMap.getStr(potionNames, k))
k = JFormMap.nextKey(potionNames, k, endKey = None) as Potion
endwhile
Int potionModels = ModelChangedPotions
k = JFormMap.nextKey(potionModels, previousKey = None, endKey = None) as Potion
while k != None
k.SetWorldModelPath(JFormMap.getStr(potionModels, k))
k = JFormMap.nextKey(potionModels, k, endKey = None) as Potion
endwhile
if bHasJContainers
_RestorePotionAttributes()
_UpdateInventoryFilters()
endif
EndEvent

@ -6,25 +6,15 @@ Race Property _00E_Theriantrophist_PlayerWerewolfRace Auto
Bool bActivationBlocked = False
Event OnInit()
BlockActivation(True)
EndEvent
; This script is obsolete since 2.0.12 and has been replaced with a perk.
; Do not add it to new references.
Event OnActivate(ObjectReference akActionRef)
If akActionRef == PlayerREF
If _00E_PlayerhousingMaster.ReferenceCanBeActivated(Self) && bActivationBlocked == False
bActivationBlocked = True
If PlayerREF.GetRace() == _00E_Theriantrophist_PlayerWerewolfRace
_00E_Theriantrophist_CantCraftMSG.Show()
Else
Activate(akActionRef, true)
EndIf
bActivationBlocked = False
EndIf
Else
Activate(akActionRef, true)
EndIf
; Unlock activators, blocked by previous version of the script
if IsActivationBlocked()
BlockActivation(False)
if Game.GetPlayer().GetRace() != _00E_Theriantrophist_PlayerWerewolfRace
Activate(akActionRef, true)
endif
endif
EndEvent

@ -1,67 +1,22 @@
Scriptname _00E_Theriantrophist_SummonLabSC extends activemagiceffect
ObjectReference Property _00E_Theriantrophist_SummonPortableLaboratory_Target Auto
Event OnEffectStart(Actor akTarget, Actor akCaster)
if PlayerREF.GetRace() == _00E_Theriantrophist_PlayerWerewolfRace
_00E_Theriantrophist_CantCraftMSG.Show()
else
CheckforQuestPotions()
(FS_NQ05 as _00E_FS_NQ05_Functions).AskCreatePotion()
(FS_NQ07 as _00E_FS_NQ07_Functions).AskCreatePotion()
Utility.Wait(1.0)
_00E_Theriantrophist_SummonPortableLaboratory_Target.activate(PlayerREF, true)
endif
EndEvent
Function CheckforQuestPotions()
If (FS_NQ05.GetStage() < 40 && FS_NQ05.GetStage() >= 30)
int iButton1 = FS_NQ05_AlchemyMessagebox.Show()
if iButton1 == 0
PlayerREF.RemoveItem(Vynroot, 1)
PlayerREF.RemoveItem(SkeeverTail, 1)
PlayerREF.RemoveItem(MothWingMonarch, 1)
PlayerREF.RemoveItem(Garlic, 1)
PlayerREF.RemoveItem(_00E_FS_NQ05_Rezept, 1)
FS_NQ05.SetStage(40)
ElseIf iButton1 == 1
;
EndIf
Endif
If (FS_NQ07.GetStage() == 115)
int iButton2 = _00E_FS_NQ07_AlchemyMessagebox.Show()
if iButton2 == 0
PlayerREF.RemoveItem(FoodMead, 1)
PlayerREF.RemoveItem(FrostMirriam, 2)
PlayerREF.RemoveItem(FoodBananenschnaps, 1)
PlayerREF.RemoveItem(_00E_FS_NQ07_Rezept, 1)
FS_NQ07.SetStage(120)
ElseIf iButton2 == 1
;
EndIf
EndIf
EndFunction
ObjectReference Property _00E_Theriantrophist_SummonPortableLaboratory_Target Auto
Actor Property PlayerREF Auto
Message Property _00E_Theriantrophist_CantCraftMSG Auto
Race Property _00E_Theriantrophist_PlayerWerewolfRace Auto
Quest Property FS_NQ05 Auto
Book Property _00E_FS_NQ05_Rezept Auto
Ingredient Property Vynroot Auto
Ingredient Property SkeeverTail Auto
Ingredient Property MothWingMonarch Auto
Ingredient Property Garlic Auto
Message Property FS_NQ05_AlchemyMessagebox Auto
Quest Property FS_NQ07 Auto
Book Property _00E_FS_NQ07_Rezept Auto
Potion Property FoodMead Auto
Ingredient Property FrostMirriam Auto
Potion Property FoodBananenschnaps Auto
Message Property _00E_FS_NQ07_AlchemyMessagebox Auto

@ -26,12 +26,16 @@ Event OnEffectStart(Actor akTarget, Actor akCaster)
Endif
_00E_Theriantrophist_PlayerAsWerewolf playerWhileTransformedAlias = controlQuest.playerWhileTransformed
if _00E_FS_Theriantrophist_AllowTemporaryTransform.GetValueInt() == 0
if !playerWhileTransformedAlias.CanBeTransformed(akTarget.getCurrentLocation())
Debug.Notification(_00E_Theriantrophist_ForceTransformBackMessage.getName())
_RestorePotion()
if EnderalLib.IsDLLLoaded()
Debug.Notification(_00E_Theriantrophist_ForceTransformBackMessage.getName())
_RestorePotion()
else
; TODO: Replace the string with a localizable message.
Debug.Notification("You cannot transform here.")
endif
self.dispel()
return
Endif

@ -2,4 +2,8 @@ Scriptname EnderalLib Hidden
float function calculateContentStrength(ObjectReference container) native global
Potion Function CreatePotion(MagicEffect[] effects, float[] magnitudes, int[] areas, int[] durations, int arraySize) native global
Potion function CreatePotion(MagicEffect[] effects, float[] magnitudes, int[] areas, int[] durations, int arraySize) native global
bool function IsDLLLoaded() global
return (SKSE.GetPluginVersion("fs_skse_functions") != -1)
endfunction

@ -12,22 +12,4 @@ Message Property FS_NQ05_AlchemyMessagebox Auto
Bool bActivationBlocked = False
Event OnActivate(ObjectReference akActionRef)
If akActionRef == PlayerREF && _00E_PlayerhousingMaster.ReferenceCanBeActivated(Self) && bActivationBlocked == False
bActivationBlocked = True
Int qStage = FS_NQ05.GetStage()
If qStage >= 30 && qStage < 40
If FS_NQ05_AlchemyMessagebox.Show() == 0
FS_NQ05.SetStage(40)
PlayerREF.RemoveItem(Nirnroot, 1)
PlayerREF.RemoveItem(SkeeverTail, 1)
PlayerREF.RemoveItem(MothWingMonarch, 1)
PlayerREF.RemoveItem(Garlic, 1)
PlayerREF.RemoveItem(FS_NQ05_Rezept, 1)
EndIf
EndIf
bActivationBlocked = False
EndIf
EndEvent
; This script is obsolete as of 2.0.12, replaced with a perk

@ -11,21 +11,4 @@ Message Property _00E_FS_NQ07_AlchemyMessagebox Auto
Bool bActivationBlocked = False
Event OnActivate(ObjectReference akActionRef)
If akActionRef == PlayerREF && _00E_PlayerhousingMaster.ReferenceCanBeActivated(Self) && bActivationBlocked == False
bActivationBlocked = True
If FS_NQ07.GetStage() == 115
If _00E_FS_NQ07_AlchemyMessagebox.Show() == 0
PlayerREF.RemoveItem(FoodMead, 1)
PlayerREF.RemoveItem(FrostMirriam, 2)
PlayerREF.RemoveItem(FoodBananenschnaps, 1)
PlayerREF.RemoveItem(_00E_FS_NQ07_Rezept, 1)
FS_NQ07.SetStage(120)
EndIf
EndIf
bActivationBlocked = False
EndIf
EndEvent
; This script is obsolete as of 2.0.12, replaced with a perk

@ -0,0 +1,15 @@
;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 6
Scriptname PRKF__00E_FS_WerewolfPrevent_0300146D Extends Perk Hidden
;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akTargetRef, Actor akActor)
;BEGIN CODE
_00E_Theriantrophist_CantCraftMSG.Show()
;END CODE
EndFunction
;END FRAGMENT
;END FRAGMENT CODE - Do not edit anything between this and the begin comment
Message Property _00E_Theriantrophist_CantCraftMSG Auto

@ -69,6 +69,7 @@ SetObjectiveCompleted(37)
SetObjectiveCompleted(38)
SetObjectiveCompleted(39)
SetObjectiveDisplayed(40)
Game.GetPlayer().RemovePerk(_00E_FS_NQ05_CraftPotionPerk)
kmyQuest.MoveMirellStandby()
;END CODE
EndFunction
@ -331,6 +332,7 @@ Function Fragment_12()
;BEGIN CODE
SetObjectivecompleted(20)
SetObjectiveDisplayed(30)
Game.GetPlayer().AddPerk(_00E_FS_NQ05_CraftPotionPerk)
;END CODE
EndFunction
;END FRAGMENT
@ -369,3 +371,4 @@ EndFunction
;END FRAGMENT CODE - Do not edit anything between this and the begin comment
GlobalVariable Property _00E_AchievementsEnabled Auto
Perk Property _00E_FS_NQ05_CraftPotionPerk Auto

@ -97,6 +97,7 @@ _00E_FS_NQ07_Functions kmyQuest = __temp as _00E_FS_NQ07_Functions
SetObjectiveDisplayed(35)
SetObjectiveCompleted(20)
kmyQuest.GivePlayerCraftingPlan()
Game.GetPlayer().AddPerk(_00E_FS_NQ07_CraftPotionPerk)
;END CODE
EndFunction
;END FRAGMENT
@ -470,6 +471,7 @@ Quest __temp = self as Quest
_00E_FS_NQ07_Functions kmyQuest = __temp as _00E_FS_NQ07_Functions
;END AUTOCAST
;BEGIN CODE
Game.GetPlayer().RemovePerk(_00E_FS_NQ07_CraftPotionPerk)
kmyQuest.CleanAuroraHome()
SetObjectiveCompleted(30)
SetObjectiveDisplayed(40)
@ -605,3 +607,5 @@ EndFunction
;END FRAGMENT
;END FRAGMENT CODE - Do not edit anything between this and the begin comment
Perk Property _00E_FS_NQ07_CraftPotionPerk Auto

Loading…
Cancel
Save