Give Spell to Player on Trigger box?

Post » Tue May 21, 2013 8:07 am

So, title says it all - how is the script supposed to look, if I want a trigger box to ''give" the player a new spell (so he can use it).

In books it's simple, because I can do it from the level of th prop itself. But from the script, I see a problem there. :\

User avatar
RaeAnne
 
Posts: 3427
Joined: Sat Jun 24, 2006 6:40 pm

Post » Tue May 21, 2013 3:47 am

I imagine it would look something like:

Spell Property YourSpell Autobool bIsTriggered = 0Event OnTriggerEnter(ObjectReference akActionRef)  if akActionRef == Game.GetPlayer()    if bIsTriggered == 0      Game.GetPlayer().AddSpell(Yourspell)      bIsTriggered = 1    endif  endifEndEvent

Script is attached to the trigger box and extends ObjectReference. The bIsTriggered is to make sure the spell isn't given more than once.

User avatar
An Lor
 
Posts: 3439
Joined: Sun Feb 18, 2007 8:46 pm


Return to V - Skyrim