nwn

The RemoveEffect() NWScript command causes the specified effect to be removed from the indicated object. This will have no result unless that particular effect (not just one of the same type) was applied to the object earlier. That is, one must obtain the desired effect with GetFirst/NextEffect(); one cannot merely call an Effect*() command to create an effect identical to the one to be removed.

Definition

void RemoveEffect (object oCreature, effect eEffect)

object oCreature
the object (not necessarily a creature) from which the effect will be removed.
effect eEffect
The effect that will be removed.

Obtaining the effect to be removed is often accomplished with a loop along the lines of the following.

effect eSearch = GetFirstEffect(oTarget);
while ( GetIsEffectValid(eSearch) )
{
    if ( /* Testing the effect goes here */ )
        RemoveEffect(eSearch, oTarget);

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


See also