Difference between revisions of "Dynamically Adding Spells to Merchants"

corrected formatting and added Useful Code category
imported>KyneTarse
imported>DragoonWraith
(corrected formatting and added Useful Code category)
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<br/>
Begin OnLoad
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NPCRef.AddSpell <SpellID1><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NPCRef.AddSpell <SpellID2><br/>
  NPCRef.AddSpell <SpellID1>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...<br/>
  NPCRef.AddSpell <SpellID2>
End<br/>
  ...
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.


[[Category: Useful Code]]
[[Category:Solutions]]
[[Category:Solutions]]