GetFirstEffect

The   and   NWScript commands iterate through all effects on the specified object. This can be useful both for determining if a creature is under the effect of a particular type of effect and for locating an effect that should be removed. As with the other  and   pairs of commands,   is used to initialize the iterator while   moves the iterator to the next item.

Definition
When there are no remaining effects to be returned, an invalid effect will be returned. This commonly leads to scripts that look similar to the following.

effect eSearch = GetFirstEffect(oTarget); while ( GetIsEffectValid(eSearch) ) {   // Do something, often testing the effect first.

// Update the loop. eSearch = GetNextEffect(oTarget); }