===================================================================================================
Knockdown and Kill Cam Immunity
AUTHOR: Lord Zapharos (www.lordzapharos.com)
DATE: 26 August 2026
===================================================================================================


LICENSE AND CREDITS:
===================================================================================================
Creative Commons Attribution 4.0 International (https://creativecommons.org/licenses/by/4.0/)

You are free to share and transform this work (commercially or otherwise) provided you give proper
credit to Lord Zapharos, provide a link to this license, and indicate if changes were made.


DESCRIPTION:
===================================================================================================

Makes the main player entirely invulnerable while knocked down and during kill-cams. Each feature
can be toggled separately.

Skyrim's vanilla knockdown mechanics are horrible. Even on a shallow slope, being knocked down is
often deadly due to low friction and the naive way fall damage is calculated. If you fall down in
water, you may float for minutes until your player gets up (swimming, apparently, is a lost art).
Getting up after any knockdown is a slow and cumbersome animation no matter where it occurs. During
all of this, you are 100% vulnerable to enemy attacks.

Although vanilla Skyrim allows kill cams only at the very end of a fight, many mods increase the
frequency of these cinematics. Unfortunately, you are also 100% vulnerable during kill animations,
which means your epic kill streak often ends in a not-so-epic death.

This mod fixes both issues by making the main player invulnerable (via setghost) during knockdown
and kill cam animations. The player remains invulnerable for a short window afterwards, which can
be customized to your preference as explained below. Regular fall damage applies when not knocked
down (but if you ragdoll off a cliff, you WILL survive the fall).

Immunity extends to all vanilla transformation races (werewolves, werebears, and vampire lords).
Mod-added races are supported if their behavior graphs include the following events:

 - for kill cam immunity: KillMoveStart/KillMoveEnd
 - for ragdoll immunity: RemoveCharacterControllerFromWorld/GetUpEnd

Mods that add new playable humanoid races are usually supported.


REQUIREMENTS:
===================================================================================================

Skyrim Legendary Edition


INSTALLATION:
===================================================================================================

1. Copy the "Data" folder from this directory to your main Skyrim directory (this is usually found
   in "C:\Program Files (x86)\Steam\steamapps\Skyrim").
2. (Optional, for console use) Copy lzkiReset.txt and lzkiStop.txt to your Skyrim folder as well.
3. Activate "InigoAvoidAllCombat.esp" with your mod manager of choice.


UNINSTALLATION:
===================================================================================================

To uninstall, you must make a clean save. To do this:

1. Load the most recent save file for your character.
2. Open the console via ~.
3. If you followed step 2 during installation, type the following and press enter:

    bat lzkiStop

   Otherwise, type each of the following commands and press enter after each one:

    stopquest lzki_qust_ragdoll
    stopquest lzki_qust_killcam

4. Repeat steps 1-3 for all affected characters.
5. Deactivate the ESP and remove all added files.


SKYRIM SPECIAL EDITION USERS:
===================================================================================================

This mod was designed in Skyrim Legendary Edition and WILL NOT WORK with Skyrim Special Edition. If
you decide to convert this mod to work in Skyrim Special Edition, I would be happy to bundle your
converted version with this mod and give you due credit -- just send me your conversion.


HELP - IMMUNITY STOPPED WORKING!
===================================================================================================

In rare cases, RegisterForAnimationEvent instances get invalidated even though the player's race
has not actually changed; immunity stops working as a result. To fix this, do any of the following:

 - In the console, type "bat lzkiReset" (without quotes).
 - Open the race menu in the console ("showracemenu") or by visiting the face sculptor. You do not
   need to make any changes; just open the menu and then accept/close it.
 - Transform into a werewolf or vampire lord.
 - Revert from werewolf or vampire lord to your normal form.
 - Become a vampire.
 - Cure your vampirism.


HELP - MY CHARACTER IS PERMANENTLY INVINCIBLE!
===================================================================================================

This is an extremely rare bug. You can fix it by doing any of the following:

 - In the console, type "player.setghost 0" (without quotes).
 - In the console, type "bat lzkiReset" (without quotes).
 - Open the race menu in the console ("showracemenu") or by visiting the face sculptor. You do not
   need to make any changes; just open the menu and then accept/close it.


USAGE:
===================================================================================================

The following global variables control the behavior of this mod (you can query them in the console
via "help [name of variable without brackets]"):

+--------------------------------+---------+------------------------------------------------------+
|                                | Default | Explanation                                          |
+--------------------------------+---------+------------------------------------------------------+
| LZKI_glob_enableKillCam        | 1       | Sets whether kill cam immunity is enabled. Immunity  |
|                                |         | is disabled via 0 and enabled via 1. Changes to this |
|                                |         | value take effect only in the following conditions:  |
|                                |         |                                                      |
|                                |         |  - Typing "bat lzkiReset" (without quotes) in the    |
|                                |         |    console.                                          |
|                                |         |                                                      |
|                                |         |  - Typing "showracemenu" in the console (you do NOT  |
|                                |         |    need to change anything in this menu - just open  |
|                                |         |    the race menu and then accept/close it).          |
|                                |         |                                                      |
|                                |         |  - Opening the race menu by visiting the face        |
|                                |         |    sculptor (again, no face changes are needed).     |
|                                |         |                                                      |
|                                |         |  - Transforming into a werewolf / vampire lord.      |
|                                |         |                                                      |
|                                |         |  - Reverting from werewolf / vampire lord to your    |
|                                |         |    normal form.                                      |
|                                |         |                                                      |
|                                |         |  - Becoming a vampire.                               |
|                                |         |                                                      |
|                                |         |  - Curing your vampirism.                            |
+--------------------------------+---------+------------------------------------------------------+
| LZKI_glob_enableRagdoll        | 1       | Sets whether knockdown immunity is enabled. Refer to |
|                                |         | the above notes about when this value takes effect.  |
+--------------------------------+---------+------------------------------------------------------+
| LZKI_glob_ragdollDelayBefore   | 0.5     | The amount of time after you are knocked down before |
|                                |         | immunity is applied (in seconds). A nonzero delay is |
|                                |         | always needed to ensure that knockdown spells apply  |
|                                |         | their other non-knockdown effects, if any.           |
+--------------------------------+---------+------------------------------------------------------+
| LZKI_glob_ragdollDelayAfter    | 1.0     | The amount of time after you begin to get up before  |
|                                |         | immunity expires (in seconds). Note that both camera |
|                                |         | and player controls "lag" behind the animation, and  |
|                                |         | this value must include that delay to give players a |
|                                |         | chance to evade or block any subsequent attack.      |
|                                |         |                                                      |
|                                |         | Do not make this window too large! If the player is  |
|                                |         | knocked down again within this immunity window, they |
|                                |         | will NOT receive immunity for the second knockdown.  |
+--------------------------------+---------+------------------------------------------------------+
| LZKI_glob_killCamDelayAfter    | 3.0     | The amount of time after a kill cam animation ends   |
|                                |         | before immunity expires (in seconds). The same notes |
|                                |         | for LZKI_glob_ragdollDelayAfter apply here.          |
|                                |         |                                                      |
|                                |         | This value is larger than knockdowns due to a wider  |
|                                |         | variance in camera timings post kill cam.            |
+--------------------------------+---------+------------------------------------------------------+
| LZKI_glob_registerTriesTimeout | 60      | The number of attempts that should be made to hook   |
|                                |         | animation events for both immunities (in seconds).   |
|                                |         | If an animation cannot be hooked after this time, no |
|                                |         | immunity of that type will be applied at all.        |
|                                |         |                                                      |
|                                |         | It is strongly recommended NOT to change this!       |
+--------------------------------+---------+------------------------------------------------------+
