Remove polymorph on enter

#1

Hey, what would be the most optimal way to remove the polymorph onenter?

I was thinking just on going through all the effects the player had and remove it if it was a polymorph but there might be or better way to do it?

Thanks.

#2

Yes, you should go with your idea of cycling through every effect and remove it (when found).
In some scripts I have seen the cycle restarting when the effect is found (in case the effect is a linked effect), I’m not sure if this is truly necessary though, I never really bothered to test the two different implementations.

1 Like
#3

AFAIK that’s actually the only way we’ve currently got to remove effects at all. :thinking:

Seconding Clangeddin’s thumbs-up. :slight_smile: Go for it. Code snippet:

    effect eEffect = GetFirstEffect(oTarget);
    while (GetIsEffectValid(eEffect))
        {
        if (GetEffectType(eEffect) == EFFECT_TYPE_POLYMORPH)
            RemoveEffect(oTarget, eEffect);

        eEffect = GetNextEffect(oTarget);
        }
1 Like