diff --git a/Armor set listener.esp b/Armor set listener.esp new file mode 100644 index 00000000..d7795741 Binary files /dev/null and b/Armor set listener.esp differ diff --git a/Skyrim.esm b/Skyrim.esm index d57e6263..452a1ec1 100644 Binary files a/Skyrim.esm and b/Skyrim.esm differ diff --git a/scripts/_00E_ArmorSetListener.pex b/scripts/_00E_ArmorSetListener.pex new file mode 100644 index 00000000..28e3cefa Binary files /dev/null and b/scripts/_00E_ArmorSetListener.pex differ diff --git a/scripts/_00e_armorsetscript.pex b/scripts/_00e_armorsetscript.pex index 984e32c3..978723bb 100644 Binary files a/scripts/_00e_armorsetscript.pex and b/scripts/_00e_armorsetscript.pex differ diff --git a/source/scripts/_00E_ArmorSetListener.psc b/source/scripts/_00E_ArmorSetListener.psc new file mode 100644 index 00000000..fe556693 --- /dev/null +++ b/source/scripts/_00E_ArmorSetListener.psc @@ -0,0 +1,22 @@ +Scriptname _00E_ArmorSetListener extends Quest Hidden + +Function OnArmorSetBonusAdded(Bool bFullSet) + Sound.SetInstanceVolume(MAGIllusionCharm.Play(PlayerREF), 0.4) ; Play MAGIllusionCharm at lower volume + + If bFullSet && ! bSetAchievementUnlocked + Steam.UnlockAchievement("END_SET_01") + bSetAchievementUnlocked = True + EndIf +EndFunction + +Function OnArmorSetBonusRemoved() + _00E_ArmorSetScript_sSetBonusRemoved.Show() +EndFunction + +bool bSetAchievementUnlocked = false + +Sound Property MAGIllusionCharm Auto + +Actor Property PlayerRef Auto + +Message Property _00E_ArmorSetScript_sSetBonusRemoved Auto diff --git a/source/scripts/_00e_armorsetscript.psc b/source/scripts/_00e_armorsetscript.psc index 95d6d53a..5945b28d 100644 --- a/source/scripts/_00e_armorsetscript.psc +++ b/source/scripts/_00e_armorsetscript.psc @@ -7,7 +7,7 @@ Scriptname _00E_ArmorSetScript extends ObjectReference Event OnEquipped(Actor akActor) If akActor == PlayerREF - ;this event won't be sent by SKSE / SkyUI when using he Equip Mode of SkyUI to directly equip an item from another container. + ;this event won't be sent by SKSE / SkyUI when using the Equip Mode of SkyUI to directly equip an item from another container. ;the same goes for the OnObjectEquipped event, hence we need the work around in OnContainerChanged UpdateSpells() EndIf @@ -43,15 +43,9 @@ EndEvent Function UpdateSpells() - Int iIndex - - If Levelsystem == None - Levelsystem = Game.GetFormFromFile(0x00010AA2, "Skyrim.esm") As _00E_Questfunctions - EndIf - + Int iIndex = 0 Int nEquippedPieces = 0 Form[] setPieces = __Config_SetList.ToArray() - iIndex = 0 While iIndex < setPieces.Length If PlayerREF.IsEquipped(setPieces[iIndex] as Armor) nEquippedPieces += 1 @@ -86,9 +80,9 @@ Function UpdateSpells() EndWhile If bSpellAdded - Levelsystem.OnArmorSetBonusAdded(nEquippedPieces >= setPieces.Length) + ArmorSetListener.OnArmorSetBonusAdded(nEquippedPieces >= setPieces.Length) ElseIf bSpellRemoved - Levelsystem.OnArmorSetBonusRemoved() + ArmorSetListener.OnArmorSetBonusRemoved() EndIf EndFunction @@ -101,7 +95,7 @@ EndFunction Bool Property __Config_5Pieces Auto {Does this set have five pieces? Default: False} -_00E_Questfunctions Property Levelsystem Auto +_00E_ArmorSetListener Property ArmorSetListener Auto GlobalVariable Property __Config_SetGlobal Auto {The global associated with this set. Example _25E_HSet_FallenOneGlobal.}