
About this mod
Gives and equips eyeglasses in Pre & Post War Sanctuary
- Permissions and credits
- Changelogs
This mod works well with the following mods:
There is an ESP and ESL available but you can make an ESL easily from an ESP
Creation of the mod:
- Part 1 - https://youtu.be/w4iYXGkj174
- Part 2 - https://youtu.be/QDJwlP3txH0
- Part 3 - https://youtu.be/mIDj0Z88FEk
- Part 4 - https://youtu.be/lH9s8_IQJjs
Here is the entirety of the script:
Scriptname EyeglassesAtStart:EYE_MainQuest extends Quest
Group GameAsset
Actor Property PlayerRef Auto Const
{the player}
Quest Property MQ101 Auto Const
{this is the pre-war game quest}
Quest Property MQ102 Auto Const
{this is the post-war game quest}
Armor Property ClothesEyeGlasses Auto Const
{the base game eyeglasses}
EndGroup
Event OnQuestInit()
If MQ101.GetCurrentStageID() >= 10
GiveAndEquipForm(PlayerRef, ClothesEyeGlasses)
RegisterForRemoteEvent(PlayerRef, "OnItemUnequipped")
EndIf
RegisterForRemoteEvent(MQ101, "OnStageSet")
RegisterForRemoteEvent(MQ102, "OnStageSet")
EndEvent
Event Quest.OnStageSet(Quest akSender, int auiStageID, int auiItemID)
If akSender == MQ101
If auiStageID >= 10
GiveAndEquipForm(PlayerRef, ClothesEyeGlasses)
RegisterForRemoteEvent(PlayerRef, "OnItemUnequipped")
EndIf
ElseIf akSender == MQ102
If auiStageID >= 1
GiveAndEquipForm(PlayerRef, ClothesEyeGlasses)
UnregisterAndStop()
EndIf
EndIf
EndEvent
Event Actor.OnItemUnequipped(Actor akSender, Form akBaseObject, ObjectReference akReference)
If MQ102.GetStage() >= 1
UnregisterAndStop()
EndIf
If akSender == PlayerRef && akBaseObject == ClothesEyeGlasses
GiveAndEquipForm(PlayerRef, ClothesEyeGlasses)
EndIf
EndEvent
Function UnregisterAndStop()
UnregisterForRemoteEvent(MQ101, "OnStageSet")
UnregisterForRemoteEvent(MQ102, "OnStageSet")
UnregisterForRemoteEvent(PlayerRef, "OnItemUnequipped")
Stop()
EndFunction
Function GiveAndEquipForm(Actor a, Form f)
If a.GetItemCount(f) == 0
a.AddItem(f)
EndIf
If a.IsEquipped(f) == false
a.EquipItem(f)
EndIf
EndFunction
Enjoy!