Trykz Posted July 8, 2013 Posted July 8, 2013 What I need is for a spell effect to force equip an armor part, and then remove it (from the player and inventory) when the effect finishes. I found all sorts of examples for adding an effect when an item is equipped, but nothing for an effect equipping an item. And unfortunately, none of the CK tutorials deal with anything this specific, and everything tends to feel reading like stereo instructions, because there are so many functions that appear they might be the one I need I have the armor piece set up in the CK. I also have the spell with the aforementioned effect attached and working in game. All I need now is a working script for the effect to equip/remove the piece whenever the effect is active. TIA, Trykz
b3lisario Posted July 8, 2013 Posted July 8, 2013 ? Scriptname Foo extends activemagiceffect Armor property item auto ; set script property in CK int BODY = 32 Event OnEffectStart(Actor akTarget, Actor akCaster) akTarget.EquipItemEx(item, BODY, false, true) endEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) akTarget.UnequipItemEx(item, BODY, true) endEvent
Trykz Posted July 8, 2013 Author Posted July 8, 2013 ? Scriptname Foo extends activemagiceffect Armor property item auto ; set script property in CK int BODY = 32 Event OnEffectStart(Actor akTarget, Actor akCaster) akTarget.EquipItemEx(item, BODY, false, true) endEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) akTarget.UnequipItemEx(item, BODY, true) endEvent Worked perfectly b3lisario, thank you most kindly I also added functions to equip the item from outside the player inventory, and then remove it when the effect finishes. Works very well. This was just what I needed to achieve exactly the effect I wanted Trykz
Recommended Posts
Archived
This topic is now archived and is closed to further replies.