Need Get Effect Type help

How do I test to see whether a creature is under an effect? IOW, what is the syntax for: https://nwnlexicon.com/index.php?title=GetEffectType

They don’t give an example. I can define a variable, but how do I pass that as a check to the creature in question in an “if” statement?

There’s a function set up for this:

https://nwnlexicon.com/index.php?title=GetHasEffect

To do the check yourself, you’d cycle through the effects on the creature, and check the effect type one at a time, like this:

    effect eEffect = GetFirstEffect(oTarget);
    while (GetIsEffectValid(eEffect))
        {
        if (GetEffectType(eEffect) == nEffectType)
            {
            // Do stuff.
            break;
            }

        eEffect = GetNextEffect(oTarget);
        }
1 Like

Thanks, that helped. I didn’t need a loop but the lexicon was helpful.

1 Like