RedMonika Posted March 23, 2021 Posted March 23, 2021 Hello... I'm trying to figure out how to make an enchantment for a weapon that in a radius switches the faction of undead to fight for the player. I'm thinking that it needs a cloak? The idea is that it creates the radius when the weapon is equipped. Thanks
jmf890 Posted March 23, 2021 Posted March 23, 2021 Without hitting an actor? You can't with how enchaments work. You would need to get creative, such as attaching an event to a weapon swing or an object equipped and then casting a separate area spell.
RedMonika Posted March 23, 2021 Author Posted March 23, 2021 19 hours ago, jmf890 said: Without hitting an actor? You can't with how enchaments work. You would need to get creative, such as attaching an event to a weapon swing or an object equipped and then casting a separate area spell. Thanks for the reply That's what i figured out. What about on hit? I know I can add a radius on a hit but what about changing the faction of undead? I thought it would be interesting to put such an enchantment on Anduril in game. Would it be like wood elf command animal?
jmf890 Posted March 24, 2021 Posted March 24, 2021 Create a new magic effect, set its archtype to Script, set an area, add the condition Subject.IsUndead == 1 and attach a simple script to set the actor as a teammate. Scriptname MyMagicEffectScript extends ActiveMagicEffect Event OnEffectStart(Actor akTarget, Actor akCaster) akTarget.SetPlayerTeammate(True, False) EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) akTarget.SetPlayerTeammate(False, false) EndEvent Create a Fire & Forget + Self spell (not enchantment) and link the above magic effect to this spell. Set an area and a duration for it and toggle Area Effect Ignore LOS if you want the area effect to affect all undeads within the area, even if there was no LOS between them and the actor that got hit. Create a magic effect, set its archtype to Script and attach a wrapper script to cast the above spell. Scriptname MyWrapperMagicEffectScript extends ActiveMagicEffect Spell Property ActualAreaSpell Auto Event OnEffectStart(Actor akTarget, Actor akCaster) ActualAreaSpell.RemoteCast(akTarget, akCaster) EndEvent Add the condition Subject.IsUndead == 1 to this magic effect aswell if the hit target must be an undead too. Now just add this magic effect to the enchantment's effect list.
RedMonika Posted March 24, 2021 Author Posted March 24, 2021 9 hours ago, jmf890 said: Create a new magic effect, set its archtype to Script, set an area, add the condition Subject.IsUndead == 1 and attach a simple script to set the actor as a teammate. Scriptname MyMagicEffectScript extends ActiveMagicEffect Event OnEffectStart(Actor akTarget, Actor akCaster) akTarget.SetPlayerTeammate(True, False) EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) akTarget.SetPlayerTeammate(False, false) EndEvent Create a Fire & Forget + Self spell (not enchantment) and link the above magic effect to this spell. Set an area and a duration for it and toggle Area Effect Ignore LOS if you want the area effect to affect all undeads within the area, even if there was no LOS between them and the actor that got hit. Create a magic effect, set its archtype to Script and attach a wrapper script to cast the above spell. Scriptname MyWrapperMagicEffectScript extends ActiveMagicEffect Spell Property ActualAreaSpell Auto Event OnEffectStart(Actor akTarget, Actor akCaster) ActualAreaSpell.RemoteCast(akTarget, akCaster) EndEvent Add the condition Subject.IsUndead == 1 to this magic effect aswell if the hit target must be an undead too. Now just add this magic effect to the enchantment's effect list. WOW!... thanks!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.