# GetEffect

Effects
4.9.5.0 CE
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 0, 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. If name is not specified, this index is the effect number. Effect numbers do not necessarily run continuously from 0 to the number of effects. When using the index, this continuity is ensured.
int query_value Index of the value to be retrieved. See remarks.
int max_priority If not 0, only those effects are counted which have the specified priority or lower.
Retrieves effect data or determines whether a certain effect is present. The return value depend on the requested value. If an effect cannot be found the return value is always 0.
Using the parameter query_value the following values can be retrieved:

query_value
Value
0
Effect number
1
Name
2
Priority
3
Timer interval
4
Command target
5
Command target id
6
Duration of the effect

var obj, i, effect; // Alle Objekte durchsuchen while (obj=FindObject(0, 0,0,0,0, 0, 0,0, 0, obj)) { // Von Effektzahl abwärts zählen, da Effekte entfernt werden i = GetEffectCount(0, obj); while (i--) if (effect = GetEffect("*Spell", obj, i)) RemoveEffect(0, obj, effect); } // Globale Effekte entfernen i = GetEffectCount(); while (i--) if (effect = GetEffect("*Spell", 0, i)) RemoveEffect(0, 0, effect);
Removes all magic effects from all objects and the global list.
Effects Documentation
AddEffect
ChangeEffect
CheckEffect
GetEffectCount
EffectCall
EffectVar
RemoveEffect
Sven2
2004-03