Hello I am doing some troubleshooting into passive feat that may be firing in a loop (and possibly stacking.) For example I have this custom passive feat script;
Hello I am doing some troubleshooting into passive feat that may be firing in a loop (and possibly stacking.) For example I have this custom passive feat script;
You could apply a SetEffectSpellId to the feat effect so that you can track it and abort it using GetEffectSpellId, if necessary.
You could apply a SetEffectSpellId to the feat effect so that you can track it and abort it using GetEffectSpellId, if necessary.
That's certainly the approach I would take; lump everything together into a single effect using EffectLinkEffects() and then give it a dummy spell number via SetEffectSpellId(). Then have the OnRest script remove the tagged effect via RemoveEffectsFromSpell() before adding it back again:
#include "nw_i0_spells"
void main()
{
object oPC = GetLastPCRested();
object oTarget = OBJECT_SELF;
if(GetHasFeat(2859, oTarget))
{
RemoveEffectsFromSpell(oTarget, 9999);// Where 9999 is the spell ID used to tag the effect
ExecuteScript("feat_privateer_taunting", oTarget);
}
}
Is there really any need to define both oPC and oTarget in that OnRest script though? OBJECT_SELF will return different things depending on what the script is running from.
Do you have to use a dummy SpellID or can you simply use the spell 's ID# from the Spells.2da file?
You can use any ID you want. I set it to a high value so it is unlikely to collide with somebody else's mod or an existing spell.
I often use the spell ID for the Light spell, since it's easy to remember (100) and I generally don't care if a light spell is actually removed at the same time as my tagged effects. For hostiles it's a moot point, since you can't cast Light on a hostile, and their AI won't have them cast it on themselves.
The best way to fire passive feats is to make them persistent (will fire on rest, level up, area transiction and game load) in the feat .2da and associating to them a spell on spells.2da that will fire the script you want on "impact script".
I'd have to understand what you're trying to do with this feat though, as I see there are two different subjects, the oTarget and the oPC, are they supposed to be the same character? And why is the feat not permanent and lasts for 72 hours?