Death check with weapon script
Introduction
In the process of working on a project that requires the Player to kill an NPC, and than adds an item upon the death of the NPC, it became necessary to layout the steps for the project, and this seemed the best, and most helpful way to others, to do that.
This Tutorial will follow the steps below:
1. Create a Magic Effect Script that will check for the death of an NPC at the Player's hand, than add an Item to the inventory with a nice little message.
2. Create the item to be added, in this case, the soul of the NPC in the form of a bottled potion.
3. Create a scripted enchantment that runs our script. (Because there is no way to activate a script when the Player hits an NPC i.e. Onstrike or anything of that kind. See: Begin).
4. Finally create, and place into Tamriel, the weapon that will execute the script.
Notes:
It is assumed the reader has a prior basic knowledge of scripting, however, as it is most frustrating to see things work but not understand why, most work done here will be well explained.
Other Tutorials of possible relevance:
Deadcount on a weapon.
So without further ado, "Get on with it!"
The Script
To begin, we load the CS and than open the script editor by clicking on the File:ScriptEditorIcon.png symbol.