Merge branch 'crafting-refactoring' into development
This commit is contained in:
commit
8210468f79
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.
BIN
Skyrim.esm
BIN
Skyrim.esm
Binary file not shown.
Binary file not shown.
BIN
scripts/PRKF__00E_CraftQuestPotionPe_0300146D.pex
Normal file
BIN
scripts/PRKF__00E_CraftQuestPotionPe_0300146D.pex
Normal file
Binary file not shown.
BIN
scripts/PRKF__00E_FS_NQ07_CraftPotio_0300146E.pex
Normal file
BIN
scripts/PRKF__00E_FS_NQ07_CraftPotio_0300146E.pex
Normal file
Binary file not shown.
BIN
scripts/PRKF__00E_SE_2_0_12_UpgradeP_030090B3.pex
Normal file
BIN
scripts/PRKF__00E_SE_2_0_12_UpgradeP_030090B3.pex
Normal file
Binary file not shown.
BIN
scripts/PRKF__00E_SE_DismantlePerk_03009D21.pex
Normal file
BIN
scripts/PRKF__00E_SE_DismantlePerk_03009D21.pex
Normal file
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
scripts/prkf__00e_fs_werewolfprevent_0300146d.pex
Normal file
BIN
scripts/prkf__00e_fs_werewolfprevent_0300146d.pex
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
19
source/scripts/PRKF__00E_CraftQuestPotionPe_0300146D.psc
Normal file
19
source/scripts/PRKF__00E_CraftQuestPotionPe_0300146D.psc
Normal file
@ -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
|
19
source/scripts/PRKF__00E_FS_NQ07_CraftPotio_0300146E.psc
Normal file
19
source/scripts/PRKF__00E_FS_NQ07_CraftPotio_0300146E.psc
Normal file
@ -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
|
16
source/scripts/PRKF__00E_SE_2_0_12_UpgradeP_030090B3.psc
Normal file
16
source/scripts/PRKF__00E_SE_2_0_12_UpgradeP_030090B3.psc
Normal file
@ -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
|
26
source/scripts/PRKF__00E_SE_DismantlePerk_03009D21.psc
Normal file
26
source/scripts/PRKF__00E_SE_DismantlePerk_03009D21.psc
Normal file
@ -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)
|
||||
|
||||
EnableDisableKillmove()
|
||||
|
||||
ResetArmorWeightPerks()
|
||||
|
||||
SetAutoSaveInterval()
|
||||
|
||||
FailsafeMQ05PrologueAliases()
|
||||
|
||||
RefreshMountNamesOnLoad()
|
||||
|
||||
; Workaround for broken physics on loading saves, made on a mount
|
||||
If PlayerREF.IsOnMount()
|
||||
PlayerREF.Dismount()
|
||||
EndIf
|
||||
|
||||
EnableDisableKillmove()
|
||||
|
||||
ResetArmorWeightPerks()
|
||||
|
||||
AddPlayerPerks()
|
||||
|
||||
SetAutoSaveInterval()
|
||||
|
||||
FailsafeMQ05PrologueAliases()
|
||||
|
||||
RefreshMountNamesOnLoad()
|
||||
|
||||
; 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
|
||||
|
||||
_RenamePotion(item, potionEffects, nPotionEffects, True)
|
||||
_SetPotionModel(item, None, potionEffects[0])
|
||||
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,117 +365,22 @@ EndFunction
|
||||
|
||||
Function _UpdateInventoryFilters()
|
||||
|
||||
RemoveAllInventoryEventFilters()
|
||||
|
||||
AddInventoryEventFilter(_00E_EmptyFormlist)
|
||||
|
||||
Form[] aPotions = JFormMap.allKeysPArray(RenamedPotions)
|
||||
int i = aPotions.length
|
||||
while i > 0
|
||||
i -= 1
|
||||
AddInventoryEventFilter(aPotions[i])
|
||||
endwhile
|
||||
|
||||
aPotions = JFormMap.allKeysPArray(ModelChangedPotions)
|
||||
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
|
||||
|
||||
EndFunction
|
||||
|
||||
;=====================================================================================
|
||||
; EVENTS
|
||||
;=====================================================================================
|
||||
Function _RestorePotionAttributes()
|
||||
Debug.Notification("Restoring potion names")
|
||||
|
||||
Event OnMenuOpen(String MenuName)
|
||||
|
||||
If menuName == "Crafting Menu"
|
||||
GoToState("InCrafting")
|
||||
return
|
||||
endif
|
||||
|
||||
GoToState("InInventory")
|
||||
|
||||
EndEvent
|
||||
|
||||
Event OnMenuClose(String MenuName)
|
||||
|
||||
GoToState("")
|
||||
|
||||
EndEvent
|
||||
|
||||
State InCrafting
|
||||
Event OnBeginState()
|
||||
RemoveAllInventoryEventFilters()
|
||||
EndEvent
|
||||
|
||||
Event OnItemAdded(Form baseItem, int count, ObjectReference itemRef, ObjectReference source)
|
||||
|
||||
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
|
||||
_UpdatePotion(item, count)
|
||||
EndIf
|
||||
EndIf
|
||||
|
||||
EndEvent
|
||||
|
||||
Event OnEndState()
|
||||
_UpdateInventoryFilters()
|
||||
EndEvent
|
||||
EndState
|
||||
|
||||
State InInventory
|
||||
Event OnItemRemoved(Form baseItem, int count, ObjectReference itemRef, ObjectReference dest)
|
||||
if dest != None
|
||||
return
|
||||
endif
|
||||
; Probably a potion is consumed
|
||||
Potion item = baseItem as Potion
|
||||
if item
|
||||
; we want to prevent that all potions that have been brewed are collected in this list
|
||||
; and cause performance issues. So we risk that we loose track of them by removing them
|
||||
; from this list. In this case, the name will be the old vanilla skyrim one
|
||||
if (PlayerREF.getItemCount(item) == 0)
|
||||
JFormMap.removeKey(RenamedPotions, item)
|
||||
JFormMap.removeKey(ModelChangedPotions, item)
|
||||
RemoveInventoryEventFilter(baseItem)
|
||||
Endif
|
||||
Endif
|
||||
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")
|
||||
EndEvent
|
||||
|
||||
Event OnPlayerLoadGame()
|
||||
GoToState("")
|
||||
|
||||
; Version update
|
||||
If curScriptVersion < LATEST_SCRIPT_VERSION
|
||||
Int oldScriptVersion = curScriptVersion
|
||||
curScriptVersion = LATEST_SCRIPT_VERSION
|
||||
|
||||
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
|
||||
@ -475,4 +396,148 @@ Event OnPlayerLoadGame()
|
||||
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
|
||||
|
||||
;=====================================================================================
|
||||
; EVENTS
|
||||
;=====================================================================================
|
||||
|
||||
Event OnMenuOpen(String MenuName)
|
||||
|
||||
If menuName == "Crafting Menu"
|
||||
GoToState("InCrafting")
|
||||
return
|
||||
endif
|
||||
|
||||
if bHasJContainers
|
||||
Debug.Notification("InInventory")
|
||||
GoToState("InInventory")
|
||||
endif
|
||||
|
||||
EndEvent
|
||||
|
||||
Event OnMenuClose(String MenuName)
|
||||
|
||||
GoToState("")
|
||||
|
||||
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) && (!bHasJContainers || JFormMap.hasKey(RenamedPotions, item) == False)
|
||||
_UpdatePotion(item, count)
|
||||
EndIf
|
||||
EndIf
|
||||
|
||||
EndEvent
|
||||
|
||||
Event OnEndState()
|
||||
if bHasJContainers && UI.IsMenuOpen("Crafting Menu") == false
|
||||
Debug.Notification("_UpdateInventoryFilters")
|
||||
_UpdateInventoryFilters()
|
||||
endif
|
||||
EndEvent
|
||||
EndState
|
||||
|
||||
State InInventory
|
||||
Event OnItemRemoved(Form baseItem, int count, ObjectReference itemRef, ObjectReference dest)
|
||||
if dest != None
|
||||
return
|
||||
endif
|
||||
Debug.Notification("Removed " + baseItem.GetName())
|
||||
; Probably a potion is consumed
|
||||
Potion item = baseItem as Potion
|
||||
if item
|
||||
; we want to prevent that all potions that have been brewed are collected in this list
|
||||
; and cause performance issues. So we risk that we loose track of them by removing them
|
||||
; from this list. In this case, the name will be the old vanilla skyrim one
|
||||
if (PlayerREF.getItemCount(item) == 0)
|
||||
JFormMap.removeKey(RenamedPotions, item)
|
||||
JFormMap.removeKey(ModelChangedPotions, item)
|
||||
RemoveInventoryEventFilter(baseItem)
|
||||
Endif
|
||||
Endif
|
||||
EndEvent
|
||||
EndState
|
||||
|
||||
Event OnInit()
|
||||
curScriptVersion = LATEST_SCRIPT_VERSION
|
||||
_InitAchemyControl()
|
||||
EndEvent
|
||||
|
||||
Event OnPlayerLoadGame()
|
||||
_InitAchemyControl()
|
||||
|
||||
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
|
||||
|
15
source/scripts/prkf__00e_fs_werewolfprevent_0300146d.psc
Normal file
15
source/scripts/prkf__00e_fs_werewolfprevent_0300146d.psc
Normal file
@ -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…
Reference in New Issue
Block a user