Difference between revisions of "Death check with weapon script"

no edit summary
imported>Spd1274
imported>Spd1274
Line 7: Line 7:
This Tutorial will follow the steps below:<br />
This Tutorial will follow the steps below:<br />
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. <br />
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. <br />
2. Create the item to be added, in this case, the soul of the NPC in the form of a bottled potion.<br />
2. Create the item to be added, in this case, the soul of the NPC in the form of a bottled potion. From here on, called The Gift. <br />
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: [http://cs.elderscrolls.com/constwiki/index.php/Begin Beginning Scripts]).<br />
3. Create a scripted enchantment that runs our script. To be called, The Ench (Because there is no way to activate a script when the Player hits an NPC i.e. Onstrike or anything of that kind. See: [http://cs.elderscrolls.com/constwiki/index.php/Begin Beginning Scripts]).<br />
4. Finally create, and place into Tamriel, the weapon that will execute the script.
4. Finally create, and place into Tamriel, the weapon that will execute the script. To be called, The Weapon.


Notes:<br />
Notes:<br />
Line 92: Line 92:


Finally our script finishes up by running a test that Dead and Once have been set to the correct values for a killed NPC. <br /> Than the script adds an Item of our choice to the Player's inventory and displays a message.<br /> In order to avoid the script giving the Player the item over and over and over, the last action of the script is to set Once to 1, avoiding a loop.
Finally our script finishes up by running a test that Dead and Once have been set to the correct values for a killed NPC. <br /> Than the script adds an Item of our choice to the Player's inventory and displays a message.<br /> In order to avoid the script giving the Player the item over and over and over, the last action of the script is to set Once to 1, avoiding a loop.
Now, let's save our script, by clicking on the Floppy Disk icon, and close the window.
This completes our creation of the script, it is all that simple. It needs to be said that the tests run under "ScriptEffectStart" must be run there, because that portion of the script is run while attacking the victim, and if those tests were run under "GameMode" the Player would no longer have a target to test.
So now, onto the The Gift.
== The Gift ==
Anonymous user