Skyrim

File information

Last updated

Original upload

Created by

Leon Fenten

Uploaded by

leonfenten

Virus scan

Safe to use

Documentation

Readme

View as plain text

******************************************************
Index:
1.0 Powers
1.1 Cool Down
1.2 Messages
1.3 Location
1.4 Compatibility
1.5 Projectile/Targeted Spells

2.0 Powers, Concentration, Shouts, Ritual Spells
2.1 Dual Cast & Perks
2.2 Skill Gain
2.3 OnUpdate()
2.4 Summon Spells
2.5 Rune Spells
2.6 Bound Weapon Spells
2.7 Armour Spells

3.0 Target Types
3.1 Ingredients, Potions, Poisons

4.0 Objects Created in CK
4.1 Special Wizard Caster
4.2 Debug Trace

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

1.0 POWERS
-----------

Preparation: (0x00285A)
***********************
This spell is a very basic version of the original idea, there are no options to choose other then what spell you want to be cast. This spell only has the "player" as the target so it was designed mainly for spells like Oak Flesh, Healing, Cloak, Summons etc anything you would mainly be casting on or next too yourself.
If you store a spell like Fireball, or Ice Spike etc that have a projectile and target then when the spell activates on start of combat the stored spell will just fire in the direction your cursor is aiming at that second the combat starts.

Foresight: (0x00285B)
**********************
This is an expansion to the Preparation spell, it has all the same spell target effects i.e. player only, will give you a hint if a particular spell isn't stable with this spell and will use my copy of a summon spell if needs be to make sure it casts successfully. The addition to this spell is you will get a message box the second you cast it with a choice of FIVE triggers of when to actually cast the stored spell. When combat starts, when you are hit, when your Health is less than 50% in combat, when your Magicka is less than 50% in combat and when your Stamina is less than 50% in combat.

Contingency: (0x00285D)
***********************
This is the next version of Foresight, along with all of Foresight's abilities you can now chose your target. Either the player, the nearest ally, the nearest opponent or recall your last Contingency settings. This was a major undertaking and has taken a lot of testing to get just right. Again you will get a message after the message box if your chosen spell is "stable" or not as there is now two lists of spells. Ones like Preparation and Foresight that were best targeting only "Self" and now a list of safe spells targeting only "others".

Precognition: (0x00285F)
************************
This is the final spell in the line and has an absolute plethora of customisable options for targets and conditions. For example, the target could be a spell casting mage, or an undead skeleton and your condition could be, when your health reaches 40% or when you are hit by a sword. As there are a lot of great spell mods out there I have added an extra set of optional conditions right at the end, for example only release the Magical Energy when you are outside or NOT while you are sneaking etc.

1.1 Cool Down:
-------------------
After every successful use of my spell you will have a new spell applied which stops you from casting it again... This can be cancelled by either waiting a long time or going to sleep in a bed.
Preparation = 5 Minutes cool down.
Foresight = 10 Minutes cool down.
Contingency = 15 Minutes cool down.
Precognition = 20 Minutes cool down.

Several reasons I set a "cool down" instead of it costing Magicka when the spell is released.
*********************************************************************************************
1. The main point of these powers is that they are backup plans/Contingencies, most of the time you need a backup when you have already lost most if not all of your Magicka.
2. If I took away the cool down the higher powers could be really abused and used too much, they can be very powerful when used properly.
3. A whole section of the "When" choice would be made redundant, where you chose on how much Magicka you have left, can't ever set that to 50% 40% or 10% etc if we need Magicka to release the spell from storage.
4. You have already used Magicka to cast the spell in the first place when you choose one.
5. It would take a lot of extra scripting and conditions to script the proper removal of Magicka only when it activates rather than just having the powers themselves set as spells and costing Magicka to initially cast.

1.2 Messages:
-------------------
On screen you will see a couple of messages when using my spell, here is what they mean...

*** Please cast your spell to be stored. :
Pretty simple it means my spell is waiting for the player to cast the spell they want to store ready to be cast during whatever condition applies.

*** Combat interrupts the storage of Magical Energy! :
You cannot be in combat when you try to store a spell there are too many things going on that could go wrong, this is really more of a precaution I tested my spell even with combat and couldn't find any bugs but better safe than sorry.

*** Those Magical Energies are not compatible! :
My spell will not let you store any Powers, Concentration Spells, Shouts or Ritual spells.

*** Your Magical Energy stores but feels unstable... :
Any spell I have found to not work perfectly with the set condition (or just one my mod doesn't recognise) will show this message, the spell will still fire off as normal but it might not go in the correct direction or may not fire off at all if your crosshair is facing the sky or something in the distance. For example having the condition "Self" but storing a fireball!

*** Your Magical Energy has been stored. :
Just a confirmation the spell has been stored and it's on the "Safe" list of spells for that condition so I have tested it multiple times. Of course if you have altered a vanilla spell I won't have tested that.

*** Preparation weakens and fades away. :
I have set a timer on all my spells for two reasons. One it seemed a little overpowered to have it last forever holding the spell, Two I wanted to make sure there was no chance of save game bloating so this message is to tell you the spell has run out of time and dispelled.

*** You cannot store more Magical Energy yet. :
There is a limit to how soon after a successful use you can cast again.

1.3 Location
-------------
Go and see Bersi in the Pawned Prawn in Riften, he will only sell you the power tome�s if you are of sufficient experience though.
Preparation: Level 2+
Foresight: Level 10+
Contingency Level 20+
Precognition: Level 30+

Alternatively, go into the Pawned Prawn, bring up your command console, type TCL, turn around and walk through the door/wall behind you were you will find a pedestal. Click it to activate and receive all the powers with no cost or level requirement.

1.4 Compatibility:
-------------------
I have tried my best during this project to make it as compatible as possible for all other spell mods, to this extent I have only used one single vanilla reference in the game. The Pawned Prawn in Riften where you can buy the power tomes. I have set the script on the pedestal to remove itself once the player has all four powers so as not to have the script running forever.

Obviously some combinations won�t work when trying this mod with others, you will get some strange results. E.g.:
Don't cast a Contingency which targets an NPC and you choose Midas's Shapeshift Wolf because that's just madness.
On the other side though casting Precognition, choosing an enemy spell caster as the target and using Apocalypse illusion spell Befuddle works really well.
I have done some play testing with mods such as Midas Magic, Phenderix Spells, Be a Better Mage and Apocalypse and on the most part as long as you are sensible in your choices of target they will work fine.

1.5 Projectile/Targeted Spells:
-------------------------------
One MAJOR note is ANY scripted spells have a chance of not working properly through these storage spells, the main point being a lot of scripts are written with the source of the caster being a variable not a fixed reference of �player". In other words, the script has been written (translated) as follows...

[When this spell is cast, remember the caster as "akCaster" and remember the NPC that was hit as "akTarget".]

[Once the effect has started please apply "Effect A" onto akTarget, using akCaster as the one to blame and cast from again if needed.]

The only problem with this scripting is my storage spells are not cast from the PLAYER if it is a projectile spell. They are cast from an invisible wizard with perks and skills copied from the PLAYER. The invisible wizard will appear, cast the "Effect A" then disappear which in most cases is fine but as a lot of special scripted spells or the effects run for longer then 1 second, so the invisible wizard caster is not there anymore to apply all the effects.

I tried desperately to use the PLAYER to cast the storage spells but with any projectile the spell cast from the PLAYER will ONLY go toward the crosshair not the actual target. This made a lot of the "Target" options pointless as the PLAYER would not necessarily be exactly facing there intended target for the storage spell the entire battle.

2.0 Powers, Concentration, Shouts and Ritual Spells:
---------------------------------------------------------------------
I have written a rule into the scripts that will cancel the storage effect if any Powers, Concentration spells, Shouts or Dual-Wield spells are tried to be stored. I am trying to make this a balanced mod as much as I can, can't have players� instant casting Mass Paralysis the second combat starts!
Also as a side note I have included Invisibility as a banned spell, mainly because after a lot of testing I have found it doesn't seem to ever work from a stored state!?

2.1 Dual Casting and Perks:
---------------------------------
If you Dual Cast a spell to be stored, when it is cast by my spell it will not copy the Dual Casting attributes of having extra damage or extended time. Perks on the other hand do carry over successfully so if you have, for example the Mage Armour perk any armour spell cast by my spell will also grant you additional protection. Perks bonus's only apply to the Player though, unless your target just happens to have some perk bonuses of their own of course.

For casting (Vanilla) projectile spells I had to create an invisible wizard to cast the spells for the player as any projectile type spell only ever goes exactly where the player has their crosshair pointed at the time of activating. I have painstakingly created an Invisible Wizard with EVERY combination of perks I could think of so that if the player has a perk and you choose to cast at a target the Invisible Wizard will also have that perk. This will obviously only work with Vanilla perks, if you have altered Vanilla perks that will work fine but any brand new perks will not work from the Invisible Wizard. Bethesda in their infinite wisdom decided you cannot add perks to NPC's with papyrus!

2.2 Skill Gain:
---------------
All spells cast through my spell will give you experience if it otherwise would have. I.e. if you cast a circle spell to store, you enter combat my spell would cast said circle spell again but you won't get any experience unless an opponent is hit by it the same as if you had just cast it yourself.

2.3 OnUpdate()
-----------------
For those of you who know about the scripting in Papyrus or have just read about it will know the problems associated with OnUpdate() function.
I had to find an alternative work around because for some bizarre reason known only to Bethesda the OnCombatStateChange() function does not work on the player so that was the only other option I had for checking when exactly the player went into combat.
Eventually I realised I can create a spell effect inside each of the storage spells that only fires when the player enters combat. So I created 2 extra magic effects and spells and an extra script so now as soon as the player enters combat a 'While' process runs activated by an OnMagicalEffectApply() Event held running with a Keyword. Ingenious no?

2.4 Summon Spells:
---------------------------------------
Because all summon spells use a "Target Location" Delivery type and because whenever a spell is cast by the player they HAVE to be facing the intended target I was forced to make a work around for summon spells. The problem I found was although the player would cast the summon spell as soon as (for example) combat started, the spell would only work if I was at that exact second facing the floor or wall. After a lot of testing and some help from RandomNoob on the forum's I found I had two options of a work around to make sure no matter what the player was doing the second combat started their chosen summon would work.

Option 1: My first idea that RandomNoob from the Bethesda Forums helped me with was to have a custom NPC appear the second combat started and have them face the player and cast the spell at me. That worked fine but the summon would not get any Perk bonuses the player had plus as soon as the custom NPC wizard was disabled (can't have 100 customs NPC's running around Skyrim) the summon would also disappear.

Option 2: Create a copy of every summon spell, have the script check exactly which spell the player wanted to store then cast my duplicate that had a Delivery type of "Self". The problem with this option was any custom made summons would still have a chance of not being created as I did not make a self only copy of said custom summon (kind of impossible to predict every permutation of summon any Modder could ever create). Also any changes a Modder has made to the original / Vanilla spell/magic effect would not be used by my copy.

In the end I went with Option 2 as it was the most reliable and if needs be a Modder can create a "Self" only copy of their custom summons to grant a 100% change it will work with my spells.
These custom Summons will only be called if you choose "Myself" as the target, if you choose "Ally" or "Enemy" it will attempt to cast the default summons which need you pointing to the ground for it to work.

Couple of changes I made to my copy of the summon spells, I removed the WISpellDangerous to stop other NPC's moaning about the summon in case they did last until you got to a town. I also added "Disallow Spell Absorb/Reflect" on each spell to stop the bug with the Atronach ability absorbing your summons.

If you choose to cast any summon with the standard Keywords (MagicSummonFamiliar) or (MagicSummonFire/Frost/Shock) the spell will automatically be cast from the Player and targeting the Player. Otherwise if you choose your summon spell to be cast at an Enemy the summon itself would become your enemy also.

2.5 Rune Spells:
----------------------
Rune spells suffer the same problem as the summon spells but with an added difficulty, I could not create "Self" versions of the rune spells because it would just instantly fire on the player and hurt them. I was unable to find any work around for rune spells to work with my spell besides the player actually looking at a wall or floor when the spell activates so unfortunately Rune spells are really not a viable spell to store... Sorry.

2.6 Bound Weapon Spells:
--------------------
All "Bound Weapon" type spells when cast from my spell will appear in your Right Hand by default even if you cast the original spell with your left hand. There is a work around to this where I check in the script what hand is holding the "bound weapon spell" when cast and get the stored spell to cast a "left hand only" version but there are two problems. One the script might catch the transition between bound weapon and spell in that hand and not handle the event properly. Two if any changes to the vanilla bound spells or weapons are made in game those changes wouldn't apply to the left hand because it would cast the vanilla "left hand only" version.
So in the end I decided to leave it cast in the right hand as default.

Bound spells can be set into a Contingency to be cast on an Ally but due to the massively complex way the bound weapons use perk bonus's I have removed my version of the work around because it involved new versions of the bound weapon spells, the perks, the magic effects, the enchantments and the weapons themselves. Sorry no having your Ally use soul trap with your bound sword when they slay their opponent.

2.7 Armour Spells:
---------------------
Due to the fact that the Perk for armour bonus (Mage Armour Rank 1 to 3) only actually applies to the caster ever and that the bonus's are actually on the spell itself I decided to make 3 new perks applied only to my special Wizard Casters so that the player can still successfully cast the armour spells on their ally's or summoned/raised minions.

Basically, when you choose an armour spell to be cast on an ally (or opponent if you really want) the script will detect the MagicArmorSpell Keyword and summon a wizard caster that has one of my special perks but only if the player has the relative mage armour perk.
The perk applies the same values as the vanilla perks so if you have a mod that has changed these values you will need to use the CK to edit my special perks also to match your custom perks. Also the rule for "wearing no armour" still applies to my special perks. E.g.
You have Mage Armour Rank 2, you have a dog follower and a heavy armour wearing mercenary.
If your Contingency states to cast Oak flesh on your nearest ally when you enter combat... If your dog is closer he will gain 100 Armour bonus (40 x 2.5) if your mercenary is closer he will gain 40 armour bonus.

3.0 Target Types List:
------------------------
Myself: Take a wild guess�
Nearest Enemy: The closest opponent the script can find from 0 � 160 feet.
Ally or Summon: Any one who is following you, a summon or raised unit.
Ally or Mercenary: One of your followers or a hireling.
Summon or Raised unit: One of your summons or a raised units.
Enemy Spell Caster: Any opponent with magic equipped in either or both hands.
Enemy Melee User: Any opponent with a melee weapon in either or both hands.
Enemy Ranged User: Any opponent with a ranged weapon in both hands.
Humanoid: Skyrim Default from "ActorTypeNPC" Keyword.
Animal: Skyrim Default from "ActorTypeAnimal" Keyword.
Creature: Skyrim Default from "ActorTypeCreature" Keyword.
Undead: Skyrim Default from "ActorTypeUndead" Keyword.
Summoned: Any enemy summoned unit.
More powerful then yourself: Any enemy that is a higher level then the player i.e. Boss enemies.
Unarmed: Any enemy not wearing light or heavy armour.
Heavy Armoured: Any enemy wearing any heavy armour.
Light Armoured: Any enemy wearing any light armour.

3.1 Ingredients, Potions and Poisons
-------------------------------------
The main catchment part of my scripts to detect what spell the player has chosen is using the OnSpellCast() Event. Unfortunately this even fires for multiple reasons not just for a spell begin cast it counts for ANY magical effect. In other words, Spells, Enchantments, Ingredients being eaten and poisons or potions being drunk.
For this reason I had to script in a rule to stop these effects being stored as best I could.

4.0 Objects Created in CK:
-----------------------------
LFflPowers: Lists all Concentration spells, Less Powers and Racial Powers not allowed to be cast by my spells.
LFflPreparationSafe: Lists all the spells that I know work with Preparations combat activation.
LFflContingencySafe: Lists all the spells that I know work with Contingency on a target.
LFmePreparaton: The magic effect with attached script for the Preparation spell.
LFmeForesight: The magic effect with attached script for the Foresight spell.
LFmeContingency: The magic effect with attached script for the Contingency spell.
LFmePrecognition: The magic effect with attached script for the Precognition spell.
LFmeSpellCoolDown: The magic effect with attached script for the cool down spell.
LFmeBlank: The magic effect for a completely blank spell.
LFmeDetect: The magic effect with attached script for the Detect spells.
LFmeInCombat: The magic effect which activates another when player enters combat.
LFmeInCombatStarted: This effect with attached keyword only activates when player is in combat.
LFspPreparaton: The spell for the Preparation magic effect.
LFspForesight: The spell for the Foresight magic effect.
LFspContingency: The spell for the Contingency magic effect.
LFspPrecognition: The spell for the Precognition magic effect.
LFspSpellCoolDown: The spell for the cool down magic effect.
LFspBlank: The spell for a completely blank magic effect.
LFspDetect: The spell for the Detect magic effect ranged 20 feet.
LFspDetectII: The spell for the Detect magic effect ranged 40 feet.
LFspDetectIII: The spell for the Detect magic effect ranged 80 feet.
LFspDetectIV: The spell for the Detect magic effect ranged 160 feet.
LFspInCombat: The spell which activates another when player enters combat.
LFspInCombatStarted: This spell with attached keyword only activates when player is in combat.
LFspConjureFamiliar: My SELF only version of summon Familiar.
LFspdunHighGateSummonFlamingThrall: My SELF only version of summon Flaming Familiar.
LFspConjureFlameAtronach: My SELF only version of summon Flame Atronach.
LFspConjureFrostAtronach: My SELF only version of summon Frost Atronach.
LFspConjureStormAtronach: My SELF only version of summon Storm Atronach.
LFspConjureDremoraLord: My SELF only version of summon Dremora Lord.
LFabWizard x 70: All my created Actors for Perk abilities.
LFkwWizardCaster: Keyword link for all my Wizard Casters.
LFkwDetection: Keyword link for the detect spells.
LFkwContingencies: Keyword link for all 4 main spells.
LFkwInCombatEffect: Keyword link for starting when the player is in combat.
LFkwInCombatDetect: Keyword link for when player is currently in combat.
LFqstGlobalVar: Quest to hold all global variables to pass between scripts etc.
LFperMageArmor1: NPC only version of the MageArmor30 Perk.
LFperMageArmor2: NPC only version of the MageArmor50 Perk.
LFperMageArmor3: NPC only version of the MageArmor70 Perk.
LFmsgSpellStored: Message for spell stored.
LFmsgForesightTO: Message for Foresight time out.
LFmsgMightNotCast: Message for telling player spell might not cast properly.
LFmsgReadyForSpell: Message to tell player spell is waiting for selected spell to be cast.
LFmsgNoPowers: Message telling player powers are not allowed.
LFmsgNotInCombat: Message telling the player not to try storing magic in combat.
LFmsgPreparationTO: Message for Preparation time out.
LFmsgContingencyOptTarget: Message box for Contingency's Target options.
LFmsgContingencyTO: Message for Contingency time out.
LFmsgContingencyOptWhen: Message box for Contingency's When options.
LFmsgNoIngredientsOrPotions: Message banning ingredients and potions.
LFmsgForesightOptWhen: Message box for Foresight's options.
LFmsgStillInCoolDown: Message stating the spells are still in cool down.

4.1 Special Wizard Caster:
----------------------------
Due to the fact that any projectile/target spell 'force' cast by a script from the player will always aim exactly toward the players cross hair I had to create a work around so that even if the player was running for their life, if the stored spell should fire at a target the player did not have to be facing exactly at that target for the spell to effect them.
In the end I decided on creating an invisible wizard caster with duplicate stats and perks to the player who would cast the projectile spell from a few feet behind the enemy so there is a lot stronger chance of the spell effecting the intended target.
The only problem being there is no way in Papyrus scripting to add Perks to anyone other than the player... ARRG! This meant I had to create a unique Wizard Caster for each combination of perks the player could have! The only saving grace was I could check on some of the spells a keyword, for example if the player stores a pacify spell it has the keywords MagicInfluence and MagicInfluenceCharm. So I had to create a unique Wizard Caster if the player cast a spell with those keywords and had for example the Hypnotic Gaze perk.
Yes this did take a long time to work out and perfect and YES I wanted to bash the head in of the Skyrim developer who decided to leave out such an important function in Papyrus.
The Wizard Caster copies the player skill levels on all magic skills, it also copies any modified stats for example the DestructionPowerMod variable which increases the damage any destruction magic does.
By all accounts the Wizard Caster should cast any projectile spell exactly as if the player did, the only problem I could not work around is if any new skills are created by other modders or any new perks my Wizard Caster cannot use them. Any changes to Vanilla perks is fine those changes will carry over to the Wizard Caster.

4.2 Debug Trace:
-------------------
For those of you who have written scripts for Skyrim or have read a little about them you know about "Debug Trace" for the log output.
I had put in a lot of debugging information while I was testing during this project but I have since removed all those lines, if problems persist for users I will release a version with all the debugging back in so I can check through users logs and find out what is wrong.

*** Thank You ***
***Leon Fenten***