Jump to content

Adding Spells On Container Change


Yorkie77

Recommended Posts

Hi!


I want to attach some script to a book so when the player picks it up, they immediately gain a spell rather than have to consume the book itself. I think what i've got is solid, but having an experienced pair of eyes look over it before I attempt to implement it would be nice :3



Scriptname bookspelltrial extends activemagiceffect


Spell Property summonnpc auto

book Property book1 auto


Event OnContainerChanged(book1 newContainer, book1 oldContainer)

if (newContainer == Game.GetPlayer())

Debug.MessageBox("You've gained a spell")

Player.AddSpell(summonnpc)

endif

EndEvent



As always, all help is greatly appreciated =3
Link to comment
Share on other sites




Scriptname bookspelltrial extends activemagiceffect

Spell Property summonnpc auto
book Property book1 auto
ACTOR PROPERTY PlayerRef AUTO

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
if (akNewContainer == PlayerRef)
Debug.MessageBox("You've gained a spell")
PlayerRef.AddSpell(summonnpc)
endif
EndEvent

Edited by GrimyBunyip
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...