Difference between revisions of "Dynamically Adding Spells to Merchants"
Dynamically Adding Spells to Merchants (edit)
Revision as of 02:50, 28 November 2008
, 02:50, 28 November 2008no edit summary
imported>KyneTarse |
imported>KyleWollaston |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 5: | Line 5: | ||
Once you have your activator placed in the cell, attach a customized script similar to the following: | Once you have your activator placed in the cell, attach a customized script similar to the following: | ||
Begin OnLoad | Begin OnLoad | ||
NPCRef.AddSpell <SpellID1> | |||
NPCRef.AddSpell <SpellID2> | |||
End | ... | ||
End | |||
This script will cause the spells to be added to the specified NPC(s) each time the activator is loaded. If you load a mod that further changes the NPC in question, the spells will still be available the next time the cell is reloaded. | This script will cause the spells to be added to the specified NPC(s) each time the activator is loaded. If you load a mod that further changes the NPC in question, the spells will still be available the next time the cell is reloaded. | ||
[[User:GuidoBot|GuidoBot]] 01:43, 11 October 2006 (EDT) An alternative method is to just create a one-time-run Quest script that adds the spells to the NPCRef directly. For complicated effects, like inventory restocking and adding randomness, a scripted unplayable item (0-value ring), a token, can be added to the NPCRef directly. To ensure that the (GameMode) script only runs when the player is nearby, it is best to also add a GetInSameCell condition. | |||
[[Category: Useful Code]] | |||
[[Category:Solutions]] | [[Category:Solutions]] |