*****************************************************************

     The Elder Scrolls III
           MORROWIND: 
       Enhanced Stealth
	by J.O.G

*****************************************************************

Index:

1. Description
2. Compatibility
3. Installation
4. Documentation
5. Customisation
6. Known Issues
7. Version / Contact
8. Credits


*****************************************************************

     1. PLUGIN DESCRIPTION

*****************************************************************
VERSION:       1.2
PLUGIN TYPE:   Gameplay tweaks
REQUIRES:      Tribunal or Bloodmoon, Morrowind Enhanced v1.6

This plugin adds some new features to your sneak skill:


1. Lighting-based modifier:

You will be given a bonus or penalty to your sneaking ability 
depending on lighting in interiors and time/weather in exteriors


2. Armor-based penalty:

Wearing medium or heavy armor adds a penalty to your sneak skill.
(This optional feature can be turned off)


3. Sneak-Attack bonus:

When using certain weapons you will get an attack bonus after 
a short time of sneaking without attacking or being attacked.


4. Assassination:

A critical hit with short blades or using your fists, may kill
the opponent instantly when you're lucky or well-trained.


*****************************************************************

     2. COMPATIBILITY

*****************************************************************

This small Plugin is clean. It just adds one new global script 
five global variables and eight spells/curses.

The modifiers are applied as curses so there shouldn't be 
problems with alternative-leveleling mods.


Of course this mod shouldn't be run with other mods that add
lighting-based bonuses to your sneak skill.

When you prefer to use LDone's "Armor Effects" mod, or Halo's
MWE-Version, you can do that by disabling the armor effects
in my mod using the console: 

Set JOG_sneak_noarmor to 1


*****************************************************************

     3. INSTALLATION

*****************************************************************

Put "Enhanced_Stealth.esp" to your Morrowind/Datafiles folder and
activate it, and of course you need to install Morrowind Enhanced:

 ***************************************************************
 !!! YOU NEED MORROWIND ENHANCED (MWE) V1.6 TO RUN THIS MOD  !!!
 ***************************************************************

Get MWE here:
-------------
http://planetelderscrolls.gamespy.com/View.php?view=Utilities.Detail&id=8

http://aerelorn.1.forumer.com/index.php?showtopic=553


*****************************************************************

     4. Documentation

*****************************************************************

================================================================
 ****************************
* Light-Based Sneak-Modifier *
 ****************************

With this plug-in, weather and time of day now offer cumulative
sneak bonuses and penalties in exteriors. In interiors, 
the modifiers are determined by ambient lighting, and the player's
distance to light-sources.

The effects are added as magic effects (curses) when you start 
sneaking, and removed again when you stop sneaking.


Exterior Cells:
---------------
This part of the script script runs only once when you press the
sneak key, and again when you stop sneaking to remove the bonuses
to avoid any negative influence of the script on your frame rate.

The sneak skill is modified depending on weather and time of day:

Time/Lighting effects:

 06:00pm - 07:59pm: Sneak +5
 08:00pm - 09:59pm: Sneak +10
 10:00pm - 11:59pm: Sneak +15
 00:00am - 00:59am: Sneak +20
 01:00am - 02:59am: Sneak +15
 03:00am - 04:59am: Sneak +10
 05:00am - 06:59am: Sneak +5

 10:00am - 10:59am: Sneak -5
 11:00am - 11:59am: Sneak -10
 12:00am - 12:59am: Sneak -15
 01:00pm - 01:59pm: Sneak -10
 02:00pm - 02:59am: Sneak -5


Weather effects:
 
 Foggy: 	Sneak +10
 Rain: 		Sneak +10
 Snow: 		Sneak +10		
 Thunderstorm: 	Sneak +15
 Ashstorm:	Sneak +15
 Blizzard:	Sneak +15
 Blightstorm:	Sneak +20



Interior Cells:
---------------
In interior cells the bonus is calculated dynamically by 
the ambient lighting and the distance to light sources, 
and updated 5 times per second.

The value can range from about +25 (in utter darkness) to -50 
(next to a lightsource in a cell with bright ambient lighting)
usually it ranges between -25 and +25, though.


On slow machines (Pentium 1Ghz or or older) the constant
lighting-check can cause quite a lag, in this case you can
disable the dynamic light-bonus, in the console and just use 
a static bonus that is dependent on the cell's ambient-light.

 Set JOG_sneak_static to 1



================================================================
 ***************************
* Armor-Based Sneak-Penalty *
 ***************************

Medium or Heavy Armors will now bring a cumulative Sneak Penalty,
with different parts of the body receiving varying penalties.

		Medium 	Heavy
Helm            -2       -4
Chest           -5       -10
Left pauldron   -1       -3
Right pauldron  -1       -3
Greaves         -4       -8
Boots           -3       -6
Left hand       -1       -3
Right hand      -1       -3
Shield          -5       -10


Notes:
-----
Other than in LDone's original mod, this mod adds the sneak-penalties
in the moment you begin sneaking instead of everytime you change armor.

If you want to use another mod that adds armor-based penalties, 
or simply don't like the idea of armor interfering with your 
sneak skill, you can turn this feature off in the console by typing:

 Set JOG_sneak_noarmor to 1
 
Setting the variable to 0 will reactivate the feature. 
The change will apply the next time you release the sneak button. 


================================================================
 ********************
* Sneak Attack Bonus *
 ********************

When you sneak for 10 seconds with a weapon drawn, and without 
attacking or being attacked, (or otherwise loosing health or fatigue)
you get an Attack Bonus (Fortify Attack "Curse") depending on your 
Sneak Skill and the weapon you use:

Unarmed 	  + 1/2 Sneak Skill
Short Blade: 	  + 1/2 Sneak Skill
Marksman/Thrown:  + 1/3 Sneak Skill
1-Handed Axe:	  + 1/4 Sneak Skill
1-Handed Blunt:	  + 1/4 Sneak Skill

These bonuses base on your base-sneak-skill. Lighting and worn 
armor only affect your skills to hide and move silently, while the 
sneak-attack-ability is your character's skill to disguise an attack,
and thus deny the opponent the chance to parry it.


================================================================
 ***************
* Assassination *
 ***************

When you score a critical hit (opponent didn't detect you, damage x4)
and had a sneak-attack bonus, you may kill the opponent instantly
if you also used a short blade or your bare hands for the attack.

The percentile chance to perform an Assassination is the sum of your
base-sneak-skill plus half the used "weapon skill".

If you have a short blade skill of 40 and a sneak skill of 35 for
example, your chance for an assassination would be 40 / 2 + 35 = 55%

A Luck score above 40 increases this chance even further, with 50 Luck
your effective chance for an assassination would be 55 * 110% = 60%
with 100 Luck it would be 55 * 160% = 88%. Luck below 40 reduces the
chance accordingly.


Short Blade:
------------
You kill your enemy by puncturing a vital organ, (or disabling an important
magic rune or device in case of an undead or construct). Death comes in an
instant. Once the sum of your sneak skill and half the shortblade skill
is 100 or higher, you will always perform an assassination when you score
a critical hit.


Hand to Hand:
-------------
You sneak upon your opponent, grab his head and snap his neck, breaking 
the cervical spine. Your strength needs to be at least half as high as 
the opponent's or he may resist this attack even when surprised. 
So you may constantly fail on some strong opponents, even when the sum 
of your sneak skill and half the hand-to-hand skill is far beyond 100.
When your strength is more than twice the opponent's he has no chance 
against the attack and the assassination-attempt succeeds automatically. 


Notes:

- To perform an assassination the opponent needs to be targeted
  (i.e. the box with his name needs to be displayed)

- The lighting and armor modifiers do not apply to your chance of 
  performing an assassination, they apply to the general chance of
  staying undetected and thus perform a critical hit, though.

- Once an enemy detected you and is in combat with you, you can
  no longer surprise him, and won't be able to score a critical hit
  or perform an assassination, even when you're invisible. 



*****************************************************************

     5. Customisation

*****************************************************************

There are a few ways to customize how this mod works for you,
just open the console and type the commands.

Armor Penalty
=============
If you don't want a penalty for wearing bulky armor or want
to use a different mod that adds armor penalties:

"Set JOG_sneak_noarmor to 1"         Disable the armor penalty

"Set JOG_sneak_noarmor to 0"         Enable the armor penalty



Interior Cell Light-Penalty
===========================
If your machine is too slow for "dynamic" lighting-calculation
in interior cells, or you simply want to have a "static" penalty
that is calculated only once when you start sneaking:

"Set JOG_sneak_static to 1"         Use "static" light-penalty

"Set JOG_sneak_static to 0"         Use "dynamic" light-penalty



Interior Cell Lighting
======================
If you use a mod that changes the lighting of interior cells,
you may want to use different values to calculate the lighting 
bonus or penaty. (The following are the default values) 


"Set JOG_sneak_ambient to 600"

The lower "JOG_sneak_ambient" is the darker is the cell for the
script and the higher will be your sneak skill when you sneak
far away from any light sources.


"Set JOG_sneak_lighting to 300"

This setting determines both, the distance when a light
(a torch for example) has an effect on your sneak-modifier,
and the strength of the penalty you get when comming closer.
the lower this value compared to the "ambient" value, the
closer you can go to a light source before it has an effect
on your sneak-skill.


"Set JOG_sneak_penalty_mult to 1.111"

If you change the ambient:lighting ratio, you should also change
this variable accordingly so that the sum of ambient and lighting 
multiplied with this value is about 1000.
 
 JOG_sneak_penalty_mult * ( JOG_sneak_ambient + JOG_sneak_lighting ) 

When the result is lower than 1000, light sources will give a much 
lower penalty, when the result is higher, the penalty will also rise.



The following values are a guidline of the intended sneak-modifier,
and the effects by changing the lighting:ambient ratio, use these as
a gauge when you want to adapt Enhanced Stealth to your lighting mods.

                              300:500  300:600   300:700
Addamasartus:                  +15       +13       +11 
Arilles' Tradehouse:            +3        -1        -5
Census and Excise Office:        0        -5        -9 
Census and Excise Warehouse:    -2        -8       -13 




*****************************************************************

     6. Known Issues

*****************************************************************

* When your spells are suddenly gone and parts of the main menu are
  missing, don't report this, and RUN MORROWIND ENHANCED instead.

* When you have insanely high sneak multipliers (in the hundreths)
  you're useing Morrowind Enhanced v1.21, you need to use v1.6.

* The interior-cell modifiers have been balanced for Morrowind's
  Default lighting, if you use a mod that changes lighting you may
  want to change the lighting-settings of Stealth Enhanced (see 5.)

* When you wear an enchanted item that fortifies your sneak skill
  this will be cummulative with the penalties and bonuses from this 
  mod, but once you stop sneaking, your sneak skill will be restored
  to the value it had before equipping the item. When you now remove
  the enchanted item, your sneak skill will be lowered (red)

  This is caused by a bug in Morrowind, but there is a workaround
  in Enhanced Stealth: everytime you release the sneak key, not only
  the effects from this mod are removed, but also a "Restore Sneak"
  effect applied for a short time, so simply take off the Fortify-Sneak
  item and press the sneak-key once to restore your sneak skill.

* When you move too close to a flickering light source indoors,
  the modifier may jump between an extremely high negative value
  and something close to 0 (+1 and -50 for example), there isn't
  much I can do about this, either Morrowind or MWE are responsible
  for this and I have the source codes of neither.

* There is a delay during weather transition, the weather-modifiers
  aren't applied until Morrowind reports the new weather, which 
  doesn't happen until the transition is completed. So sometimes 
  you're midst what already seems to be a thunderstorm but get no
  sneak-bonus for a while. There is nothing that can be done about it.

* When you continue sneaking during combat and neither attack nor
  are hit by your opponent for 10 seconds, you'll get another 
  sneak-attack bonus. This is the way how the sneak-attack bonus 
  works, and additional checks would just slow down the script,
  for very little to gain. Just see it as a feature: You use your 
  sneak skill for feinting and the enemy doesn't see your attack.

* The armor-penalty doesn't change when you change armor while 
  sneaking, the goal of this mod was to have the global script
  requiring a minimum of processing time, and so the armor
  penalty is only calculated once when you enter sneak mode.



*****************************************************************

     7. VERSION / CONTACT

*****************************************************************

v 1.0 (30.March.07):

    - Yet another stealth-enhancer for Morrowind...
    - Yet another thievery-oriented mod by JOG...


v 1.1 (01.April.07):

    - Fix: When you got a weather-bonus and an armor or lighting penalty
      at the same time, your sneak-skill was lowered (drained=red)
      when you stopped sneaking.

    - Your sneak skill still gets lowered when you get a penalty
      while your sneak-skill is raised by a spell or enchantment,
      now you just need to remove that enchanted item and when you
      stop sneaking the next time your skill will be restored to
      its normal value.


v 1.2 (06.April.07):

    - Quasi-Exterior Cells like Mournhold are now identified
      as exterior cells and the script behaves accordingly.

    - Some speed-optimizations especially for slower PCs. 

    - Default influence of ambience light is reduced a bit (from 70% to 66%) 
      Thus bonuses will be a bit higher and penalties due to ambient light
      a bit lower. Penalties caused by light-sources are unchanged.

    - Added global variables to customize several settings.

------------------

Please send comments and bug reports to : jo.ge@gmx.net

Homepage: <http:/home.tiscali.de/jo.ge/mw>


*****************************************************************

     8. CREDITS

*****************************************************************

Enhanced Stealth bases on "Morrowind Enhanced" (MWE) by Aerelorn.

The mod combines the ideas from the following plugins
(I even stole the well-tried values used by those mods for 
bonuses and penalties, but the implementation is different)

* "Thief Experience Overhaul - Stealth Enhancements"
    By LDones 

* "Armor Effects-LD v2.0-WD"
    By LDones and WDog

* "MWE Crime Enhanced - Light-Based Stealth & Sneaking" 
    By Aerelorn and Tonto

* "ACE Addons - Backstab"
    By Hitto

* "Kirel's Sneak Attack"
    By Kirel


