Jump to content

Check if someone equipped a helmet - scripting


igotnousername

Recommended Posts

Basically I was trying to make a script that drops enemies helmet when they die.

I got it working but only for the player and pretty much restrictive.

 

With the way things now, I need to edit every single helmet and add the script with it.

 

I was hoping I can do it by just when the enemy is dying, it checks if enemy has a helmet, store that helmet as a variable, and then DropObject(Helmet).

Link to comment
Share on other sites

The Footprints of skyrim mod mechanically does something similar to what your after. I have not dissected this mod myself but I have observed it only affects the actors immediately near the player.

With that I bet you could have a script on the player that applies a spell/magiceffect to all the actors in the same cell as the player. You can then attach your drop helmet script to this magic effect. Thats the idea, obviously not considering maintenance.

Link to comment
Share on other sites

I see. I still need to edit every single helmet though. Because I have no idea how assign a variable automatically unless being stated in the properties.

 

I also notice that enemies drops their weapons when dying sometimes. Has anyone know how?

How does the disarm scripted as well?

Link to comment
Share on other sites

Editing every single helmet is a terrible idea :pinch:

 

I think something like this might work better, hopefully the script guru chimes in.

Armor Function GetActorHelmet(Actor akActor)
	If(akActor != none)
		int headSlotMask = 0x00000001
		Armor headSlotItem = akActor.GetWornForm(headSlotMask) as Armor

		If(headSlotItem != none && headSlotItem.IsHelmet())
			return headSlotItem
		EndIf
	EndIf
	return none
EndFunction


Function DropActorHelmet(Actor akActor)
	int headSlotMask = 0x00000001
	Form headSlotItem = akActor.GetWornForm(headSlotMask)

	If(headSlotItem != none && (headSlotItem as Armor).IsHelmet())
		akActor.UnequipItem(headSlotItem)
		akActor.DropObject(headSlotItem)
	EndIf
EndFunction
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...