Jump to content

Adding a spell effect to player while an item is in their inventory?


SkylerModder

Recommended Posts

I'm trying to determine if there's a way in the CK to apply spell effects to a player while a particular item is in that player's inventory but not equipped. As in, when you pick up the object it applies an effect, and when you drop it again or it otherwise gets removed, the effect is removed. Ideally, I'd like to find a way to do this without scripting, if possible, for the sake of compatibility.

 

I mainly need to figure this out so that I can trigger an effect for items that can't be equipped, such as a book. E.g., if you had that book in your inventory then an effect could be applied until you drop it again or it gets removed from your inventory.

 

 

Link to comment
Share on other sites

Sorry, but you'll have to use a script. It won't hurt compatibility to do so, though, just attach a new script to your object with an OnContainerChanged event: if the new container is the player, apply the effect; otherwise if the old container was the player, remove the effect.

 

The effect itself should be an ability, applied via AddSpell and removed via RemoveSpell.

Link to comment
Share on other sites

  • 9 months later...
  • Recently Browsing   0 members

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