I'd like to create a cloak effect that forces any hostile target to focus the actor with the cloak on over all others. What papyrus function could handle this? Can you think of one? Or perhaps something in the ck?
I'd like to create a cloak effect that forces any hostile target to focus the actor with the cloak on over all others. What papyrus function could handle this? Can you think of one? Or perhaps something in the ck?
In the cloak effect's target spell script do something like this:
Event onEffectStart(Actor akTarget, Actor akCaster) If akTarget.IsInCombat() If akTarget.GetCombatTarget() != akCaster akTarget.StopCombat() akTarget.StartCombat(akCaster) EndIf EndIfEndEvent
Since cloak spells are continuously recast, even if the enemies switch targets, they won't get far before the cloak script forces them to retarget the cloak's caster. If they're not in combat, or are already fighting the target, it does nothing.
You may want to add a line to exclude the player character from the check, as IsInCombat often returns true for the PC even if you're not actually attacking anyway. The PC can't have its combat target set, though, so your debug log will fill up with errors.
Thanks!
Will I have a problem with this effect piling up on the target, or do cloak spells just refresh effects instead of layer them?