Difference between revisions of "OnUnequipped - ObjectReference"

m
no edit summary
imported>Gurgate
imported>Gurgate
m
 
Line 23: Line 23:
</source>
</source>


Because all item bonuses and enchants are disabled when in power armor, this event also will be emitted if the script is on an item normally equipped by the actor when the actor enters a power armor frame. You can use this to your advantage to bring effects back that are lost while in the power armor. Take this example which can re-apply an ability spell upon entering power armor. You can use this as an alternative to enchanting the item.
Because all item bonuses and enchants are disabled when in power armor, this event also will be emitted if the script is on an item normally equipped by the actor when the actor enters a power armor frame. You can use this to your advantage to bring effects back that are lost while in the power armor. Take this example which can re-apply an ability spell upon entering power armor. You can use this as an alternative to enchanting the item. This example will apply a spell, but you could use it to apply perks dynamically (probably still only to the player) as well.


<source lang="papyrus">
<source lang="papyrus">
Spell Property OurSpecialAbility Auto  
Spell Property OurSpecialAbility Auto
{A Constant Effect, Ability Spell. Is Special.}


Event OnEquipped(Actor Who)
Event OnEquipped(Actor Who)
Line 41: Line 42:


     If(Who.IsInPowerArmor())
     If(Who.IsInPowerArmor())
         ;; reapply.
         ;; reapply. this can probs technically be skipped.
        ;; but lets be double sure it did not fall off.
         Who.AddSpell(OurSpecialAbility)
         Who.AddSpell(OurSpecialAbility)
     Else
     Else
Anonymous user