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.
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.
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.
AFAIK that’s actually the only way we’ve currently got to remove effects at all.
Seconding Clangeddin’s thumbs-up. Go for it. Code snippet:
effect eEffect = GetFirstEffect(oTarget);
while (GetIsEffectValid(eEffect))
{
if (GetEffectType(eEffect) == EFFECT_TYPE_POLYMORPH)
RemoveEffect(oTarget, eEffect);
eEffect = GetNextEffect(oTarget);
}