Fallout 4
0 of 0

File information

Last updated

Original upload

Created by

louisthird

Uploaded by

louisthird

Virus scan

Safe to use

About this mod

Power Attacks can make you unequip or drop your glasses.

Requirements
Permissions and credits
When the player is hit by a power attack, then there is a chance (default is 10%) that the eyes item slot (17 by default) used for glasses will be dropped or unequipped (configurable).  There are global variables to control the chance, slot, and whether it is unequipped or dropped.

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

The mod consists 3 Global Variables, 2 Messages, and a single Quest with a single script on the Player reference below:

Scriptname GlassesDrop:GlassesDropScript extends ReferenceAlias
{Chance to unequip or drop glasses item slot when actor ref is hit by bash power attack}

GlobalVariable Property GlassesDropChance Auto Const Mandatory
{Set chance from 0-100 in console: set GlassesDropChance to <value>}
GlobalVariable Property GlassesDropMode Auto Const Mandatory
{Set mode to 1=unequip or 2=drop in console: set GlassesDropMode to <value>}
GlobalVariable Property GlassesDropSlot Auto Const Mandatory
{Set slot from 0-43 in console: set GlassesDropSlot to <value>}
Message Property GlassesDropMessage1 Auto Const Mandatory
{The message printed when your glasses are unequipped}
Message Property GlassesDropMessage2 Auto Const Mandatory
{The message printed when your glasses are dropped}

Event OnAliasInit()
RegisterForHitEvent(GetActorRef(), None, None, None, 1, -1, -1, -1, true)
EndEvent

Event OnHit(ObjectReference akTarget, ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked, string apMaterial)
If Utility.RandomFloat(0.0, 100.0) <= GlassesDropChance.GetValue()
Int itemSlot = GlassesDropSlot.GetValue() as Int
Actor:WornItem wornItem = GetActorRef().GetWornItem(itemSlot)
If wornItem != None && wornItem.Item != None
If GlassesDropMode.GetValue() == 1.0
GetActorRef().UnequipItemSlot(itemSlot)
GlassesDropMessage1.Show()
ElseIf GlassesDropMode.GetValue() == 2.0
GetActorRef().DropObject(wornItem.Item)
GlassesDropMessage2.Show()
EndIf
EndIf
EndIf
RegisterForHitEvent(GetActorRef(), None, None, None, 1, -1, -1, -1, true)
EndEvent

See the {comments} in the script above that describe how to customize the Global Variables on the console if you want to change the following defaults:
  • GlassesDropChance: 10%
  • GlassesDropMode: 2 (drop)
  • GlassesDropSlot: 17 (eye item slot)

Good luck finding your glasses!