Jump to content

ThrillaWhale

Recommended Posts

I have a scripting question - not to ask someone to teach me something specific, but only whether I would need scripts or not. I'd like to add a Magic Effect or even a change in physical model to an npc that activates only when that character goes into combat mode ("unsheathes" sword or spell). And when the character exits combat mode, this Magic Effect would deactivate.

 

Would this require the use of scripts or could it be done with the CK alone? Does anyone know if there's a Condition in the CK that relies on the state of entering combat mode?

Link to comment
Share on other sites

There is the condition IsInCombat but it does not indicate when the player or NPC draws weapons or magic.

 

If you need it to be more precise (i.e. something happening with every draw of weapon or magic) you'll need to use a script to cast the spell or do whatever under the correct conditions.

 

If doing it for the player (or any NPC), the script functions/events you will need are part of the SKSE 1.07.02 beta version. They will be found on the Form script. See spoiler

 

Function RegisterForActorAction(int actionType) native
Function UnregisterForActorAction(int actionType) native

; ActionTypes
; 0 - Weapon Swing (Melee weapons that are swung, also barehand)
; 1 - Spell Cast (Spells and staves)
; 2 - Spell Fire (Spells and staves)
; 3 - Voice Cast
; 4 - Voice Fire
; 5 - Bow Draw
; 6 - Bow Release
; 7 - Unsheathe Begin
; 8 - Unsheathe End
; 9 - Sheathe Begin
; 10 - Sheathe End
; Slots
; 0 - Left Hand
; 1 - Right Hand
; 2 - Voice
Event OnActorAction(int actionType, Actor akActor, Form source, int slot)
EndEvent 

 

 

 

Alternatively for an NPC, you can use the OnCombatStateChanged event. This event runs whenever an NPCs combat state changes (going out of combat, going into combat, searching for a target).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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