# GetEffect

Effects
5.1 OC
any
string name Name of the effect without preceding 'Fx'. You can use '*' and '?' wildcards.
object target Target object in which to access effects. If `nil`, the global effects are accessed.
int index Effect index. With name specified and multiple matches for the search this will give you the indicated effect from the list of results.
int max_priority If not 0, only those effects are counted which have the specified priority or lower.
Retrieves a certain effect. If an effect cannot be found the return value is `nil`.
var i, effect; // Search all objects for (var obj in FindObjects(Find_And())) { // Count down from the effect count because effects are being removed i = GetEffectCount(0, obj); while (i--) if (effect = GetEffect("*Spell", obj, i)) RemoveEffect(0, obj, effect); } // remove global effects i = GetEffectCount(); while (i--) if (effect = GetEffect("*Spell", nil, i)) RemoveEffect(0, nil, effect);
Removes all magic effects from all objects and the global list.
Effects Documentation
AddEffect
CheckEffect
GetEffectCount
EffectCall
RemoveEffect
Sven2
2004-03